This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Get read id's from .sam file

I want to extract mapped read ids (only) from multiple .sam files (where each sam file contains reads mapped to a unique set of genomes), then create new sam files that do not have any mapped read id's contained in other sam files.

Just a simple method to extract all the mapped read id's from a sam file would be a good start. But I haven't been able to find a tool to do this (could write this in python but would be horrendously slow)

sam

Not sure I understand exactly what you want to do, but you can extract only mapped reads from a sam file based on the flag and using samtools:

samtools view -h -F 4 in.sam > out.sam

0 answers

No answers yet.

Log in to answer this question.