rule bam_to_fasta:
    """BAM to Fasta conversion for Pacbio BAM file

    Required input:
        - __bam_to_fasta__input_bam

    Required output:
        - __bam_to_fasta__output_fasta

     References:
         `sequana.pacbio <http://sequana.readthedocs.io/en/master/references.html#sequana.pacbio.BAMPa    cbio>`_

    """
    input: __bam_to_fasta__input_bam
    output: __bam_to_fasta__output_fasta
    threads: 4
    run:
        from sequana import pacbio
        p = pacbio.BAMPacbio(input[0])
        p.to_fasta(output[0], threads=threads)
