[BioSQL-l] Adding qualifers to features on a stored sequence

Tim Henderson tjh@alodar.com
Mon, 21 Oct 2002 16:24:40 -0700


 > I'll check your log and see whether I can fix this. In the meantime,
 > what should work is
 >
 > $cds->remove();
 > $cds->add_tag_value('foo', 'This is an added qualifier');
 > $cds->create();
 >

That worked. Thanks.

I did notice, though, that the $cds->remove() left some traces of the 
old feature in the database. For reference, I'm using a test database 
with one sequence in it, loaded via load_seqdatabase.pl from the GenBank 
record for accession X02910. The primary key of the original  CDS 
feature was 6; after doing the above update the primary key of the new 
CDS feature was 24. Browsing through my database, I see...

mysql> select * from seqfeature where seqfeature_id = 6;
Empty set (0.01 sec)

mysql> select * from seqfeature_location where seqfeature_id = 6;
Empty set (0.00 sec)

mysql> select * from seqfeature_relationship where parent_seqfeature_id 
= 6 or child_seqfeature_id = 6;
Empty set (0.02 sec)

mysql> select seqfeature_id, term_name, qualifier_value from 
seqfeature_qualifier_value t1, ontology_term t2 where t1.seqfeature_id = 
6 and t1.ontology_term_id = t2.ontology_term_id;

+---------------+-------------+----------------------------
| seqfeature_id | term_name   | qualifier_value 
 
 

+---------------+-------------+----------------------------
|             6 | db_xref     | GI:37210 
 
 

|             6 | db_xref     | SWISS-PROT:P01375 
 
 

|             6 | codon_start | 1 
 
 

|             6 | protein_id  | CAA26669.1 
 
 

|             6 | product     | TNF-alpha 
 
 

|             6 | translation | MSTESMIRDVELAEEALPKKTGGP...
+---------------+-------------+----------------------------
6 rows in set (0.01 sec)

mysql> select seqfeature_id, term_name, qualifier_value from 
seqfeature_qualifier_value t1, ontology_term t2 where t1.seqfeature_id = 
24  and t1.ontology_term_id = t2.ontology_term_id;
+---------------+-------------+----------------------------
| seqfeature_id | term_name   | qualifier_value 
 
 

+---------------+-------------+----------------------------
|            24 | db_xref     | GI:37210 
 
 

|            24 | db_xref     | SWISS-PROT:P01375 
 
 

|            24 | codon_start | 1 
 
 

|            24 | protein_id  | CAA26669.1 
 
 

|            24 | product     | TNF-alpha 
 
 

|            24 | translation | MSTESMIRDVELAEEALPKKTGGP...
|            24 | foo         | This is an added qualifier
+---------------+-------------+----------------------------
7 rows in set (0.00 sec)


These orphaned entries don't seem to be causing any problems, but I 
thought I'd point them out.


-- Tim