BioPerl

 view release on metacpan or  search on metacpan

Bio/SeqIO/entrezgene.pm  view on Meta::CPAN

# BioPerl module for Bio::SeqIO::entrezgene
#
# You may distribute this module under the same terms as perl itself
#
# POD documentation - main docs before the code

=head1 NAME

Bio::SeqIO::entrezgene - Entrez Gene ASN1 parser

=head1 SYNOPSIS

   use Bio::SeqIO;

   # don't instantiate directly - instead do
   my $seqio = Bio::SeqIO->new(-format => 'entrezgene',
                               -file => $file);
   my $gene = $seqio->next_seq;

=head1 DESCRIPTION

This is EntrezGene ASN bioperl parser. It is built on top of 
L<Bio::ASN1::EntrezGene>, a low level ASN parser built by Mingyi Liu 
(L<http://sourceforge.net/projects/egparser>). The easiest way to 
use it is shown above.

You will get most of the Entrez Gene annotation such as gene symbol, 
gene name and description, accession numbers associated 
with the gene, etc. Almost all of these are given as  L<Bio::AnnotationI> objects.

If you need all the data do:

   my $seqio = Bio::SeqIO->new(-format => 'entrezgene',
                               -file => $file,
                               -debug => 'on' );
   my ($gene,$genestructure,$uncaptured) = $seqio->next_seq;

The second variable returned, C<$genestructure>, is a L<Bio::Cluster::SequenceFamily>
object. It contains all Refseqs and the genomic contigs that are associated 
with the particular gene. The third variable, C<$uncaptured>, is a reference 
to a plain array.

You can also modify the output to allow back compatibility with the old 
LocusLink parser:

   my $seqio = Bio::SeqIO->new(-format => 'entrezgene',
                               -file => $file,
                               -locuslink => 'convert');

The C<-debug> and C<-locuslink> options slow down the parser.

Example code which looks for ontology terms:

  my $eio = new Bio::SeqIO(-file => $file,
                           -format => 'entrezgene',
                           -service_record => 'yes');

  while (my $seq = $eio->next_seq) {
    my $gid = $seq->accession_number;
    foreach my $ot ($ann->get_Annotations('OntologyTerm')) {
      next if ($ot->term->authority eq 'STS marker'); # No STS markers
      my $evid = $ot->comment;
      $evid =~ s/evidence: //i;
      my @ref = $ot->term->get_references;
      my $id = $ot->identifier;
      my $fid = 'GO:' . sprintf("%07u",$id);
      print join("\t",$gid, $ot->ontology->name, $ot->name, $evid,
        $fid, @ref?$ref[0]->medline:''), "\n";
    }
  }

=head1 FEEDBACK

=head2 Mailing Lists

User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to
the Bioperl mailing list.  Your participation is much appreciated.

  bioperl-l@bioperl.org                  - General discussion
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists

=head2 Support 

Please direct usage questions or support issues to the mailing list:

I<bioperl-l@bioperl.org>

rather than to the module maintainer directly. Many experienced and 
reponsive experts will be able look at the problem and quickly 
address it. Please include a thorough description of the problem 
with code and data examples if at all possible.

=head2 Reporting Bugs

Report bugs to the Bioperl bug tracking system to help us keep track
of the bugs and their resolution. Bug reports can be submitted via
the web:

  https://github.com/bioperl/bioperl-live/issues

=head1 AUTHOR - Stefan Kirov

Email skirov at utk.edu

=head1 CONTRIBUTORS

Hilmar Lapp, hlapp at gmx.net

=head1 APPENDIX

This parser is based on Bio::ASN1::EntrezGene module.

The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _

=cut

package Bio::SeqIO::entrezgene;

use strict;
use Bio::ASN1::EntrezGene;
use Bio::Seq;
use Bio::Species;
use Bio::Annotation::SimpleValue;
use Bio::Annotation::DBLink;
use Bio::Annotation::Comment;



( run in 0.834 second using v1.01-cache-2.11-cpan-5735350b133 )