Last active
August 29, 2015 14:14
-
-
Save adomingues/c5a7a9aec382ef9ceb23 to your computer and use it in GitHub Desktop.
A simple way of converting bam files to fasta for testing purposes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bedtools bamtofastq -i $bam -fq temp.fq | |
awk '{if(NR%4==1) {printf(">%s\n",substr($0,2));} else if(NR%4==2) print;}' temp.fq > ${bam/.bam/.fa} | |
rm temp.fp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment