How to generate consensus fasta uninterleaved from bam?
1
0
Entering edit mode
5.2 years ago

Hello, I first extracted the fasta format consensus from various bam files. I used two different commands for the same purpose and both resulted in an interspersed fasta, from what I understand the overlapping reads are interspersed. However, I was wondering if there is a way to get the non-interleaved fast.

comando BBmap e samtools para extrair o fasta:

 for i in *.bam; do reformat.sh in=$i out=${i}.fa; done



 for i in *.bam; do sample_name=`echo $i | awk -F "." '{print $1}'`; samtools fasta -@ 16 $i > ${sample_name}.fa; done

both generated interleaved format fasta:

>E00382:156:HMFJCCCXX:1:1102:7659:38315/2
TTCCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGTATTTTCGTCTGGGGGGTATGCACGCGATAGCATTGCGAGACGCTGGAGCCGGAGCACCCTATGTCGCAGT
>E00382:156:HMFJCCCXX:1:1105:22019:53803/1
ATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGTATTTTCGTCTGGGGGGTATGCACGCGATAGCATTGCGAGACGCTGGAGCCGGAGCACCCTATGTCGCAGTATCTGTCTTTGATTCCTGCCCCA
>E00382:156:HMFJCCCXX:1:1105:26545:21210/1
CTACTTCAGGGCCATAAAGCCTAAATAGCCCACACGTTCCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGTATTTTCGTCTGGGGGGTATGCACGCGATAGCATT
>E00382:156:HMFJCCCXX:1:1106:19116:22757/1
CATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACG

can anyone help me generate non-interleaved fastas from multiple files?

sequence genome • 1.1k views
ADD COMMENT
0
Entering edit mode

Hello elienesantossilva09!

It appears that your post has been cross-posted to another site: Cross-posted on: http://seqanswers.com/forums/showthread.php?t=90651

This is typically not recommended as it runs the risk of annoying people in both communities.

ADD REPLY
0
Entering edit mode

Hello elienesantossilva09 ,

you seems to be puzzled by what information all the different filetypes contain. I guess your question here is related to the one in you other thread? Have you take a look at the tutorial I've linked to over there? Is this what you are looking for?

fin swimmer

ADD REPLY
0
Entering edit mode
5.2 years ago

Hello, I first extracted the fasta format consensus from various bam files.

I don't think you did. You just converted the bam file to fasta format.

I think there are filtering options in samtools fasta to get it to return only one read or the other at a time.

ADD COMMENT

Login before adding your answer.

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