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.
how can i filter a sam file from a paf file
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?
• 2,326 views
•
link
1 answer
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?
• 0 views
•
link
• 0 views
•
link
Log in to answer this question.
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.