fogellab / multiWGCNA

an R package for deep mining gene co-expression networks in multi-trait expression data
13 stars 2 forks source link

Error in `palette()` #8

Closed zhenqiangfu closed 1 month ago

zhenqiangfu commented 7 months ago

Hello, thank you for providing this efficient tool. I encountered a drawing problem during use. as follows:

diffModuleExpression(autism_networks[["combined"]], geneList = topNGenes(autism_networks[["combined"]], "combined_003"), design = sampleTable, test = "ANOVA", plotTitle = "combined_003", plot = TRUE) Error in palette(): ! Insufficient values in manual scale. 3 needed, but only 2 provided. Run rlang::last_trace() to see where the error occurred.

I look forward to your answer. Best wishes.

dariotommasini commented 7 months ago

Hi @zhenqiangfu ,

I'm having trouble reproducing this. Are you running the autism vignette? Maybe you can try installing from devel and see if the error persists? This is what happens when I do it:

> diffModuleExpression(autism_networks[["combined"]],
+                      geneList = topNGenes(autism_networks[["combined"]], "combined_003"),
+                      design = sampleTable,
+                      test = "ANOVA",
+                      plotTitle = "combined_003",
+                      plot = TRUE)
Screenshot 2023-11-24 at 6 32 33 PM
zhenqiangfu commented 7 months ago

@dariotommasini, Thanks for your answer. I guess it is because I set three conditions. I have three tissues.

dariotommasini commented 7 months ago

At the moment, multiWGCNA can only handle two conditions, e.g. disease status and tissues. That said, three tissues should be no problem, because that just means that the tissue condition has 3 classes. Your sample table would look something like this if you had 4 conditions like the astrocyte vignette:

> sampleTable
DataFrame with 36 rows and 3 columns
                Sample     Disease      Region
           <character> <character> <character>
EAE_1            EAE_1         EAE         Cbl
EAE_2            EAE_2         EAE         Cbl
EAE_3            EAE_3         EAE         Cbl
EAE_4            EAE_4         EAE         Cbl
EAE_5            EAE_5         EAE         Cbl
...                ...         ...         ...
healthy_12  healthy_12          WT       Hippo
healthy_13  healthy_13          WT          Sc
healthy_14  healthy_14          WT          Sc
healthy_15  healthy_15          WT          Sc
healthy_16  healthy_16          WT          Sc