BioPerl

 view release on metacpan or  search on metacpan

Bio/Tools/GFF.pm  view on Meta::CPAN

objects (see the documentation for each of these methods)

Note that these objects will not have the features attached - you have
to do this yourself, OR call

  $gffio->features_attached_to_seqs(1)

PRIOR to parsing; this will ensure that the Seqs have the features
attached; ie you will then be able to call

  $seq->get_SeqFeatures();

And use Bio::SeqIO methods

Note that auto-attaching the features to seqs will incur a higher
memory overhead as the features must be cached until the sequence data
is found

=head1 TODO

Make a Bio::SeqIO class specifically for GFF3 with sequence data

=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 one
of the Bioperl mailing lists.  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
the bugs and their resolution.  Bug reports can be submitted the web:

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

=head1 AUTHOR - Matthew Pocock

Email mrp-at-sanger.ac.uk

=head1 CONTRIBUTORS

Jason Stajich, jason-at-biperl-dot-org
Chris Mungall, cjm-at-fruitfly-dot-org
Steffen Grossmann [SG], grossman at molgen.mpg.de
Malcolm Cook, mec-at-stowers-institute.org

=head1 APPENDIX

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

=cut

# Let the code begin...

package Bio::Tools::GFF;

use vars qw($HAS_HTML_ENTITIES);
use strict;

use Bio::Seq::SeqFactory;
use Bio::LocatableSeq;
use Bio::SeqFeature::Generic;

use base qw(Bio::Root::Root Bio::SeqAnalysisParserI Bio::Root::IO);

my $i = 0;
my %GFF3_ID_Tags = map { $_ => $i++ } qw(ID Parent Target);

# for skipping data that may be represented elsewhere; currently, this is
# only the score
my %SKIPPED_TAGS = map { $_ => 1 } qw(score);


=head2 new

 Title   : new
 Usage   : my $parser = Bio::Tools::GFF->new(-gff_version => 2,
                                             -file        => "filename.gff");
           or
           my $writer = Bio::Tools::GFF->new(-gff_version => 3,
                                             -file        => ">filename.gff3");
 Function: Creates a new instance. Recognized named parameters are -file, -fh,
           and -gff_version.
 Returns : a new object
 Args    : named parameters
           -gff_version => [1,2,3]

=cut

{   # make a class variable such that we can generate unique ID's over
    # a session, no matter how many instances of GFF.pm we make
    # since these have to be unique within the scope of a GFF file.

    my $gff3_featureID = 0;

    sub _incrementGFF3ID {
        my ($self) = @_;
        return ++ $gff3_featureID;
    }
}


sub new {
    my ($class, @args) = @_;
    my $self = $class->SUPER::new(@args);



( run in 1.045 second using v1.01-cache-2.11-cpan-39bf76dae61 )