Quickest Way To Pull A List Of Reads Out Of A Bam File?
What is the quickest way find the final aligned locations of a list of reads in BAM file? I can call
samtools view my.bam | grep -e uniqueID1 -e uniqueID2 > output
to grep for uniqueID1 and uniqueID2 in my.bam, but crawling through the SAM is quite slow. I'd like to call:
handyTool extractID my.bam -l listOfIdentifiers > output
and get the SAM line for each identifier found in the BAM. Is there a better way?
• 5,008 views
•
link
1 answer
duplicate of:
• 0 views
•
link
Log in to answer this question.
I'm not sure if there's another tool, but you could always use
As I have tried before, grep -f is extremely slow for this purpose.