Question: convert sam into paf format
gravatar for archanaverma433
6 weeks ago by
archanaverma4330 wrote:

I have to convert the aligned sam file to paf for miniasm. Can anyone suggest any tool?

ADD COMMENTlink modified 21 days ago by rlorigro10 • written 6 weeks ago by archanaverma4330

I don't think you can see:

It would be best to realign with minimap2 and choose SAM output.

ADD REPLYlink written 6 weeks ago by GenoMax95k
gravatar for rlorigro
21 days ago by
rlorigro10 wrote:

Looks like no one has actually read the question correctly. PAF is missing lots of information compared to SAM, because it is a summary of alignment, but it also has easy access to the alignment start and stop coordinates, sequences lengths, etc. Since PAF is less information-dense you cannot convert in both directions, but there's no reason why you can't convert from SAM to PAF.

There are several options:

  1. Use Heng Li's experimental toolkit, htsbox samview -p in.bam:
  2. Use paftools sam2paf:
  3. Use this python library:

I've been looking for the answer to this question, and I am planning on using #2.

I'm not sure how "Matches" are interpreted, but the existence of a sam2paf converter implies that it probably counts all M operations (match "=" or mismatch "X") regardless of the true identity of the reference vs read within the Match block.

ADD COMMENTlink written 21 days ago by rlorigro10
gravatar for ATpoint
6 weeks ago by
ATpoint44k wrote:

There is no direct way to do that. Realignment is necessary, see the developers (Ih3) answer here: (the first hit when searching for convert sam to paf by the way...).

Here is a section that explains how:

ADD COMMENTlink modified 6 weeks ago • written 6 weeks ago by ATpoint44k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1689 users visited in the last hour