![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
'Properly paired' reads in sam flag from TopHat mapping | AdamB | Bioinformatics | 9 | 03-08-2012 08:30 AM |
Inconsistency with SAM flag output? | mhayes | Bioinformatics | 7 | 11-18-2011 07:28 PM |
BWA output bitwise flag for mapped/unmapped reads | wenhuang | Bioinformatics | 1 | 08-29-2011 04:54 PM |
Is * really a valid value for a SAM FLAG field? | derobins | Bioinformatics | 1 | 01-20-2011 10:06 AM |
bfast for unmapped reads | Protaeus | Bioinformatics | 2 | 11-17-2010 03:35 PM |
![]() |
|
Thread Tools |
![]() |
#1 |
Junior Member
Location: Melbourne, Australia Join Date: May 2010
Posts: 3
|
![]()
Hi there,
I'm using BFAST to align Solexa reads to a very small portion of a genome (~3kb), and have been considering the best way to remove unmapped reads from the output since these unnecessarily bulk up the output .sam file. I know that samtools can filter an incoming .sam file using the -F command. However, I've read some documentation on the SAM flag format and must admit I find it pretty confusing. Within the flag field I know there are fields for both "the mate is unmapped" and "the query sequence itself is unmapped", but for non-paired-end Solexa reads can either of these be used for removing unmapped reads? Furthermore, what would be the integer or string used in the -F command? Alternatively, there is the option in samtools view to filter by map quality (MAPQ). Would setting map quality filter to e.g. 1 remove all unmapped reads without affecting the filtered alignment from BFAST postprocess? Alternatively again, dbamfilter within the DNAA package has the capacity to remove unmapped reads, but if samtools can do the job I'd like to minimise the number of apps employed. What are thoughts on the best strategy? Aiden |
![]() |
![]() |
![]() |
#2 |
Member
Location: Groningen Join Date: Feb 2010
Posts: 78
|
![]()
Hi Aiden,
I hope I'm not staing the obvious here, but are you familiar with Picard? They are some Java-based commandline tools to manipulate sam files and one of those may help you: ViewSam.jar. It basically prints a sam or bam file to the screen but you can set a flag to report all reads, just the aligned reads or just the unaligned reads. Take a look: http://picard.sourceforge.net/ Cheers, Wil |
![]() |
![]() |
![]() |
#3 | ||||
Senior Member
Location: 41°17'49"N / 2°4'42"E Join Date: Oct 2008
Posts: 323
|
![]() Quote:
Code:
1. Flag 0x02, 0x08, 0x20, 0x40 and 0x80 are only meaningful when flag 0x01 is present. Quote:
Code:
$ samtools view -F 4 ./foo.bam # display mapped reads only $ samtools view -f 4 ./foo.bam # display unmapped reads only Quote:
You need to do the postprocessing prior to be able to filter your reads anyway. Quote:
__________________
-drd |
||||
![]() |
![]() |
![]() |
#4 |
Junior Member
Location: Melbourne, Australia Join Date: May 2010
Posts: 3
|
![]()
Thanks for the very helpful replies, much appreciated.
|
![]() |
![]() |
![]() |
Thread Tools | |
|
|