[Bioperl-l] Re: pfam/swissprot domain info

Douglas Kojetin djkojeti at unity.ncsu.edu
Sun May 11 22:20:46 EDT 2003


I don't know how I figured this out on my own (well, with the help of 
the bioperl documentation, which is a bit intimidating), but here is 
the solution if anyone needs it in the future. One question though that 
I don't quite understand (it's probably just me). In the last 'if' 
statement, why do I have to use 'print' in the line?

e.g.
if (print $feat->each_tag_value($tag) =~ "/the_domain_of_interest/")
rather than
if ($feat->each_tag_value($tag) =~ "/the_domain_of_interest/")

Same result if i assign '$feat->each_tag_value($tag)' to a variable.



#####################################
use Bio::Index::SwissProt;
use Bio::SeqFeatureI;

my $protein = "a_name";
my $database = new Bio::DB::SwissProt;
my $seq = $database->get_Seq_by_id($protein);
@features = $seq->get_SeqFeatures();
foreach $feat (@features) {
   if ($feat->primary_tag eq "DOMAIN") {
     foreach $tag ( $feat->all_tags() ) {
       if (print $feat->each_tag_value($tag) =~ 
"/the_domain_of_interest/") {
         print $feat->start, "\t", $feat->end, "\n";
       }
     }
   }
}


Thanks for humoring me!
Doug


> I was wondering if there is any way to extract domain information
> either from swissprot or pfam directly. If you visit swissprot, there
> is information included in the 'features' that includes 'domain' ...
> 'mod_res' .. that have values for sequence length or number for the
> respective domain or important residue.



More information about the Bioperl-l mailing list