Extracting gene lists per timepoints using DEGPPatterns package and LRT
0
0
Entering edit mode
Rob • 0
@9a3af295
Last seen 17 months ago
United Kingdom

Hello

I am using the DEGrepoprt (DEG patterns) package to create cluster diagrams of gene expression over time from experimental in vitro data.

I have been using the vignette to produce cluster diagrams as shown below. I am interested in how I can extract the list of genes for each timepoint, so that I could then prob the functions of particular genes at each of these timepoints. I assume since tthe package is able to plot this Data it must be feasible - however it doesn't seem to be listed on the vignette. What is listed is how two extract ALL the genes from each group, butt not by timepoints.

Code should be placed in three backticks as shown below

WBW Rob!

Here is my code:

dds <- DESeq(dds, test="LRT", reduced= ~1)
res <- results(dds)
res.df <- as.data.frame(res)
resultsNames(dds)

# Subset the LRT results to return genes with padj < 0.05

sig_res_LRT <- res %>%
               data.frame() %>%
               rownames_to_column(var="gene") %>% 
               as_tibble() 
               dplyr::filter(padj < padj.cutoff)
# Get sig gene lists
sigLRT_genes <- sig_res_LRT %>% 
                pull(gene)

length(sigLRT_genes)

# Subset results for faster cluster finding (for classroom demo purposes)
clustering_sig_genes <- sig_res_LRT %>%
                  arrange(padj) %>%
                  head(n=1000)

# Obtain rlog values for those significant genes
rld <- rlogTransformation(dds)

rld_mat <- assay(rld)

cluster_rlog <- rld_mat[clustering_sig_genes$gene, ]

clusters <- degPatterns(cluster_rlog, metadata = meta_data, time = "Time", col=NULL)                    

view(cluster_rlog)
# What type of data structure is the `clusters` output?

class(clusters)

# Let's see what is stored in the `df` component

head(clusters$df)

# Extract the Group 1 genes
cluster_groups <- clusters$df
cluster_groups$cluster <- as.factor(cluster_groups$cluster)

cluster_groups$symbol <- mapIds(EnsDb.Mmusculus.v79,
                     keys=cluster_groups$genes,
                     column="SYMBOL",
                     keytype="GENEID",
                     multiVals="first")

group1 <- cluster_groups %>%
          dplyr::filter(cluster == 1)
group2 <- cluster_groups %>%
          dplyr::filter(cluster == 2)

Cluster Diagram with timepoint genes outlined in purple.

DEGseq clusterProfiler DEGreport • 839 views
ADD COMMENT

Login before adding your answer.

Traffic: 509 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