SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bowtie: How to retain only uniquely mapped reads? EstherKLather Bioinformatics 10 03-25-2018 12:39 AM
TopHat and uniquely aligned reads bgibb Bioinformatics 13 10-02-2013 10:45 PM
How to retrieve un-aligned reads from Bowtie shuang Bioinformatics 1 10-17-2011 02:35 PM
Dindel problem: overlapping windows and non-uniquely re-aligned reads Yilong Li Bioinformatics 5 03-07-2011 03:10 PM
Uniquely mapped reads with bowtie mapper Bioinformatics 2 11-22-2010 11:44 PM

Reply
 
Thread Tools
Old 09-16-2012, 01:21 AM   #1
anurupa
Member
 
Location: india

Join Date: Jan 2012
Posts: 14
Default how to get uniquely aligned reads from bowtie

hi
i have rum bowtie 2 using —very-sensitive option and got result like this

Code:
14559177 reads; of these:
  14559177 (100.00%) were unpaired; of these:
    4317487 (29.65%) aligned 0 times
    7816644 (53.69%) aligned exactly 1 time
    2425046 (16.66%) aligned >1 times
70.35% overall alignment rate
i just want to get the uniquely aligned reads alone i,e., 53.69% of reads (78126644). but my output file (sam format) seems to have the those which are aligned>1 times how to get rid of them?

in previous versions of bowtie i use to use -m option for that
anurupa is offline   Reply With Quote
Old 09-18-2012, 06:37 AM   #2
danielr
Member
 
Location: Sweden

Join Date: Sep 2009
Posts: 11
Default

Filter based on having the same read name (1st column) at multiple rows, or based on the mapping quality (5th column).
danielr is offline   Reply With Quote
Old 09-18-2012, 08:57 AM   #3
lindylou
Junior Member
 
Location: united kingdom

Join Date: Oct 2008
Posts: 4
Default

filter on the 5th column, only retain reads with a q score of 255. This is the score given to all reads that are uniquely mappable. If you have bam files you can use

samtools view -q 255 your.bam > your_filtered.sam
lindylou is offline   Reply With Quote
Old 11-15-2012, 07:19 AM   #4
MGineste
Member
 
Location: Montpellier, France

Join Date: Feb 2011
Posts: 21
Default

Quote:
Originally Posted by anurupa View Post
hi
i have rum bowtie 2 using —very-sensitive option

i just want to get the uniquely aligned reads alone i,e., 53.69% of reads (78126644). but my output file (sam format) seems to have the those which are aligned>1 times how to get rid of them?

in previous versions of bowtie i use to use -m option for that
Bonjour anurupa,

I'm encountering the same trouble following switching from bowtie1 to bowtie2. Did you find out a satisfying solution ?

I'm not sure that a filtering based on MAPQ using [samtools view -q] gives the desired result, as a condition for "uniqueness" for a given read is that its MAPQ is high on the best mapped position AND "much" higher than in any other mapped position.

Mathieu
MGineste is offline   Reply With Quote
Old 11-15-2012, 07:26 AM   #5
MGineste
Member
 
Location: Montpellier, France

Join Date: Feb 2011
Posts: 21
Default

Bowtie2 must somehow define what is a unique alignment (may it be related to the MAPQ or not). This definition remains unclear to me.

Mathieu
MGineste is offline   Reply With Quote
Old 11-15-2012, 08:28 AM   #6
MGineste
Member
 
Location: Montpellier, France

Join Date: Feb 2011
Posts: 21
Default

SAM files created by bowtie contains a 'XS:' tag for reporting secondary alignments for a given read.

You can check that the number of lines containing the 'XS:' tag corresponds to the number of reads showing >1 alignment(s) :
Code:
grep 'XS:' your_alignment_file.sam | wc -l
A working solution consists in removing the lines containing the ':XS' tag using sed :
Code:
sed '/XS:/d' your_alignment_file.sam > your_alignment_file_1alignmentonly.sam
(Thanks go to Christelle, our group's everyday-very-valuable bioinformatician...).
MGineste is offline   Reply With Quote
Old 11-15-2012, 08:48 PM   #7
anurupa
Member
 
Location: india

Join Date: Jan 2012
Posts: 14
Default

you are correct MGineste. I have filtered my reads by
Code:
 grep -v XS:i: my file>output
anurupa is offline   Reply With Quote
Old 10-11-2019, 09:05 AM   #8
chefarov
Junior Member
 
Location: Chania Greece

Join Date: Oct 2014
Posts: 2
Default

Removing the lines with "XS:" will leave the corresponding headers behind, which could create a problem to SAM/BAM viewers. That happened in my case.
chefarov is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 06:08 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO