[Bioperl-l] Multiple tags of same name in a Bio::SeqFeature::Generic object

Hilmar Lapp hlapp at gmx.net
Fri Nov 4 11:03:00 EST 2005


You add values to a tag by calling the feature's add_tag_value() method:

$feature->add_tag_value('dbxref',"blah:X362376");


On Nov 4, 2005, at 5:42 AM, Govind Chandra wrote:

> Hi,
>
> I wish to assign multiple tags of the same name in a
> Bio::SeqFeature::Generic object. What I am doing below does not work. I
> did not expect it to. What I get is:
>
> FT                   /db_xref="InterPro:IPR001957"
>
> If I pass a reference to an array to a single db_xref tag, that does 
> not
> work either. I get:
>
> FT                   /db_xref="ARRAY(0x841da94)"
>
> If I pick up a feature from an embl file (rather than build my own)
> which has multiple db_xref tags and add it to my sequence using
> add_SeqFeature I do get multiple db_xref tags in the output. So I
> conclude that I am not building the Bio::SeqFeature::Generic object
> right.
>
> Could someone help me with this please. I am using BioPerl 1.4.0.
>
> Thanks
>
> Govind
>
> Govind Chandra
> Microbiology
> John Innes Centre
> Norwich UK.
>
>
>
> ### begin script ###
> use Bio::SeqIO;
> use Bio::Seq;
> use Bio::SeqFeature::Generic;
>
> $seq="agaagcgcaccgcacccgcgagcgccttcgccgcgggccctttcg";
>
> $seqout=Bio::SeqIO->new('-fh' => \*STDOUT, '-format' => 'embl');
>
> $seqobj=Bio::Seq->new('-seq' => $seq);
>
> #@xrefs=("GOA:Q8FUL7","HSSP:1J1V","InterPro:IPR001957");
>
> $feature=Bio::SeqFeature::Generic->new(-start => 10,
> 				       -end => 20,
> 				       -strand => 1,
> 				       -primary => 'RBS',
> 				       -tag => {
> #						db_xref=> \@xrefs
> 						db_xref => "GOA:Q8FUL7",
> 						db_xref => "HSSP:1J1V",
> 						db_xref => "InterPro:IPR001957"
> 					       }
> 				      );
> $seqobj->add_SeqFeature($feature);
> $seqout->write_seq($seqobj);
>
> ### end script ###
>
>
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>
-- 
-------------------------------------------------------------
Hilmar Lapp                            email: lapp at gnf.org
GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
-------------------------------------------------------------




More information about the Bioperl-l mailing list