Hi everone,

I searched Biostars for BAM/SAM to FASTA conversion method, and found the tools EMBOSS Picard could do this (https://www.biostars.org/p/6970/). I am wondering is there any perl script to accomplish this work? I should note that my seq data is strand-specific seq, so the command `samtools view filename.bam | awk '{OFS="\t"; print ">"$1"\n"$10}'` may not be very good.

I appreciate any of your solutions. Thanks a lot!
For future record: samtools versions >1.3 can convert bam to fasta directly via `samtools fasta`

    samtools --help

    Program: samtools (Tools for alignments in the SAM format)
    Version: 1.4 (using htslib 1.4)
    
    Usage:   samtools <command> [options]
    
    Commands:
      [...]
      -- File operations
         [...]
         fastq          converts a BAM to a FASTQ
         fasta          converts a BAM to a FASTA
      [...]

