Question: How to use and generate consensus sequence from input multiple sequence alignemnt file
gravatar for rkumar
4.6 years ago by
rkumar0 wrote:

Dear All,

This is my first post and first time using and learning Bioperl for bioinformatics applications.

I have a multiple sequence alignemnt file and I am trying to print out the consensus sequence based for the whole alignement. The problem is how do you run the program to print the consensus sequence. Below I am pasting the code which I got from the Bioperl Wiki page.

Any help will be greatly appreciated. Thank you.


use warnings;
use strict;
use Data::Dumper;
use Bio::SimpleAlign;
use Bio::AlignIO;

my $aln = Bio::SimpleAlign->new('msa_A_PreS1.aln');
print $aln->length;
print $aln->num_residues;
my $threshold_percent = 90;
my $consensus_with_threshold = $aln->consensus_string($threshold_percent);

my $iupac_consensus = $aln->consensus_iupac();   # dna/rna alignments only                        

my $percent_ident = $aln->percentage_identity;

my $seqname = ''; #'gnl|hbvcds|AB014370_PreS1_P-A';                                                
my $pos = $aln->column_from_residue_number($seqname, 14);


I want to print the whole consensus sequence and not just a specific position or column.


alignment sequence consensus • 1.6k views
ADD COMMENTlink written 4.6 years ago by rkumar0
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: 901 users visited in the last hour