Categories
status

To find out what method is attached to a …

To find out what method is attached to an object in BioPerl during debugging, use ref commend.

>x ref($seq)

It’ll show the class where the object belongs to and search for the class.
Not so funny… Any other way?
NB. As it was said, the commend working during the debugging session; perl -d

Categories
status

Simple code example to retrieve annotati …

Simple code example to retrieve annotations

 1 #!/usr/bin/perl -w
  2     
  3 use strict;
  4 use Carp;
  5 use Bio::SeqIO;
  6 
  7 my $embl_file = shift;
  8 my $informat = "embl";
  9 
 10 my $seq_in = Bio::SeqIO -> new(-file => "<$embl_file",
 11                                -format => $informat)
 12                 or croak("File Open Error: $embl_file\n");
 13 
 14 while (my $seq = $seq_in->next_seq) {
 15 
 16 
 17 # ID
 18 $seq->primary_seq->display_id();
 19 # AC
 20 $seq->primary_seq->accession_number();
 21 
 22 # DE
 23 $seq->primary_seq->desc();
 24 
 25 # CC
 26 my $annotation = $seq->annotation();
 27 my @comments = $annotation->get_Annotations('comment');
 28 foreach my $comment (@comments){
 29     print $comment->as_text;
 30 }
 31 
 32 
 33     print "\n";
 34 }
 35 
 36 $seq_in->close() or croak("Close error: $embl_file\n");

Categories
post

Install BioPerl

When you have a problem during installing BioPerl using CPAN, use the -H option. It will initialize Home environment. With this option, I managed to install BioPerl on my Mac OS X 10.5 Leopard.

sudo -H cpan

Categories
status

Wow, BioPerl is a beast with more than 8…

Wow, BioPerl is a beast with more than 800 module dependencies.
I managed to install BioPerl on Mac OS X.