My goal is to make PCA and correlation plots of my RNA-Seq BAM files. Some useful discussion on BioStars such as this, have helped guide my steps.
## edgeR:: calcNormFactors tmp.NormFactors <- calcNormFactors(object = raw.counts, method = c("TMM"), doWeighting = FALSE) ## raw library size: tmp.LibSize <- colSums(raw.counts) ## calculate size factors: SizeFactors <- tmp.NormFactors * tmp.LibSize / 1000000
In my analyses, I used
DESeq2 instead of
edgeR, after importing SALMON quantification using tximport, using syntax instructions at BioConductor, as follows:
library(DESeq2) Design <- DataFrame((cbind(BiolRep, Genotype, TimePoints))) dim(Design) # 144 3 rownames(Design) <- colnames(txi.salmon$counts) design_formula <- ~ TimePoints * Genotype dds <- DESeqDataSetFromTximport(txi.salmon, Design.df, design_formula) NormValues <- estimateSizeFactorsForMatrix(counts(dds))
So my 1st question is this:
To use DESeq2-based size Factors for converting BAM to BigWig, using bamCoverage of deepTools, I would still need to calculate
SizeFactors as follows, rather than use just the (inverse of the)
NormValues, am I right?
SizeFactors <- NormValues * LibSize / 1000000
And my 2nd question is :
SizeFactors calculated as above, I'd then have to use the inverse of those values to obtain my final normalized BAM files as inputs for use with deepTools, with the following syntax, am I right?
bamCoverage -b $BAM_IN -o $BigWig_OUT --normalizeUsing None --scaleFactor $(1/Size_factor) --effectiveGenomeSize $ACGTtotalCount
Could you please confirm or correct the approach I have indicated above? Thanks in advance!