BAM to FASTA
1
0
Entering edit mode
7.0 years ago
ivamoresq • 0

Hi everyone,

I am new working with Samtools and I need to convert a .BAM to a .fasta. I checked all the posts that I could but I do not have what I am looking for.

I used: samtools view filename.bam | awk '{OFS="\t"; print ">"$1"\n"$10}'

I did not get the .fasta format that I use to see. The .fasta generated has some "cuts" and "intervals" with a several number of "Ns". I am looking for a continuous "normal" .fasta and I do not mind whether it has Ns at all.

I also saw this, but did not tried: samtools bam2fq input.bam | seqtk seq -A > output.fa (Could this one help me?)

Thanks very much Community,

Ivan

bam to fasta bam fasta samtools • 8.4k views
ADD COMMENT
5
Entering edit mode
7.0 years ago
GenoMax 141k

Current samtools (v.1.x) has fasta option to convert BAM to Fasta.

Usage: samtools fasta [options...] <in.bam>
ADD COMMENT

Login before adding your answer.

Traffic: 1974 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6