Question: How to create consensus from bam file without IUPAC code?
0
gravatar for Sureshkumar V.
2.7 years ago by
Sureshkumar V.0 wrote:

Hello,

I am working in Genome assembly(Reference Guided), I want to create consensus sequence from bam file.I tried bcftools and vcf-consensus. But, I got some IUPAC code. I want consensus sequence without IUPAC Code.

Reads:

ATGCATGCATGC

ATGCGTGCATGC

ATGCATGCATGC

Consensus: ATGCRTGCATGC

I want to create like this:

ATGCATGCATGC

Please suggest any tool or software. Thanks in advance.

sequence assembly genome • 1.6k views
ADD COMMENTlink modified 19 months ago by DNAngel60 • written 2.7 years ago by Sureshkumar V.0
2

Can't you write a bit of code to "resolve" these ambiguous nucleotides, and randomly chose one of the options? It's obviously not fully correct, but what do you think is the best for a heterozygous variant?

ADD REPLYlink written 2.7 years ago by WouterDeCoster44k

Did you find out how to create the consensus sequences without IUPAC codes? I'm having the same problem using samtools and bcftools.

ADD REPLYlink written 19 months ago by DNAngel60
1
gravatar for toralmanvar
2.7 years ago by
toralmanvar840
toralmanvar840 wrote:

Suresh,

Before converting IUPAC ambiguity base symbols to regular bases, I would suggest you to go through the below mentioned post and understand its relation with ploidy.

Questions Regarding Consensus Sequence Calling With Samtools / Bcftools / Vcfutils.Pl

However, if you are still interested in doing it, then kindly check the weblink:

https://genomicislands.wordpress.com/2014/06/27/converting-ambiguity-codes-in-fasta-files/

Where a person has provided a simple python code to randomly convert ambiguity codes in a FASTA file i.e given a consensus fasta, it randomly choose one of the segregating alleles based on the ambiguity codes. This is very much similar to what WouterDeCoster has mentioned in his comment above.

note: I have not tried this python script myself.

ADD COMMENTlink written 2.7 years ago by toralmanvar840
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1037 users visited in the last hour