Biotech > FAQ > BioPerl FAQ (Frequently Asked Questions)

How do I parse the CDS join or complement st...

To see other biotech frequently asked questions, please visit http://biotech.fyicenter.com/faq/

(Continued from previous question...)

How do I parse the CDS join or complement statements in GenBank or EMBL files to get the sub-locations?

For example, how can I get the the coordinates 45 and 122 in join(45..122,233..267) ?

You could use primary_tag to find the CDS features and the Bio::Location::SplitLocationI object to get the coordinates:

foreach my $feature ($seqobj->top_SeqFeatures){
  if ( $feature->location->isa('Bio::Location::SplitLocationI') and $feature->primary_tag eq 'CDS' ) {
     foreach my $location ( $feature->location->sub_Location ) {
       print $location->start , ".." , $location->end, "\n";
     }
  }
}

(Continued on next question...)

Other Frequently Asked Questions