SEQanswers

SEQanswers (http://seqanswers.com/forums/index.php)
-   Bioinformatics (http://seqanswers.com/forums/forumdisplay.php?f=18)
-   -   Finding unmapped reads using samtools (http://seqanswers.com/forums/showthread.php?t=7553)

Ash 10-28-2010 03:59 AM

Finding unmapped reads using samtools
 
Hi guys,

Samtools is truly amazing! However, there's a couple of things I was wondering about...

Is there any way of pulling out those reads in a bam file, using samtools, where one pair of the read has mapped and the other pair of the read has not?

Or those reads where one pair of the read has mapped and the other mapped in a position that was not expected, say for example 5 or 10kb further upstream?

All help gratefully received!

A

drio 10-28-2010 04:40 AM

Study carefully the SAM specification, particularly the flag field. Once you know
what flag to use, go ahead and use the filter capabilities in samtools view (-f/-F INT)
to extract the reads you are interested on.

For example (show me reads where the mate is ummapped):
Code:

$  samtools view -f 8 foo.bam

Ash 10-28-2010 07:20 AM

Many thanks for your response drio. I think it may take me some time deciphering the intricacies of the flag field (a good few posts to read on this site!), so I'll be back with more dumb questions after this!

All the best,

A


All times are GMT -8. The time now is 03:05 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.