Hi everone,
I searched Biostars for BAM/SAM to FASTA conversion method, and found the tools EMBOSS Picard could do this (Convert Bam File To Fasta File). 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!
Hi Istvan, thank you very much for your answer. It's much helpful for my work. I just have two more minor questions: (1) my samtools version is Version: 0.1.8 (r613). I did not see
samtools bam2fq
function, so I need to update samtools? (2) Additionally is seqtk inside samtools? If not, where to get it? Thanks a lot!You need to update samtools to at least 1.1 http://www.htslib.org/
Get seqtk from https://github.com/lh3/seqtk see also How To Obtain And Install Seqtk
Hi Istvan, your answer is really helpful.