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

stephan stephan.rosecker at ish.de
Wed Nov 9 14:51:30 EST 2005


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



More information about the Bioperl-l mailing list