Skip to content

Commit

Permalink
Fix loading/retrieving date in BioSQL (see Bug 2681 and Cymon's analy…
Browse files Browse the repository at this point in the history
…sis)
  • Loading branch information
peterjc committed Oct 5, 2010
1 parent e5570a3 commit 6aca2c0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion BioSQL/BioSeq.py
Expand Up @@ -363,7 +363,8 @@ def _retrieve_qualifier_value(adaptor, primary_id):
qualifiers = {}
for name, value in qvs:
if name == "keyword": name = "keywords"
elif name == "date_changed": name = "dates"
#See handling of "date" in Loader.py
elif name == "date_changed": name = "date"
elif name == "secondary_accession": name = "accessions"
qualifiers.setdefault(name, []).append(value)
return qualifiers
Expand Down
2 changes: 1 addition & 1 deletion BioSQL/Loader.py
Expand Up @@ -653,7 +653,7 @@ def _load_annotations(self, record, bioentry_id):
" VALUES (%s, %s, %s, %s)"
tag_ontology_id = self._get_ontology_id('Annotation Tags')
for key, value in record.annotations.iteritems():
if key in ["references", "comment", "ncbi_taxid"]:
if key in ["references", "comment", "ncbi_taxid", "date"]:
#Handled separately
continue
term_id = self._get_term_id(key, ontology_id=tag_ontology_id)
Expand Down
3 changes: 2 additions & 1 deletion NEWS
Expand Up @@ -19,10 +19,11 @@ Bio.SeqIO can now read and write IMGT files, a variant of the EMBL sequence
text file format with longer feature indentation, and protein EMBL files
(used in the EMBL patents database file epo_prt.dat).

(At least) 7 people have contributed to this release, include 3 new people:
(At least) 8 people have contributed to this release, include 3 new people:

Bartek Wilczynski
Bartosz Telenczuk (first contribution)
Cymon Cox
Eric Talevich
Michiel de Hoon
Peter Cock
Expand Down
2 changes: 1 addition & 1 deletion Tests/seq_tests_common.py
Expand Up @@ -267,7 +267,7 @@ def compare_record(old, new):
#'ncbi_taxon' and 'gi'.
#TODO - address these, see Bug 2681?
new_keys = set(new.annotations).difference(old.annotations)
new_keys = new_keys.difference(['cross_references', 'dates',
new_keys = new_keys.difference(['cross_references', 'date',
'data_file_division', 'ncbi_taxid', 'gi'])
assert not new_keys, "Unexpected new annotation keys: %s" \
% ", ".join(new_keys)
Expand Down
3 changes: 0 additions & 3 deletions Tests/test_BioSQL.py
Expand Up @@ -508,9 +508,6 @@ def loop(self, filename, format):
for key in ["comment", "references", "db_source"]:
if key in old.annotations and key not in new.annotations:
del old.annotations[key]
#TODO - remove this hack one we write the date properly:
del old.annotations["date"]
del new.annotations["date"]
self.assertTrue(compare_record(old, new))
#Done
server.close()
Expand Down

0 comments on commit 6aca2c0

Please sign in to comment.