how can i filter a sam file from a paf file
1
0
Entering edit mode
14 months ago
Mark • 0

I used minimap2 to produce an alignment and I outputted it into 2 formats, .paf and .sam. I did some filtering on the .paf version and now I would like to filter the alignments in the .sam file the same way. How can I use the filtered .paf file to filter the .sam file so that only the same alignments exist in each file?

paf sam filter • 1.2k views
ADD COMMENT
0
Entering edit mode

Just save yourself a lot of pain and learn to filter the sam/bam file efficiently. It is much more of a widespread standard than PAF.

ADD REPLY
2
Entering edit mode
14 months ago
Trivas ★ 1.8k

A quick search shows that paf2sam doesn't exist because a .paf file doesn't contain the CIGAR strings that .sam files have. A work around could be to convert your .paf to a bed file using splice2bed then use the bedtools suite such as bedtools intersect to limit your .bam file.

What are your end goals with this .sam file?

ADD COMMENT
1
Entering edit mode

samtools view can be used to limit a bam file for intervals in a BED via random access / the index, that is way more efficient than using intersect which goes through the entire file.

ADD REPLY

Login before adding your answer.

Traffic: 1395 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