Question: Find consensus sequence of several DNA sequences
gravatar for Bella_p
15 months ago by
Bella_p50 wrote:


I have a list of around 200 different DNA sequences, each ~150 bp long, and I'd like to find a consensus sequence for all of them. I'm sure there is probably a function that does that which I'm not familiar with. Does anyone know which package/function to use to do that? I prefer in python, but R is also OK....


ADD COMMENTlink modified 15 months ago by • written 15 months ago by Bella_p50

Hwave you tried a multiple sequence alignment?

Any of these tools should provide you with a consensus sequenc:

ADD REPLYlink written 15 months ago by YaGalbi1.4k
gravatar for
15 months ago by
Philadelphia, PA wrote:

You can use Biopython to create a consensus sequence.

#!/usr/bin/env python

import sys
from Bio import AlignIO
from Bio.Align import AlignInfo

alignment =[1], 'fasta')
summary_align = AlignInfo.SummaryInfo(alignment)

Save as, run as python input.fasta x, where x is the percentage of sequences to call a position in the consensus sequence; i.e. python input.fasta 0.5 would mean that a residue or nucleotide would have to be represented in 50% of the sequences to call that position.

ADD COMMENTlink written 15 months ago by
Please log in to add an answer.


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