Skip to content

Use SO_FORWARD/SO_REVERSE instead of deprecated SBOL orientations (fixes #204) - #371

Open
anshuman83-40 wants to merge 1 commit into
SynBioDex:developfrom
anshuman83-40:switch-204-so-orientation
Open

anshuman83-40 wants to merge 1 commit into
SynBioDex:developfrom
anshuman83-40:switch-204-so-orientation

Conversation

@anshuman83-40

@anshuman83-40 anshuman83-40 commented Oct 3, 2026 •

Copy link
Copy Markdown

SBOL 3.0.1 deprecated sbol3.SBOL_INLINE / sbol3.SBOL_REVERSE_COMPLEMENT in favor of the
Sequence Ontology terms sbol3.SO_FORWARD / sbol3.SO_REVERSE. This PR switches the places where
SBOL Utilities produces orientations over to the SO terms. Where it reads them, it still
accepts the deprecated terms, so existing documents keep working.

Changes

  • excel_to_sbol.py: SubComponent orientation is now SO_REVERSE / SO_FORWARD.
  • conversion.py – convert2to3: SBOL2 inline / reverseComplement now map to SO_FORWARD / SO_REVERSE.
  • conversion.py – convert3to2: maps SO_FORWARD / SO_REVERSE to the SBOL2 terms, and still maps
    the deprecated SBOL3 terms so older documents continue to convert.
  • sbol3_genbank_conversion.py: unchanged. It already accepts both the SO and the deprecated terms on input.

Test files

This is the part where #225 got stuck. The expected-output files generated from Excel, and the library
expansions derived from them, are updated to the SO terms:
simple_library.nt, two_backbones.nt, constraints_library.nt, incomplete_constraints_library.nt,
circular_sequence_inference.nt, expanded_simple_library.nt, expanded_with_sequences.nt.

Only sbol3:orientation triples change: 217 inline → SO:0001030 and 8 reverseComplement → SO:0001031.
The files were re-serialized with sbol3.SORTED_NTRIPLES, so the byte-level round-trip comparison in
test_3to2_conversion still lines up.

feature_orientation_conversion.nt and iGEM_SBOL2_imports.nt deliberately keep the deprecated terms.
They are inputs to test_3to2_orientation_conversion and now act as backward-compatibility coverage.

Testing

Locally (Windows 11, Python 3.13), I ran the full suite before and after the change
(excluding docstring coverage and the IDT tests): 68 passed both before and after; the set of failing tests is identical.
The 10 tests that fail locally fail on unmodified develop too, because Node.js and Graphviz aren't installed on my machine
(the test_conversion.py JS-converter tests and test_dotfile_generation). I'm relying on CI for those, including the
test_3to2_conversion round trip.

Side note: with the current Biopython (1.88), test_genbank_sbol3_direct.py fails on develop with
AttributeError: 'SeqFeature' object has no attribute 'strand'. I pinned Biopython 1.85 locally to run those tests.
I'm happy to open a separate issue/PR for that.

 SynBioDex#204)

SBOL 3.0.1 deprecated sbol3.SBOL_INLINE and sbol3.SBOL_REVERSE_COMPLEMENT
in favor of the Sequence Ontology terms SO_FORWARD and SO_REVERSE.

- excel_to_sbol: emit SO_FORWARD / SO_REVERSE for SubComponent orientation
- convert2to3: map SBOL2 inline / reverseComplement to SO_FORWARD / SO_REVERSE
- convert3to2: map SO_FORWARD / SO_REVERSE to SBOL2, while still accepting
  the deprecated SBOL3 terms so older documents continue to convert
- update the expected-output test files generated from Excel (and the
  library expansions derived from them) to the SO terms; only orientation
  triples change

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant