Thank you for this very clear and elucidating explanation!
This might be a stupid question, but I have to figure this out -> I want to get unaligned reads when I run bowtie2
I tried every variation of --un I could think of. For example, I found this option in biostars:
bowtie2 -t -p 2 -q --phred33-quals --mm -x Human_rRNA -1 R1.fq -2 R2.fq -S out.sam --un unaligned.sam
This didn't work - I tried moving the --un location, giving a directory, specifying file name (/unaligned/unaligned.fq) using --un-gz All this didn't work
Then I tried --un-conc and now I get out files
bowtie2 -t -p 2 -q --phred33-quals --mm -x Human_rRNA -1 R1.fq -2 R2.fq -S out.sam --un-conc unaligned.sam
But is it the same as unaligned? I essentially want samtools -f 4 reads, in the original pairs
Any elucidation will be most welcome
1 answer
From bowtie2 manual:
--un <path> write unpaired reads that did not align to <path>
--un-conc <path> write pairs that did not align concordantly to <path>
The reason why --un returns nothing is probably because all your reads are paired, so --un-conc would be the way to go. On the other hand, --un-conc is different than just outputing reads that did not align (samtools -f 4), because, as described, it will return any pair that did not align concordantly (concordantly = both reads mapped on the same chromosome within reasonable distance of each other, defined by the -X and -I parameters).
To illustrate the difference, think of a read pair with one mate mapped and the other unmapped. samtools -f 4 will only return you the read that is unmapped, while bowtie2 --un-conc will give you the full pair.
Log in to answer this question.