This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Could I use a BAM file output to make a alignment with others FASTA references?

I am wondering about to use a BAM file output as a input to make a alignment to others FASTA reference genome. I have been reading how to get a FASTA format from my BAM file but I am not sure if the reads depth could affect my alignment. If that is possible, How could I do that?

bam fasta

2 answers

You can get the mapped/unmapped reads with the flags, check this post.

Then you can convert the bam file to fastq/fasta with bedtools bamToFastq

I have been reading how to get a FASTA format from my BAM file

If you use BBMap suite then it is as simple as

reformat.sh in=your.bam out=your.fa

to get fasta format sequences out. If you have paired end data then you may need to provide out1= out2= to contain the two fasta reads.

You should keep the reads in fastq format where possible so it would be best to do

reformat.sh in=your.bam out=your.fq

(see the note about paired-end reads above) and use them for next alignment.

I am not sure if the reads depth could affect my alignment.

Read depth should not affect the alignment since you are going to be individually aligning each read (or read-pair).

Log in to answer this question.