[Bioperl-l] parsing msf file (sorry last question about it)

Dave Messina David.Messina at sbc.su.se
Mon Sep 28 11:28:27 UTC 2009


Hi Paola,

> my $alnio = Bio::AlignIO->new( -file=>"my file.msf");
> my $aln = $alnio->next_aln;
>
> my $s1 = $aln->get_seq_by_pos(1);
> my $s2 = $aln->get_seq_by_pos(2);
>
> my $col = $aln->column_from_residue_ number( $s1->id, 21)


# extract sequences and check values for the alignment column $pos
  foreach my $seq ($aln->each_seq) {
      my $res = $seq->subseq($col, $col);
     if ($res eq 'A') {
         # do something
     }
  }


Please try the above code. I haven't tested it, but I think it will do what
you want.

Best,
Dave

PS - I found that code in the documentation for Bio::Align::AlignI. Right
now there is an effort to improve the BioPerl documentation, and it would be
helpful if you could let us know where you looked for the answer to your
question so we can try to make it easier to find.

Did you look in Bio::AlignIO? Did you also look anywhere else?

Thanks for your help!



More information about the Bioperl-l mailing list