[Bioperl-l] parsing msf file

Mark A. Jensen maj at fortinbras.us
Mon Sep 28 21:25:33 EDT 2009


Hi Paola--
I think you're saying you want to see if A is present in other 
sequences in the alignment at alignment column 5. Here's
where you use location_from_column, which is a method 
off the sequence object themselves. The idea is to do 

# $col is obtained as in your script...
for my $seq ($aln->each_seq) {
  if ( $seq->subseq( $seq->location_from_column($col) ) eq 'A') {
     print "si!";
  else {
     print "no!";
  }
}

You might find the code at 
http://www.bioperl.org/wiki/Site_entropy_in_an_alignment
helpful since it uses these principles. 
Mark
----- Original Message ----- 
From: "Paola Bisignano" <paola.bisignano at gmail.com>
To: <bioperl-l at lists.open-bio.org>
Sent: Monday, September 28, 2009 5:50 AM
Subject: [Bioperl-l] parsing msf file


> Hi dear friends,
> 
> I used Bio::AlignIO to parse msf file, using method
> colum_from_residue_number, as you suggested to obtain the position in
> the alignment of  residues of interest (in contact with my ligand) and
> I have to do a check of the residue:
> I want to extract the type of the residue...I ask my question using
> the number of the residue in the PDB, and i want the script return
> also the residue so if I want to know the position af ala21, I  will
> do:
> 
> 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)
> 
> and It will return the position (es. 5) but I want to check if in
> position 5 of the alignment there is A (for ala)....I looked in
> documentation, but I couldn't find anything for that
> 
> 
> Thank you all for help you gave and will give to me,
> 
> best regards,
> 
> paola
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 
>


More information about the Bioperl-l mailing list