DeSeq Strategies for run to run Replication
1
0
Entering edit mode
Giorgio • 0
@b0635dc4
Last seen 2.6 years ago
United States

Hi all,

This is more a general (philosophical?) question:

  1. Say I have a dataset analyzed with DeSeq default, and a vst normalized dataset is obtained.

  2. The VST is then used to generate a final predictive ML model (binary) with only few genes from the VST dataset.

  3. Now I have a few samples that I re-rerun end-to-end with the exact same pipeline as above.

  4. After importing in DeSeq what normalization would you think to use in order to obtain a close VST from the original run?

  5. The goal is to predict correctly the new repeated samples.

I know there are millions of variables in play, but was curious to see what the folks would answer.

Thank you in advance

DESeq2 Normalization Clustering replicate • 1.1k views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 2 days ago
United States

You can use the same VST on the new samples. We have some help to do this in ?varianceStabilizingTransformation:

The variance stabilizing transformation from a previous dataset can be "frozen" and reapplied to new samples. The frozen VST is accomplished by saving the dispersion function accessible with dispersionFunction, assigning this to the DESeqDataSet with the new samples, and running varianceStabilizingTransformation with 'blind' set to FALSE. Then the dispersion function from the previous dataset will be used to transform the new sample(s).

ADD COMMENT
0
Entering edit mode

Dear Michael,

could you please comment on how to properly apply a vst transformation to a new dataset (in this case, left-out samples)? I have been breaking my head about this and cannot seem to get it correct. dds_test is currently two samples but this could vary in the future. Ideal use case is just one test sample.

a small example of my current script:

dds_train <- DESeqDataSetFromTximport(txi_train, colData = train_samples, design = ~ sex. + condition)
dds_train <- dds_train[keep, ] # some filtering for minimal expression 
dds_train <- DESeq(dds_train) # to obtain size/normalization factores, although I believe vst internally normalizes the data so this strictly isn't necessary 
vsd_train <- vst(dds_train, blind = TRUE)

dds_test <- DESeqDataSetFromTximport(txi_test, colData = test_samples, design = ~ 1)
dds_test <- dds_test[keep, ] # some filtering for minimal expression --> different genes ! almost complete overlap
dds_test <- DESeq(dds_test)
disp_fun_train <- dispersionFunction(dds_train)
normFactors_test <- counts(dds_test) / assays(dds_test)[["avgTxLength"]]
normFactors_test[normFactors_test == 0] <- 1
normFactors_test <- normFactors_test / exp(rowMeans(log(normFactors_test)))
normalizationFactors(dds_test) <- normFactors_test
dispersionFunction(dds_test) <- disp_fun_train
vsd_test <- varianceStabilizingTransformation(dds_test, blind = FALSE)


> sizeFactors(dds_train)
NULL
> dim(normalizationFactors(dds_train))
[1] 24307    85

I will further perform PCA on the train data and then project the vst-transformed left-out samples in the same PCA space.

Thank you in advance!

ADD REPLY

Login before adding your answer.

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