These documents are For the HEAD of the CVS repository on July 19, 2007 Api docs for previous releases

Modware

Gene

Summary Included libraries Package variables Synopsis Description General documentation Methods

Summary
   Modware::Gene - Convienent class to retrieve Modware::Feature::GENE objects.
Package variables top
No package variables defined.
Included modulestop
Modware::Root
Modware::Search::Gene
Inherit top
Modware::Root
Synopsistop
 # USE CASE: PRINT A LIST OF DICTYBASEIDS OF RELATED FEATURES

my $gene = new Modware::Gene( -feature_id => 4161 );

foreach $feature ( @{ $gene->features() } ) {
print $feature->primary_id()."\n";
}
Descriptiontop
   This class simply provides a convenient interface to create a gene object by passing in the
gene name as the parameter. The name is often more useful than a feature_id. If you pass
in a feature_id as a parameter and this does not correspond to a gene feature you get an error.

The object that is returned is a Modware::Feature::GENE object (see those docs for detailed
information about what methods are available), and 'new' will throw an error
if there is no gene with the name requested.

See also Modware::Feature and Modware::Feature::GENE
Methodstop
newDescriptionCode

Methods description

newcodetopprevnext
 Title    : new
Usage : my $gene = new Modware::Gene( -name => 'eriC' );
Function : creates a gene obejct based on either feature_id or name
Returns : reference to a Modware::Gene object
Args : named arguments
: -feature_id => number
: or
: -name => string (case sensitive)
:

Methods code

newdescriptiontopprevnext
sub new {
   my ($type, @args) = @_;

   my $self = {};
   bless $self, $type;

   my ( $gene_name, $feature_id, $name ) =  $self->_rearrange([qw(GENE_NAME feature_id NAME)], @args);

   $name = $gene_name if ($gene_name && !$name);

   $self->warn("-gene_name argument to Modware::Gene constructor is deprecated, use -name\n") if $gene_name;

   if ( $name ) {
      my @genes = Modware::Search::Gene->Search_by_name( $name );
      if ( scalar @genes > 1  ) { $self->throw("More than one gene names $name");   } 
      if ( scalar @genes == 0 ) { $self->throw("Could not find $name in database"); }
      return $genes[0];
   }
   $self = new Modware::Feature( -feature_id => $feature_id );

   $self->throw( "Not a valid gene name" ) if $self->type ne 'gene';


   return $self;
}

General documentation

AUTHOR - Eric Just top
   Eric Just e-just@northwestern.edu
APPENDIX top
   The rest of the documentation details each of the object
methods. Internal methods are usually preceded with a _