Christopher Fields > BioPerl-1.6.921 > Bio::SeqFeature::Tools::TypeMapper



Annotate this POD


New  12
Open  5
View/Report Bugs
Module Version: 1.006921   Source   Latest Release: BioPerl-1.6.924


Bio::SeqFeature::Tools::TypeMapper - maps $seq_feature->primary_tag


  use Bio::SeqIO;
  use Bio::SeqFeature::Tools::TypeMapper;

  # first fetch a genbank SeqI object
  $seqio =
  $seq = $seqio->next_seq();

  $tm = Bio::SeqFeature::Tools::TypeMapper->new;

  # map all the types in the sequence
                  variation=>sub {
                      my $f = shift;
                      $f->length > 1 ?
                        'variation' : 'SNP'

   # alternatively, use the hardcoded SO mapping


This class implements an object for mapping between types; for example, the types in a genbank feature table, and the types specified in the Sequence Ontology.

You can specify your own mapping, either as a simple hash index, or by providing your own subroutines.


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 lists Your participation is much appreciated.                         - General discussion  - About the mailing lists


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

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.

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 via the web:

AUTHOR - Chris Mungall ^



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


 Title   : new
 Usage   : $unflattener = Bio::SeqFeature::Tools::TypeMapper->new();
 Function: constructor
 Example : 
 Returns : a new Bio::SeqFeature::Tools::TypeMapper
 Args    : see below


 Title   : typemap
 Usage   : $obj->typemap($newval)
 Example : 
 Returns : value of typemap (a scalar)
 Args    : on set, new value (a scalar or undef, optional)


 Title   : map_types
 Usage   :
 Example :
 Returns : 
 Args    :

 dgg: added -undefined => "region" option to produce all valid SO mappings.


 Title   : map_types_to_SO
 Usage   :
 Example :
 Returns : 
 Args    :

hardcodes the genbank to SO mapping

Based on revision 1.22 of SO

Please see the actual code for the mappings

Taken from

dgg: separated out FT_SO_map for caller changes. Update with:

  open(FTSO,"curl -s|");
    chomp; ($ft,$so,$sid,$ftdef,$sodef)= split"\t";
    print "     '$ft' => '$so',\n" if($ft && $so && $ftdef);             


 Title   : get_relationship_type_by_parent_child
 Usage   : $type = $tm->get_relationship_type_by_parent_child($parent_sf, $child_sf);
 Usage   : $type = $tm->get_relationship_type_by_parent_child('mRNA', 'protein');
 Function: given two features where the parent contains the child,
           will determine what the relationship between them in
 Example :
 Returns : 
 Args    : parent SeqFeature, child SeqFeature OR
           parent type string, child type string OR

bioperl Seq::FeatureHolderI hierarchies are equivalent to unlabeled graphs (where parent nodes are the containers, and child nodes are the features being contained). For example, a feature of type mRNA can contain features of type exon.

Some external representations (eg chadoxml or chaosxml) require that the edges in the feature relationship graph are labeled. For example, the type between mRNA and exon would be part_of. Although it stretches the bioperl notion of containment, we could have a CDS contained by an mRNA (for example, the Bio::SeqFeature::Tools::Unflattener module takes genbank records and makes these kind of links. The relationship here would be produced_by

In chado speak, the child is the subject feature and the parent is the object feature

syntax highlighting: