Question: Extract aligned exactly 1 time fron Bowtie2?
gravatar for star
6 months ago by
star0 wrote:

I have an output from Bowtie2 aligner as below:

16075710 reads; of these:
16075710 (100.00%) were unpaired; of these:
375049 (2.33%) aligned 0 times
11575941 (72.01%) aligned exactly 1 time
4124720 (25.66%) aligned >1 times
97.67% overall alignment rate

I like to extract unique aligns from that results, I also use below command but they do not give me correct number of unique aligns.

samtools view -Sh data.sam | grep -e "^@" -e "XM:i:[0][^0-9]" | grep -v "XS:i:" | wc -l


samtools view -hf 0x2 data.sam | grep -v "XS:i:" | wc -l 

ADD COMMENTlink modified 6 months ago by Jennifer Hillman Jackson25k • written 6 months ago by star0
gravatar for Jennifer Hillman Jackson
6 months ago by
United States
Jennifer Hillman Jackson25k wrote:


This forum is focused on Galaxy usage, so I'll give you two way to do this.

Line command help for a similar query is posted at Biostars (general):

To do the same filtering in Galaxy, use one of these tools:

  • NGS: SAMtools > Filter SAM on bitwise flag values
  • NGS: BamTools > Filter BAM datasets on a variety of attributes

Followed by one of these:

  • Filter and Sort > Select lines that match an expression
  • Text Manipulation > Search in textfiles (grep)

Related Q&A (Galaxy usage):

Thanks! Jen, Galaxy team

ADD COMMENTlink modified 6 months ago • written 6 months ago by Jennifer Hillman Jackson25k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 173 users visited in the last hour