SynBioDex / libSBOLj

Java Library for Synthetic Biology Open Language (SBOL)
Apache License 2.0
37 stars 24 forks source link

getRootComponentDefinitions() does not treat the Variants in a Variable Component as a child Component of a Component Definition #613

Closed ImperialiGEM2020 closed 4 years ago

ImperialiGEM2020 commented 4 years ago

getRootComponentDefinitions() should treat the Variants of a Variable Component as child Components of the template Component Definition, and remove the Component Definitions describing these Variants from the set of Root Component Definitions.

Currently, the function only checks Component Definitions for its Components. However, for a Component Definition describing a template for a Combinatorial Derivation, the variable Component is indicated with a 'placeholder' Component. While the function will remove the Component Definition of this 'placeholder' Component, it does not remove the Component Definitions of its corresponding Variants, which it rationally should.

This causes the set of Root Component Definitions to include Component Definitions that are indirectly referenced by a child Component.

For example, this causes the promoters in the violacein combinatorial derivation example taken from the paper "Specifying Combinatorial Designs with the Synthetic Biology Open Language (SBOL)" to be shown when displaying only root Component Definitions.

image

cjmyers commented 4 years ago

Thanks for the detailed bug report. I've updated getRootComponentDefinitions() in libSBOLj to exclude the variant ComponentDefinitions.