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
ok! Thanks!
Now on Biostars: https://www.biostars.org/p/497108/
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!
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.