-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Hello @smorabit,
Thank you for creating and maintaining such an excellent package!
I have a categorical variable called "Invasive" describing the invasiveness of a tumor (invasive vs non-invasive). When running DME analysis in a cell cluster of interest, cluster 8, I see that the tan and yellow modules have a high average log2FC in invasive samples in this cluster (see lollipop plot).
However, when I conduct module trait correlation analysis, while the yellow module is positively correlated with Invasion status, the tan module is negatively correlated (see heatmaps). Given the DME results showing high differential ME activity in invasive cells in this cluster, I would expect both modules to be positively correlated with invasion status. I was wondering how this could be and if I might be misinterpreting these results. I have included the code used to create the plots below. Any information you could provide would be greatly appreciated and thank you for your consideration!
DME Analysis
group1 <- obj@meta.data %>% subset(test_clusters_2 == '8' & Invasive == 'Invasive') %>% rownames
group2 <- obj@meta.data %>% subset(test_clusters_2 == '8' & Invasive == 'Non-Invasive') %>% rownames
stem_inv_DMEs <- FindDMEs(
obj,
barcodes1 = group1,
barcodes2 = group2,
test.use='wilcox',
wgcna_name='hdWGCNA'
)
head(stem_inv_DMEs)
#Visualize
pdf('Clin_Graphs/Clust8_Invasive_DME_lolli.pdf')
PlotDMEsLollipop(
obj,
stem_inv_DMEs,
wgcna_name='hdWGCNA',
pvalue = "p_val_adj")+
ggtitle('Invasive Cluster 8 Differential Expression')+
theme(
plot.title = element_text(size = 18, face = "bold"), # title size
)
dev.off()
Module Trait Correlation
#Convert to Numeric or Factor
obj$Max_dimension_cm <- as.numeric(obj$Max_dimension_cm)
obj$Ki67 <- as.numeric(obj$Ki67)
obj$Invasive <- as.factor(obj$Invasive)
# list of traits to correlate
cur_traits <- c('Max_dimension_cm','Ki67', 'Invasive')
obj <- ModuleTraitCorrelation(
obj,
traits = cur_traits,
group.by='test_clusters_2'
)
# get the mt-correlation results
mt_cor <- GetModuleTraitCorrelation(obj)
#Plot
pdf('Clin_Graphs/Module_Trait_hmap2.pdf', height = 14, width = 12)
PlotModuleTraitCorrelation(
obj,
label = 'fdr',
label_symbol = 'stars',
text_size = 2,
text_digits = 2,
text_color = 'black',
high_color = 'red',
mid_color = 'white',
low_color = 'blue',
plot_max = 0.2,
combine=TRUE)
dev.off()