This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to use and generate consensus sequence from input multiple sequence alignemnt file

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.

#!/usr/bin/perl
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.

sequence alignment consensus

0 answers

No answers yet.

Log in to answer this question.