[Bioperl-l] RE:Problems to get secondary accessions from an object

Brian Osborne brian_osborne at cognia.com
Thu Nov 10 19:07:33 EST 2005


Stephan,

You've lost me, I can't follow your code. Weren't you going to test your
Bio::Index::Swissprot code under Bioperl 1.5.1? I think this is the best
approach since there were significant changes in SeqFeature and Annotation
between 1.4 and 1.5.1.

Brian O.


On 11/9/05 2:51 PM, "stephan" <stephan.rosecker at ish.de> wrote:

> Hi,
> 
> I found a trace.
> The problem is that after I add anotations to the object, the
> rich-features are disappeared.
> 
> snippet:
> #prot is the seq object
> 
> sub setProtAnnotations($$) {
> my $prot = $_[0];
> my $col  = new Bio::Annotation::Collection;
> my $sv   = new Bio::Annotation::SimpleValue(-value =>    
> &getSimpleFam( $_[1] ) );
> $col->add_Annotation( 'family', $sv );
> $sv = new Bio::Annotation::SimpleValue(-value => &getWeight(    $_[0] ) );
> $col->add_Annotation( 'weight', $sv );
> $sv = new Bio::Annotation::SimpleValue(-value => $link .   
> $prot->accession_number() );
> $col->add_Annotation( 'link', $sv );
> $sv = new Bio::Annotation::SimpleValue(-value => &getEval( $_[1]  ) );
> $col->add_Annotation( 'e-val', $sv );
> $sv = new Bio::Annotation::SimpleValue( -value => $_[0]->seq()    );
> $col->add_Annotation( 'sequence', $sv );
> $prot->annotation($col);}
> 
> sub getProtAnnotation($$) {
> my $ano = $_[0]->annotation();
> my @an  = $ano->get_Annotations( $_[1] );
> my $erg = $an[0]->value();}
> 
> sub setProtAnnotation($$$) {
> my $prot = $_[0];
> my $ano  = $prot->annotation();
> my @an   = $ano->get_Annotations( $_[1] );
> my $erg  = $an[0]->value( $_[2] );}
> 
> sub getEval($) {
> my $report =
> $hmm_swiss_index->fetch_report( $accarray[ $_[0] ] );
> my $hit  = $report->next_hit();
> my $hsp  = $hit->next_domain();
> my $eval = $hsp->evalue();}
> 
> sub getSimpleFam($) {
> my $report =
> $hmm_swiss_index->fetch_report( $accarray[ $_[0] ] );
> my $hit = $report->next_hit();
> my $fam = $hit->name();}
> 
> 
> 
> 
> 
>> Hi,
>>> 
>>> I have problems to get the secondary_accessions from an seq object.
>>> 
>>> E.G
>>> 
>>> $inx = Bio::Index::Swissprot->new($Index_File_Name);
>>> $prot = $inx->fetch( $accarray[ $_[0] ] );
>>> #"$accarray[ $_[0]" is an array of accessions
>>> 
>>> print "Description: " . $prot->description . "\n";
>>> print "Accessions: " .$sec . "\n";
>>> print "Species: " . $prot->species->binomial() . "\n";
>>> print "Length: " . $prot->length . "\n";
>>> #this looks good
>>> 
>>> @a = $prot->get_secondary_accessions;
>>> #@a is empty!
>>> 
>>> Seems that $prot is not a reference to a rich:seq object or somthing
>>> other is wrong.
>>> 
>>> Hope that someone can help me.
>>> 
>>> regards
>>> stephan
>>> 
>>> 
>>> _______________________________________________
>>> Bioperl-l mailing list
>>> Bioperl-l at portal.open-bio.org
>>> http://portal.open-bio.org/mailman/listinfo/bioperl-l
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list