Get read id's from .sam file
0
0
Entering edit mode
3.4 years ago
daewowo ▴ 80

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 • 1.2k views
ADD COMMENT
1
Entering edit mode

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
ADD REPLY

Login before adding your answer.

Traffic: 1528 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6