[Bioperl-l] Newbie alert: Aligning and printing first position

Diego M. Vadell dvadell at clustering.com.ar
Wed Mar 30 10:51:38 EDT 2011

Hi list,

    I have an alignment ( done with Bio::Tools::Run::Alignment::Clustalw ) 
that I can see ( printing $aln->match_line() along with the sequences ):

        ********* .:                                   (match_line)
.......TDDSFDTDVSSS.........[...].............   ($seq1)

    It looks right ( that "[...]" is mine, it's larger ). Now I want to get 
the position of the match ( the first "T" ), which should be "7". I thought I 
needed to use something like:

my $seq = $aln->get_seq_by_pos(1);
my $loc = $seq->location_from_column(1);
say $loc;

And $loc would be 7, but it's undef. If I try to iterate from 1 to 10, I start 
getting Bio::Location::Simple objects at the 8th place. So, should I loop 
untill I location_from_column() gives me an object? Is it another way of 
finding the position of the match?

As you can see, I'm just starting with bioinformatics. Any pointer will be 

Thanks in advance,
 -- Diego 

More information about the Bioperl-l mailing list