Sequence features (chromosomes, contigs, genes, transcripts) are all created as subclasses of Modware::Feature. Most subclasses of feature map directly to BioPerl objects. The follwing list shows which Sequence Ontology (SO) terms map to which BioPerl objects in Modware. When you call the Modware::Feature constructor, it 'decides' what sublclass of Modware::Feature to return to you based on the 'type' that was specified when you created the feature either in the GFF3 file or using the Modware API.

The following serve as a quick introduction to the types of things you can do in modware. Consult the API docs for more use cases and to view the code behind all of this. The API docs are here: http://gmod-ware.sourceforge.net/doc
You can do this on any feature you retrieve in Modware (chromosome, contig, gene, mRNA, EST).
  # USE CASE: retreive a feature and print its type, then all of its qualifiers
   my $feature = new Modware::Feature( -primary_id => 'DDB0191090' );
   print $feature->type()."\n";
   foreach my $qualifier ( @{$feature->qualifiers()} ) {
      print "\t".$qualifier."\n";
   }

  # USE CASE:  print primary_id of all ESTs whose alignment overlap this feature
   my $feature = new Modware::Feature( -primary_id => 'DDB0191090' );
   my @ests = grep{ $_->type() eq 'EST' } $feature->overlapping_aligned();
   foreach my $est (@ests) {
      print $est->primary_id()."\n";
   }

You can do this only on mRNA features (code for proteins)
  #USE CASE : print the cds stored in the database as a fasta file
     my  $feature = new Modware::Feature( -primary_id => 'DDB0233595' );
     print $feature->sequence( -type => 'cds', -format => 'fasta' );

  #USE CASE : print the translated cds
     my  $feature = new Modware::Feature( -primary_id => 'DDB0233595' );
     print $feature->sequence( -type => 'protein', -format => 'fasta' );

  #USE CASE: shift feature up 200 bases
     my  $feature = new Modware::Feature( -primary_id => 'DDB0233595' );
     $feature->shift_feature( 200 );
     $feature->update()

  #USE CASE: Add a description, dbxref, and an exon
     use Modware::Feature;
     my $transcript = new Modware::Feature( -primary_id => 'DDB0233595' );

     $transcript->description( 'Gene model derived from AU12345' );
     $transcript->add_external_id( -source => 'GenBank Accession Number',
                                   -id     => 'AU12345' );


     # call the bioperl method to retrieve bioperl representation of object
     # need this to view/edit exon structure
     $bioperl = $transcript->bioperl();
     # here, we  are manipulating a Bio::SeqFeature::Gene object

     # shift the last exon back a little bit (to lose stop codon)
     [$bioperl->exons()]->[2]->start( 281050 );

     # create a new exon and add it to the feature
     my $exon = Bio::SeqFeature::Gene::Exon->new(    -start  => 280921,
                                                     -end    => 280959,
                                                     -strand => -1   );
     $exon->is_coding(1);
     $bioperl->add_exon($exon);

     # update writes everything to the database
     $transcript->update();

Modules in Modware::Search contain class methods that return arrays of objects, the type of object being determined in the class name. For instance, Modware::Search::Feature contains methods that return arrays of Modware::Feature objects.
   #USE CASE: print primary_id, start and stop of all mRNA features overlapping
   #          a given range on a chromosome: chromosome named Fake base 39416 to 41654

   my @features = Modware::Search::Feature->Search_overlapping_feats_by_range( 
      'Fake', 39416, 41654, 'mRNA'
   );

   foreach my $feature (@features) {
      print $feature->primary_id()."\t".$feature->start()."\t".$feature->end()."\n";
   }
For more information contact:
e-just at northwestern.edu
s-merchant at northwestern.edu


Copyright © 2006, Northwestern University
All rights reserved.
SourceForge.net Logo