[Bioperl-l] ID line parsing in swiss.pm

Emmanuel Mongin mongin@ebi.ac.uk
Thu, 7 Feb 2002 17:03:15 +0000 (GMT)


Hi,

The STANDARD/PRELIMINARY tag in SWISS-PROT (ID line) entries does not seem
to be parsed by swiss.pm. This is quite useful to know if the entry is a
SWISS-PROT or and sptrembl entry.
This could be stored in the annotation object, something called like
entry_tag.



$line =~ /^ID\s+([^\s_]+)(_([^\s_]+))?\s+([^\s;]+);\s+([^\s;]+);/ 
     || $self->throw("swissprot stream with no ID. Not swissprot in my
book");
   if( $3 ) {
       $name = "$1$2";
       $seq->division($3);
   } else {
       $name = $1;
       $seq->division('UNK');       
   }

##################
#Get here the entry tag
 $seq->annotation->add_Annotation('entry_tag',$4);
##################

   $seq->primary_id($1);
   $seq->alphabet('protein');
    # this is important to have the id for display in e.g. FTHelper,
otherwise
    # you won't know which entry caused an error
   $seq->display_id($name);
 

Any comments?

Emmanuel


-----------------------------------------------------
Emmanuel Mongin mongin@ebi.ac.uk
Tel:        +44 (0)1223 49 46 87 
Mobile:	    +44 (0)7813 32 12 82
-----------------------------------------------------