<aside> 🔅 Use cmd/ctrl+shift+l to switch between light/dark display mode.

</aside>

Related Pull Request:

https://github.com/SynBioDex/SBOL-utilities/pull/136

Change Log:

Changes::

Pending Fixes::

Discussion:

In the previous blog, I discussed adding the ability to parse GenBank files having multiple records and features. Here, I shall discuss the newly added integration of the new offline converter with the existing converter.

⇒ In this PR, there has not been any work on the converter itself (sbol_utilities/sbol3_genbank_conversion.py). The legacy converter could be invoked via the command line, using any of the console scripts of sbol2genbank, genbank2sbol, sbol-converter. The changes allow us to use the new converter by specifying the --force-new-converter.

I added a parser argument for the 3 library functions to allow the intake of the new flag:

parser.add_argument('--force-new-converter', dest='force_new_converter', action='store_true', default=False,
                        help='Force the usage of new (offline) converter instead of legacy (online) converter.')

⇒ I changed the signature of the underlying function, which is invoked whenever any of the console scripts are executed; to accommodate the new flag:

def convert_from_genbank(path: str, namespace: str, allow_genbank_online: bool = False, force_new_converter: bool = False) -> sbol3.Document:
    """Convert a GenBank document on disk into an SBOL3 document
    Specifically, the GenBank document is first imported to SBOL2, then converted from SBOL2 to SBOL3
    :param allow_genbank_online: Use the online converter, rather than the local converter
    :return: SBOL3 document containing converted materials
    """

⇒ A unit test was also added in test/test_conversion.py for testing the new flag. It executed the convert_from_genbank with the --force-new-converter flag set on a sample GenBank test file. The generated SBOL3 document is not written but instead is compared directly with a correct SBOL3 stored document, using doc_diff.