SynBioDex / pySBOL2

A pure Python implementation of the SBOL standard.
Apache License 2.0
20 stars 6 forks source link

Genbank conversion fails #318

Closed tcmitchell closed 4 years ago

tcmitchell commented 4 years ago

The following is drawn from the documentation. Should it succeed? Or should there be intervening code that creates the right sequence for the target_gene?

>>> from sbol2 import *
RDFLib Version: 5.0.0
>>> doc = Document()
>>> doc.read('test/resources/crispr_example.xml')
>>> doc.exportToFormat('GenBank', 'crispr_example_out.gb')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/tmitchel/Projects/sd2/pySBOL2/sbol2/document.py", line 952, in exportToFormat
    raise SBOLError(msg, SBOLErrorCode.SBOL_ERROR_INVALID_ARGUMENT)
sbol2.sbolerror.SBOLError: ('ComponentDefinition http://sbols.org/CRISPR_Example/target_gene/1.0.0 does not have an IUPAC sequence. Conversion failed.', <SBOLErrorCode.SBOL_ERROR_INVALID_ARGUMENT: 12>)
bbartley commented 4 years ago

Bryan will find a better example file and then re-assign to Tom.

bbartley commented 4 years ago

The following appears to work and produce valid GenBank:

>>> doc = Document('test/resources/tutorial/parts.xml')
>>> doc.exportToFormat('GenBank', 'parts.gb')