DEGpatterns and functional analysis of clusters
1
1
Entering edit mode
Giulia ▴ 10
@giulia-24930
Last seen 3.3 years ago

Good morning, I'm new in R programming (only 5 months) I have RNAseq data that I've analyzed with DESeq2. I wanted to perform a timecourse analysis to indentify gene module among different cell subpopulations. I performed LRT test and then I applied DEGpattern from DEGreport package. I obtained several clusters and now I want to perform functional analysis to explore associated functions of the gene groups of interest. But I had only the list of genes and the cluster. How can I exctract data (Fold Change, pvalue etc...) regarding specifical cluster genes from my DESeq2 results dataframe?

dds <- DESeqDataSetFromMatrix(countData = myMatrix,
                              colData = myMeta,
                              design = ~ celltype2)

dds_LRT <- DESeq(dds, test = "LRT", reduced= ~1)
res_LRT <- results(object = dds_LRT, )

# Subset results for faster cluster finding
sig_res_LRT <- res_LRT%>%
  data.frame() %>%
  rownames_to_column(var="gene") %>% 
  as_tibble() %>% 
  filter(padj < 10^(-5))
sigLRT_genes <- sig_res_LRT %>% 
             pull(gene)
write.csv(sig_res_LRT, 
           file= "Timecourse/DEG_000001.csv")

rld <- rlogTransformation(dds_LRT)
rld_mat <- assay(rld)

# Obtain rlog values for those significant genes
cluster_rlog <- rld_mat[sigLRT_genes, ]

#`degPatterns` function from the 'DEGreport' package to show gene clusters across sample groups 
png(filename = "Timecourse/Clusters.png", width = 800, height = 600)
clusters <- degPatterns(cluster_rlog, metadata = myMeta, time = "celltype2", col = NULL, plot = T)
dev.off()
colnames(cluster_rlog) <- myMeta$celltype2

# Extract the Group 1 genes
cluster_groups <- clusters$df
group1 <- clusters$df %>%
  filter(cluster == 1)
write.csv(group1, 
          file= "Timecourse/Clusters/Cluster_1_genelist.csv")

to perform GO analysis through clusterProfile, I need other data, like FC etc., in addition to the gene list of one specific cluster, doesn't it? Thanks in advance

DESeq2 RNASeq DEGreport • 3.7k views
ADD COMMENT
1
Entering edit mode
@mikelove
Last seen 1 day ago
United States

This question may be more appropriate for a forum like Biostars where you can find points on bioinformatic coding, where you don't need the attention of the package developer in particular. Or you may want to have a few meetings with a bioinformatician who could give some pointers as you are getting started.

The results table has rownames, so you can index the table by rows and by columns. E.g. res[genes,"pvalue"] would give you the pvalues for the genes named in the variable genes.

ADD COMMENT
0
Entering edit mode

ok! Thanks!

ADD REPLY
0
Entering edit mode
ADD REPLY
0
Entering edit mode

Does the results table have the information on tthe gene expression per timepoints in each group/cluster. So that you can then see the gene groups per timepoints? This doesnt seem to be covered in your Vignette Michael Love

I. e if one wants to look at tthe genes in Group 1 from timepoints 1, vs the genes expressed in Group 1 at timepoints 2 - how does one view these. As the cluster/group gene lists just show it as one group. Thanks!

ADD REPLY
0
Entering edit mode

This has been asked before on the support site. No, the results table doesn't do any "all combinations" analysis. You would have to write your own code to do these kinds of comparisons.

ADD REPLY

Login before adding your answer.

Traffic: 841 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6