[Bioperl-l] Re: Bio::SeqFeature CDS tag start-Method (PR#1010)

Hilmar Lapp hilmarl@yahoo.com
Fri, 14 Sep 2001 11:46:12 -0400


> Full_Name: Andreas Hewelt
> Module: Bio::SeqFeature
> Version: 0.6.1

I strongly recommend you upgrade to the latest 0.7.x. 0.6.1 contains a number of
bugs. All comments below refer to 0.7.x or the developer's release 0.9.0.

> PerlVer: 5.00404

Note also that all releases after 0.7.x will require at least Perl 5.005. We've
had a number of problems with 5.004.

> OS: DEC-OS V4.0
> Submission from: panther.rz-berlin.mpg.de (141.14.144.148)
> 
> 
> Dear bioperl developer,
> 
> I use the Bio::SeqFeature objects like
> 
> $inputStream = Bio::SeqIO -> new("-file"   => $ARGV[0],
>                                  "-format" => "genbank");
> 
> while($seqObj = $inputStream -> next_seq())
> {
>      foreach $seqFeatObj ($seqObj -> all_SeqFeatures())
>      {
>         print "primary_tag ",$seqFeatObj -> primary_tag,"\n",
>                 "\tstart ",$seqFeatObj -> start,"\n",
>                 "\tend ",$seqFeatObj -> end,"\n";
> 
>           # ***** Get the coding sequence *****
>           if($seqFeatObj -> primary_tag eq "CDS")
>           {
>                $cdsStart = $seqFeatObj -> start;
>                $cdsEnd   = $seqFeatObj -> end;
>           }
> 
> ....
> 
> I want to check whether a GenBank entry contains a complete coding
> sequence or not. A non complete cds is indicated by
> 
>      CDS             <1..4850
> 
> Unfortunately, in this situation the expression
> 
> $cdsStart = $seqFeatObj -> start;
> 

In 0.7.x this will still return 1, but it is interpreted information, with a
Bio::Location::CoordinatePolicy object handling the interpretation. To speak
English, there is now a method $seqFeatObj->location(), which returns a
Bio::LocationI object. Bio::LocationI defines methods {start,end}_pos_type(),
which tell you the type of the start (and end, respectively) location.

Hope this helps. The new location model is quite flexible; let us know if you
need more help with this.

	-hilmar