[Gmod-help] Re: [Gmod-gbrowse] gbrowse details

Don Gilbert gilbertd at cricket.bio.indiana.edu
Thu Aug 28 16:10:42 EDT 2008


I did something analogous to what Manoj wants. For the Chado database
adaptor only, I had it add the protein sequence to the attributes for
display in gbrowse_details.  This isn't a quick answer to your quick question,
but may be something you would care to look at.   ESTs should be
stored in Chado dbs in a somewhat standard way, and linked via
analysisfeature table to a genome location feature.  THe SQL to
retrieve would be more complex than that below for protein features.

-- Don

There is a copy of the changed code here
http://eugenes.org/gmod/genbank2chado/lib/Bio-new/DB/Das/Chado.pm
 
sub attributes {
   ...
## dgg; ugly patch to copy polypeptide/protein residues into 'translation' attribute
# need to add to gfffeatureatts ..

  if (!defined $tag || $tag eq 'translation') {
    $sth = $self->dbh->prepare("select type_id from feature where feature_id = ?");
    $sth->execute($feature_id); # or $self->throw("failed to get feature_id in attributes"); 
    $hashref = $sth->fetchrow_hashref;
    my $type_id = $$hashref{'type_id'};
    if(  $type_id == $self->name2term('polypeptide') 
      || $type_id == $self->name2term('protein')
      ) {
      $sth = $self->dbh->prepare("select residues from feature where feature_id = ?");
      $sth->execute($feature_id); # or $self->throw("failed to get feature_id in attributes"); 
      $hashref = $sth->fetchrow_hashref;
      my $aa = $$hashref{'residues'};
      if($aa) {
        if($tag) { push( @array, [ $aa]); }
        else { push( @array, ['translation', $aa]); }
        }
      }
  }




More information about the Gmod-help mailing list