[Bioperl-l] LocatableSeq object vs Sequence Object

Peter H. Baenziger plu5even at gmail.com
Tue Oct 17 12:26:34 EDT 2006


All,
This is my first bioperl script (but not my first Perl script) so
please forgive my naivety.  I've read through documentation and looked
through cookbooks and the like but to no avail.  Any advice is
appreciated.
 So...I am working with an alignment object of several sequences.  My
intentions is to loop through all the sequences of the alignment to
find what amino acid they have at a known position in the alignment
(not the position in the sequence).  I was thinking I could use:
foreach $seq ($alignment->each_seq())
to loop through the sequences and call:
$seq->location_from_column($pos)
on each of the sequences.  However, I don't think I have
"LocatableSequences" (the type of object that has method
"location_from_columns") being returned by $alignment->each_seq().
So, how do I bridge this gap here?  Or is there a better way?
My appreciation in advance!
Peter

 code:
my $swissObj = $swissdb->get_Seq_by_acc($query);  //put several of
these in @sequenceObjects
...
my $alignFactory = Bio::Tools::Run::Alignment::Clustalw->new();
    my $alignment = $alignFactory->align(\@sequenceObjects);
    #print $alignment->overall_percentage_identity(); #works

    #now we find the "alignment position" of the mutation we have on
the human version and get the amino acid at that "alignment position"
for all seq
    my $humanSequence = $prefix."HUMAN";
    my $pos = $alignment->column_from_residue_number($humanSequence,
$aa_seqpos); #this is the "alignment position" equivalent to the
mutation position

    #we'll keep track of what amino acid each species has at the
"alignment equivalent" location listed as being a mutation on the the
human version
    foreach $seq ($alignment->each_seq())
    {
        #print $seq->species() . "\n"; #won't work because
$alignment->each_seq() actually returns a locatableSeq object, not a
normal sequence object
        $speciesAA{$species} = $seq->locatation_from_column($pos);
    }


-- 
<<->>
Peter H. Baenziger


More information about the Bioperl-l mailing list