# apply TMM on counts imported from salmon using Tximeta

I used Tximeta to import a summarisedExperiment from the salmon output (used with genocide transcriptome v34). I need to produce 4 matrix of counts: - tx counts in TPM - gene counts in TPM - tx counts normalised - gene counts normalised

The first two I used assay(se, "counts") and assay(gse, "counts") respectively.

Mu problem is to apply the normalisation to them. I used deseq2 to estimate the size factors with a fake design because there are no groups yet in the dataset so I used ~gender to been able to generate a adds object to apply the EstimateSizeFactor, but when I try to see them returns me 'NULL'

> dds_genes <-DESeqDataSet(gse, design = ~ gender)
> dss_genes <- DESeq2::estimateSizeFactors(dss_genes)

> DESeq2::sizeFactors(dss_genes)
[1] NULL


I get count values like this after using these commands (which I am not really sure they are really normalised;

normalized_counts <- DESeq2::counts(dss_genes, normalized=T)
normalized_counts[1:10, 1:10]

ENSG00000000003.15  654.92903  771.34051  500.1863  560.30530 1144.8295  938.40446 1173.208233  896.28964  388.1482   501.20545
ENSG00000000005.6     0.00000    0.00000    0.0000    0.00000    0.0000    0.00000    1.344747    0.00000    0.0000     0.00000
ENSG00000000419.12  416.59305  399.05434  675.0911  285.64627  551.8253  424.59423  461.448691  679.08099  365.8343   461.66276
ENSG00000000457.14  242.52226  244.91792  279.9109  414.24494  262.8790  354.50834  451.671501  427.08499  407.7070   329.50667



I don't know how to proceed to just get a TMM normalised values from tximeta object. That would be my preferred option. I guess deseq2 can also provide me with normalised data.

Maybe there are other ways?

Thank you for the help!!

Regards

• Those values are already normalized, is there a reason you want TMM instead? It's not substantially any better in practice to the RLE method in DESeq2. May 30 '20 at 17:53
• Please read the DESeq2 vignette. If you have tximeta/tximport objects then use DESeqDataSetFromTximport. This takes care to import the offset matrix that corrects for average gene length. All relevant code is in the vignette. May 31 '20 at 10:25
• But Devon, the sizeFactors should give me the scaling values, right? or not? I am missing something May 31 '20 at 12:53
• and yes, I would be happy with the DESeq2 normalisation :), just trying to figure out which is used, and how can I see it on my data. May 31 '20 at 13:08
• @ATpoin: Thank you. I followed the last vignette: bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/… . The 'Tximeta for import with automatic metadata' says the following data: coldata <- samples coldata$files <- files coldata$names <- coldata\$run library("tximeta") se <- tximeta(coldata) ddsTxi <- DESeqDataSet(se, design = ~ condition) Is this importing also the offsets? How can I check this? Thank you for your help! May 31 '20 at 13:15