convert bam to fasta
0
1
Entering edit mode
5.6 years ago
Maloki ▴ 10

Hi, I'm new in the field of NGS, I have sequenced a bacterial genome by iontorrent sequencer but I didn't put the reference genome for my sequence, So I've got an unaligned bam file Ubam. then I used the Torrent suite software to align my genome, I've got a new bam file which I want to convert it to fasta. My new fasta file put each read in a line with the sign " >" when I'am using : awk '{print ">" S1 "\n" S10}' So, I would like to know How can I put all the reads one beside one with one symbol " >" in the first line only?

thanks

genome alignment sequencing • 4.6k views
ADD COMMENT
0
Entering edit mode

I would like to know How can I put all the reads one beside one with one symbol " >" in the first line only?

Putting all reads under one > fasta header would not make any sense. So sounds like what you want is a consensus sequence in fasta format? The way to do that is described on the samtools/bcftools page.

ADD REPLY
0
Entering edit mode
ADD REPLY
0
Entering edit mode

Use the following command line of samtools:

## Converting BAM to fastq/fasta ##
samtools fasta input.bam > output.fasta
samtools fastq input.bam > output.fastq
ADD REPLY
0
Entering edit mode

This is most likely not applicable to what OP is asking.

ADD REPLY

Login before adding your answer.

Traffic: 1813 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