text: user6273: I have a bunch of PAF files resulting from the alignments of fastq files on a reference genome with minimap2. I would like to convert them into SAM/BAM format so I can use samtools mpileup to recover the read coverage at filtered positions
  So far I've looked at paftools.js and found sam2paf but no paf2sam
  I am open to suggestions but I'd like to avoid mapping the reads again. 
  Edit
  I have opened an issue on minimap2's github
  Answer from Heng Li :
  
  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.
  
  
  user7349: The paf format does not have the CIGAR string and base quality information that are typically present in a BAM/SAM file. While it is in principle possible to write a paf2sam converter, it's going to be very difficult to regenerate the CIGAR string with all the indel information (and maybe it's probably impossible to do so) that you'll need in a BAM/SAM file. If your motivation is to get coverage information, it might make more sense to convert the paf file into a bed file, before using a tool like bedtools to convert it into a coverage track.
  
original_text: 6273: <p>I have a bunch of <a href="https://github.com/lh3/miniasm/blob/master/PAF.md" rel="nofollow noreferrer">PAF files</a> resulting from the alignments of fastq files on a reference genome with <a href="https://lh3.github.io/minimap2/minimap2.html" rel="nofollow noreferrer">minimap2</a>. I would like to convert them into SAM/BAM format so I can use <code>samtools mpileup</code> to recover the read coverage at filtered positions</p>
  
  <p>So far I've looked at <code>paftools.js</code> and found <code>sam2paf</code> but no <code>paf2sam</code></p>
  
  <p>I am open to suggestions but I'd like to avoid mapping the reads again. </p>
  
  <p><strong>Edit</strong></p>
  
  <p>I have opened an issue on <a href="https://github.com/lh3/minimap2/issues/493" rel="nofollow noreferrer">minimap2's github</a></p>
  
  <p>Answer from Heng Li :</p>
  
  <blockquote>
    <p>You need to rerun alignment. No tools exist to convert paf to sam.</p>
  
  <pre><code>why there is no paf2sam in paftools.js
  </code></pre>
    
    <p>It is technically possible, but someone needs to write the code.</p>
  </blockquote>
   7349: <p>The paf format does not have the CIGAR string and base quality information that are typically present in a BAM/SAM file. While it is in principle possible to write a paf2sam converter, it's going to be very difficult to regenerate the CIGAR string with all the indel information (and maybe it's probably impossible to do so) that you'll need in a BAM/SAM file. If your motivation is to get coverage information, it might make more sense to convert the paf file into a bed file, before using a tool like bedtools to convert it into a coverage track.</p>
  