Bioperl: Extracting genes from GenBank flat file

Ewan Birney birney@ebi.ac.uk
Tue, 6 Jun 2000 16:36:10 +0100 (GMT)


On Tue, 6 Jun 2000, gert thijs wrote:

> I am trying to develop an some perl script to extract the location of CDS or
> genes in a DNA sequence based on the features described in the genbank flat
> file. 
> I have two question:
> - Has anyone ever tried such things before? I haven't found anything browsing
> through the mail archive.
> - I use Bio::DB::GenBank to download a sequence from genbank, now I was
> wondering if the features in the genbank description are also downloaded and
> stored somewhere. I thought I could use the annotation object to extract this
> information but this seems not to be the case. 
> I use something like this:
> $seq = $gb->get_Seq_by_acc($Accn[$i]);
> $ann = $seq->annotation();

you want to get teh SeqFeatures with

   $seq->top_SeqFeatures();

annotation is the "header" to the GenBank file, Features are the sequence
features in the feature table.


  go

  foreach $feat ( $seq->top_SeqFeatures() ) {
	if( $feat->primary_tag() eq 'CDS' ) {
	   foreach $exon ( $feat->sub_SeqFeature() ) {
              print "start",$exon->start," end ",$exon->end,"\n";
           }
        }
  }


This is not, I have to admit, well layed out in the documentation. Feel
free to contribute better documentation and we will try to address this in
the next release.



> print $ann->description();
> 
> But then $ann->description() seems to be an empty string.
> So now I not sure how to use theses objects anymore.
> 
> Has anyone some advice for me?
> 
> Thanks,
> Gert Thijs
> 
>  
> -- 
> ==========================================================
> + Gert Thijs              gert.thijs@esat.kuleuven.ac.be +
> +                                                        +
> + Dept. Elektrotechniek ESAT-SISTA                       +
> + Kardinaal Mercierlaan, 94                              +
> + B-3001 HEVERLEE  Belgium                               +
> + Tel :  +32-16-32 18 84 ---- Fax : +32-16-32 19 70      +
> ==========================================================
> =========== Bioperl Project Mailing List Message Footer =======
> Project URL: http://bio.perl.org/
> For info about how to (un)subscribe, where messages are archived, etc:
> http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
> ====================================================================
> 

-----------------------------------------------------------------
Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
<birney@ebi.ac.uk>. 
-----------------------------------------------------------------

=========== Bioperl Project Mailing List Message Footer =======
Project URL: http://bio.perl.org/
For info about how to (un)subscribe, where messages are archived, etc:
http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
====================================================================