Friday, October 17, 2014

Convert BAM files to FastQ files

Install the BedTools package.


(1) Convert BAM files to FastQ files
$ bedtools bamtofastq -i NA18152.bam -fq NA18152.fq

or
$ bamToFastq -i NA18152.bam -fq NA18152.fq

-fq2 Creating two FASTQ files for paired-end sequences

$ bedtools bamtofastq -i aln.qsort.bam -fq aln.end1.fq -fq2 aln.end2.fq


(2) Extract genomic sequences from bed regions
$bedtools getfasta -fi test.fa -bed test.bed -fo test.fa.out

No comments:

Post a Comment