Minimap2: convert PAF to SAM

Created on 10 Oct 2019  路  3Comments  路  Source: lh3/minimap2

Hi,

I have a bunch of PAF files that I would like to use with samtools mpileup to recover the read coverage for a given a list of genomic position. *Those PAFs are the results of ONT reads alignments against a reference.
As mpileup works with SAM/BAM format I would like to convert my PAF files to SAM format. I noticed sam2paf in paftools.js but no paf2sam.

Is there a way to make that conversion happens ?
Do you know any alternatives to mpileup that would work with PAF format ?

question

All 3 comments

Not a direct answer, but if you have access to the files used to generate the PAF, you can use them and generate sam files with minimap2. This would be a nice workaround and you will be able to control the parameters.

There is also this evaluation method inside minimap2. Not sure if it will do what you are looking for:

Evaluating mapping accuracy with simulated reads
The pbsim2fq command of paftools.js converts the MAF output of pbsim to FASTQ and encodes the true mapping position in the read name in a format like S1_33!chr1!225258409!225267761!-. Similarly, the mason2fq command converts mason2 simulated SAM to FASTQ.

Command mapeval evaluates mapped SAM/PAF. Here is example output:

The splice2bed allows to convert paf to BED, and then use bedtools coverage which accepts BAM/BED/GFF/VCF file(s)

Hope any of this can help you.

Hey @Jungal10, thanks for this fast answer. I do have access to the files used to generate the PAF, but I would prefer not to re-run the alignments.
The splice2bed & bedtools coverage idea sounds great, but I am looking to use only PAF, SAM or BAM, because I need those format later in the pipeline. I'll take a look though !

Also I am pretty interested in understanding why there is no paf2sam in paftools.js :)

You need to rerun alignment. No tools exist to convert paf to sam.

why there is no paf2sam in paftools.js

It is technically possible, but someone needs to write the code.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

a-89 picture a-89  路  3Comments

llevar picture llevar  路  4Comments

a-89 picture a-89  路  7Comments

fritzsedlazeck picture fritzsedlazeck  路  8Comments

teshomem picture teshomem  路  8Comments