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

Modware::Feature

GENERIC

Summary Included libraries Package variables Synopsis Description General documentation Methods

Summary
   Modware::Feature::GENERIC - default Modware representation of a simple genome sequence feature (start, stop, strand)
Package variables top
No package variables defined.
Included modulestop
Bio::SeqFeature::Generic
Modware::Chromosome
Modware::Feature
Inherit top
Modware::Feature
Synopsistop
     my $tata_box = new Modware::Feature(
-type => 'TATA_box',
-source => 'test source',
-bioperl => $some_bio_seqFeature_generic_object,
-reference_feature => $some_chromosome_or_contig_object
);

# or
my $tata_box = new Modware::Feature( -primary_id => $id_of_some_tatabox_feature );

# since there is no Modware::Feature::TATA_BOX class a Modware::Feature::Generic class
# will get created
Descriptiontop
   Generic feature class.  Used for simple features with a start, stop, stop and no structure.
This default feature class is instantiated when Modware encounters a feature with a 'type'
that does not map to a class in Modware::Feature::*

The assumption is that the feature type can be represented by a Bio::SeqFeature::Generic object
(start, stop, strand, refernece feature)
Methodstop
_get_bioperlDescriptionCode
_initDescriptionCode
_update_cached_sequenceDescriptionCode
endDescriptionCode
insertDescriptionCode
lengthDescriptionCode
newDescriptionCode
shift_featureDescriptionCode
startDescriptionCode
updateDescriptionCode

Methods description

_get_bioperlcodetopprevnext
 Title    : _get_bioperl
Note : creates a bioperl object representing this Contig (Bio::SeqFeature::Generic)
Usage : called internally by lazy evaluated 'bioperl' method
Function : creates a bioperl object with a location on the chromosome's bioperl object.
Returns : nothing
Args : none
_initcodetopprevnext
 Title    : _init
Usage : called internally by constructor
: (hook to do any post-instantiation initialization)
Function : does nothing in Modware::Feature::GENERIC
Returns : nothing
Args : none
_update_cached_sequencecodetopprevnext
 Title    : _update_cached_sequence
Note : internal method for features that store sequences
Function : do not store sequences for generic features, does nothing here
Returns : nothing
Args : none
endcodetopprevnext
 Title    : end
Function : returns the end position relatve to a genomic
: reference feature (chromosome, contig, etc.)
Returns : integer base position
Args : none
insertcodetopprevnext
 Title    : insert
Function : calls SUPER::insert but then inserts the location
:
Returns : nothing
Args : none
lengthcodetopprevnext
 Title    : length
Function : returns the length of the feature
Returns : integer length
Args : none
newcodetopprevnext
 Title    : new
Note : never call this directly. Use new Modware::Feature with 'type' set to '

Usage : my $match = new Modware::Feature(
-type => 'match',
-source => 'blastn.10.19.2007',
-bioperl => $some_bio_search_hit_generichit_object
);
Function : called by Modware::Feature->new when type = 'match'
Returns : feature_id string
Args : named arguments: -source, -type, -bioperl (Bio::Search::Hit::GenericHit), -description
shift_featurecodetopprevnext
 Title    : shift_feature
Note :
Usage : To move a feature upstream by 125 bases:
: $feature->shift_feature( 25 );
Function : moves a feature by a specified amount
Returns : nothing
Args : integer ( + or - )
startcodetopprevnext
 Title    : start
Function : returns the start position relatve to a genomic
: reference feature (chromosome, contig, etc.)
Returns : integer base position
Args : none
updatecodetopprevnext
 Title    : update
Function : calls SUPER::update but then updates the location
:
Returns : nothing
Args : none

Methods code

_get_bioperldescriptiontopprevnext
sub _get_bioperl {
   my ($self, @args) = @_;

   my $bioperl  = new Bio::SeqFeature::Generic();

   $bioperl->start( $self->_featureloc() + 1 );
   $bioperl->end( $self->_featureloc() );
   $bioperl->strand( $self->_featureloc() ) if $self->_featureloc();

   $bioperl->primary_tag( $self->type() );
   $self->reference_feature();
  #
# returning a CONTIG object having a chromosome attached to it
# to chromosome ( in _get_contig_features() )
# results in weird behavior: if there are more than 8 contigs in the
# array the code breaks, but does not throw an error.
#
$bioperl->attach_seq( $self->reference_feature()->bioperl ) if $self->{'reference_feature'}; $self->bioperl( $bioperl );
}
_initdescriptiontopprevnext
sub _init {
   my ($self, @args) = @_;
}
_update_cached_sequencedescriptiontopprevnext
sub _update_cached_sequence {
   my ($self, $obj) = @_;

  #
# not updateing any seqs
#
}
enddescriptiontopprevnext
sub end {
   my ($self, @args) = @_;

   return $self->bioperl(@args);
}
insertdescriptiontopprevnext
sub insert {
   my ($self,  @args) = @_;
   $self->SUPER::insert();
   $self->_insert_featureloc();
}
lengthdescriptiontopprevnext
sub length {
   my ($self, @args) = @_;

   return $self->bioperl(@args);
}
newdescriptiontopprevnext
sub new {
   my ($type, @args) = @_;

  #
# do not bless it here, assume subclass will bless as a subclass type
#
my $self = {}; bless $self,$type; # You can pass in a chromosome_name or a reference _feature
# chromosome_name will probably be deprecated
my @arglist = qw( SOURCE DESCRIPTION CHROMOSOME_NAME START END REFERENCE_FEATURE ); my ( $source, $description, $chromosome_name, $start, $end, $reference_feature ) = $self->_rearrange( [@arglist], @args ); if ( !($chromosome_name xor $reference_feature)|| !$start || !$end ) { $self->throw( "Need -start, -end, and -chromosome_name or -reference_feature arguements to constructor."); } my $bioperl = new Bio::SeqFeature::Generic( -start => $start, -end => $end ); $reference_feature = new Modware::Chromosome( -name => $chromosome_name ) if $chromosome_name; $self->source ( $source ) if defined $source; $self->bioperl ( $bioperl ) if defined $bioperl; $self->description ( $description ) if defined $description; $self->reference_feature ( $reference_feature ) if defined $reference_feature; $bioperl->attach_seq( $self->reference_feature->bioperl ) if $self->{'reference_feature'}; $self->qualifiers( [] ); $self->_init(); return $self;
}
shift_featuredescriptiontopprevnext
sub shift_feature {
   my ($self, $offset) = @_;

   my $bioperl = $self->bioperl;
   $bioperl->start(  $bioperl->start() + $offset   );
   $bioperl->end  (  $bioperl->end()   + $offset   );
}
startdescriptiontopprevnext
sub start {
   my ($self, @args) = @_;

   return $self->bioperl(@args);
}
updatedescriptiontopprevnext
sub update {
   my ($self,  @args) = @_;

   $self->SUPER::update();
   
   if (  $self->{'bioperl'} ) {
      $self->_update_featureloc();
   }
}

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 _