Extraction Of Desired Alignments From Sam File
1
0
Entering edit mode
11.0 years ago
Raghav ▴ 100

hello every one,

after running bowtie2 by using "bowtie2-align -f AT_ref -f GAC.fasta -S 1.sam" and got the details summery 616571 reads; of these:

616571 (100.00%) were unpaired; of these:

180433 (29.26%) aligned 0 times

306495 (49.71%) aligned exactly 1 time

129643 (21.03%) aligned >1 times,

as I guess, my chimeric reads would be in 129643 (21.03%) aligned >1 times out of 616571 reads; but I am not be able to extract these alignments from my output sam file. I don't know how to write syntax for this purpose. please suggest me.

thank you

sam bowtie2 • 2.7k views
ADD COMMENT
1
Entering edit mode

The bowtie2 executable is actually a Perl wrapper script that calls the compiled bowtie2-align binary. It is recommended that you always run the bowtie2 wrapper and not run bowtie2-align directly.

ADD REPLY
1
Entering edit mode
11.0 years ago
bow ▴ 790

Here's one way to extract duplicate alignments from a SAM file.

Note that I'm assuming duplicate alignments == SAM records with the same QNAME

samtools view -F 0x4 input.sam | cut -f1 | sort | uniq -d | grep -F -f - input.sam

I haven't tested this, but you should do samtools view input.sam | cut -f1 | sort | uniq -d | wc -l first, to see if you get the same counts for duplicate reads as bowtie2's. If it's not the same, try playing around with the -f and/or -F flag to filter the reads first (I'm using -F 0x4 already to filter out unmapped reads).

ADD COMMENT

Login before adding your answer.

Traffic: 3007 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6