dada2
dada2 copied to clipboard
Removing singletons after pair merging in the Seqtab table
Hello, I am a novice when it comes to R so excuse this basic question. I have been following the dada2 pipeline and have created the seqtab.nochim after pair merging and removing singletons. I noticed that I have 20 or so singletons when running the dim(seqtab.nochim) command.
So my question is, how do I remove these from my data set?
Here is my code chunk: seqtab <- makeSequenceTable(merged, orderBy='abundance') abundance_table <- table(nchar(getSequences(seqtab))) seqtab.nochim <- removeBimeraDenovo(seqtab, method = "consensus", multithread=TRUE, verbose = TRUE) dim(seqtab.nochim) sum(seqtab.nochim)/sum(seqtab)
Thank you for the help!!!
The number of reads corresponding to each ASV across the whole study is available by taking the colSums
of the seqtab
, since each column is a different ASV. So, to remove all ASVs present only once (or less) across all samples:
is1 <- colSums(seqtab.nochim) <= 1
seqtab.no1 <- seqtab.nochim[,!is1]
Thank you so much for your help! This worked.