1515import knox .spring .data .neo4j .operations .JoinOperator ;
1616import knox .spring .data .neo4j .operations .OROperator ;
1717import knox .spring .data .neo4j .operations .RepeatOperator ;
18+ import knox .spring .data .neo4j .exception .SBOLException ;
1819
1920public class SBOLConversion {
2021
@@ -35,7 +36,7 @@ public void setSbolDoc(List<SBOLDocument> sbolDocs) {
3536 * calls the appropriate SBOL parser by checking for CombinatorialDerivations
3637 * @return
3738 */
38- public List <DesignSpace > convertSBOLsToSpaces (){
39+ public List <DesignSpace > convertSBOLsToSpaces () throws SBOLException {
3940
4041 List <DesignSpace > allOutputSpaces = new ArrayList <>();
4142
@@ -56,7 +57,7 @@ public List<DesignSpace> convertSBOLsToSpaces(){
5657 * @param sbolDoc
5758 * @return list of design spaces
5859 */
59- private List <DesignSpace > convertCombinatorialSBOL (SBOLDocument sbolDoc ) {
60+ private List <DesignSpace > convertCombinatorialSBOL (SBOLDocument sbolDoc ) throws SBOLException {
6061
6162 List <DesignSpace > outputSpaces = new ArrayList <>();
6263 Set <CombinatorialDerivation > rootCVs = getRootCombinatorialDerivation (sbolDoc );
@@ -77,7 +78,7 @@ private List<DesignSpace> convertCombinatorialSBOL(SBOLDocument sbolDoc) {
7778 return outputSpaces ;
7879 }
7980
80- private List <NodeSpace > recurseVariableComponents (CombinatorialDerivation combinatorialDerivation ){
81+ private List <NodeSpace > recurseVariableComponents (CombinatorialDerivation combinatorialDerivation ) throws SBOLException {
8182 ComponentDefinition template = combinatorialDerivation .getTemplate ();
8283 List <NodeSpace > inputSpace = new LinkedList <>();
8384
@@ -161,7 +162,7 @@ private VariableComponent[] sortVariableComponents(CombinatorialDerivation combi
161162 return orderedVCs ;
162163 }
163164
164- private NodeSpace createNodeSpaceFromVariableComponent (VariableComponent variableComponent , ComponentDefinition template ){
165+ private NodeSpace createNodeSpaceFromVariableComponent (VariableComponent variableComponent , ComponentDefinition template ) throws SBOLException {
165166 ArrayList <String > atomIDs = new ArrayList <>();
166167 ArrayList <String > atomRoles = new ArrayList <>();
167168
@@ -209,7 +210,7 @@ private Edge.Orientation getOrientation(Component component, ComponentDefinition
209210 if (Objects .nonNull (annotation )){
210211 // throw error if there is more than one location
211212 if (annotation .getLocations ().size () > 1 ){
212- throw new RuntimeException ("Cannot parse SBOL with more than one Location in SequenceAnnotation" );
213+ throw new SBOLException ("Cannot parse SBOL with more than one Location in SequenceAnnotation" );
213214 }
214215
215216 OrientationType orientation = annotation .getLocations ().iterator ().next ().getOrientation ();
0 commit comments