Hello,
I am analyzing two disting BioProjects together from SRA. My pipeline was: Fastp > salmon > tximport into R
Now I would like to perform batch correction using the combat-seq()
comand from the sva package based on the BioProject
. However, since the tximport data frame is more complex than a simple count-matrix, I am not sure how to do that. Which column of the txi dataframe is DESeq2 using for calculating DE genes?
My idea was to using the following code:
txi <- tximport(files, type = "salmon", tx2gene = tx2gene, ignoreTxVersion = T)
### Batch Correction ###
batch = colData$BioProject
ComBat_seq(txi$counts, batch=batch, group=NULL)
After which I would proceed with DEseq2 as follows:
ddsTxi <- DESeqDataSetFromTximport(txi,
colData = colData1,
design = ~ BioProject + condition)
Could somebody tell me if that is the correct approach?
Thank you in advance.