Question: rlog, lfcShrink and vst on gene subset
gravatar for giulia.pasquesi
4 months ago by
giulia.pasquesi0 wrote:

I am analyzing a dataset that includes both gene and transposable element raw counts. 
I am only interested in analyzing the differential expression of TEs, but still need to create and normalize the entire dataset. For the DE analysis itself it is not a major problem, because I can retrieve the results and filter out the genes. However, I was interested in plotting the variance-stabilized transformation of the data (or the rlog) and the PCA for the TEs only, ignoring the genes.
Is there a way to do this directly in DeSeq2?
I was thinking of providing an additional feature data column specifying "gene" or "TE", but then I don't know if it  is possible post-normalization to use only the "TE" subset to make transformations and lfcShrink.

Thank you so much 


ADD COMMENTlink modified 4 months ago by Michael Love19k • written 4 months ago by giulia.pasquesi0

Have you tried simply row-subsetting the DESeqDataSet before calling the model fitting functions?

ADD REPLYlink written 4 months ago by Wolfgang Huber13k
gravatar for Michael Love
4 months ago by
Michael Love19k
United States
Michael Love19k wrote:

If you want to plot for example, the PCA for just some samples, you can provide a subsetted DESeqTransform object to plotPCA:

ADD COMMENTlink written 4 months ago by Michael Love19k

I did't know about the [idx] flag but isn't it gonna specify the samples I want to include? I would like to plot the variances for only a subset of genes (therefore by rows and not by column in a matrix. Provided the normalization was based on all genes, otherwise the library size would be incorrect and bring to a weird normalization) for all samples.

I apologize if I wasn't clear the first time.


ADD REPLYlink written 4 months ago by giulia.pasquesi0

The way indexing works in R is, if you use [ ... , ... ], the first element indexes rows (here, genes) and the second element indexes columns (samples). If you leave out an element, it provides all. So [idx,] gives a subset of the rows and all of the columns.

See here:

ADD REPLYlink modified 4 months ago • written 4 months ago by Michael Love19k

Thank you so much for the clarification. 
It is exactly what I was looking for!


ADD REPLYlink written 4 months ago by giulia.pasquesi0
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 394 users visited in the last hour