use of org.sbolstandard.core2.FunctionalComponent in project libSBOLj by SynBioDex.
the class SimpleModuleDefinition method main.
public static void main(String[] args) throws Exception {
SBOLDocument document = new SBOLDocument();
setDefaultNameSpace(document, example.getNamespaceURI());
document.setTypesInURIs(true);
ModuleDefinition module = document.createModuleDefinition("GFP_expression");
FunctionalComponent cds = module.createFunctionalComponent("Constitutive_GFP", AccessType.PUBLIC, URI.create("http://sbolstandard.org/example/GFP_generator"), DirectionType.IN);
FunctionalComponent protein = module.createFunctionalComponent("GFP_protein", AccessType.PUBLIC, URI.create("http://sbolstandard.org/example/GFP"), DirectionType.OUT);
Interaction interaction = module.createInteraction("express_GFP", new HashSet<URI>(Arrays.asList(URI.create("Transcription"))));
interaction.createParticipation("CDS", cds.getIdentity(), SystemsBiologyOntology.PROMOTER);
interaction.createParticipation("Protein", protein.getIdentity(), SystemsBiologyOntology.PRODUCT);
SBOLWriter.write(document, (System.out));
}
use of org.sbolstandard.core2.FunctionalComponent in project libSBOLj by SynBioDex.
the class MapsToExample method main.
public static void main(String[] args) throws URISyntaxException, SBOLValidationException {
SBOLDocument doc = new SBOLDocument();
doc.setDefaultURIprefix("http://sbols.org/MapsToExample/");
doc.setComplete(true);
doc.setCreateDefaults(true);
String version = "";
ModuleDefinition md1 = doc.createModuleDefinition("md1", version);
ComponentDefinition fc1_def = doc.createComponentDefinition("fc1_def", version, ComponentDefinition.DNA);
ComponentDefinition fc2_def = doc.createComponentDefinition("fc2_def", version, ComponentDefinition.DNA);
FunctionalComponent fc1 = md1.createFunctionalComponent("fc1", AccessType.PUBLIC, "fc1_def", version, DirectionType.NONE);
FunctionalComponent fc2 = md1.createFunctionalComponent("fc2", AccessType.PUBLIC, "fc2_def", version, DirectionType.NONE);
ComponentDefinition cd = doc.createComponentDefinition("cd", version, ComponentDefinition.DNA);
fc1_def.createComponent("component", AccessType.PUBLIC, "cd");
fc1.createMapsTo("mapsTo", RefinementType.USELOCAL, "fc2", "component");
SBOLValidate.validateSBOL(doc, true, true, true);
if (SBOLValidate.getNumErrors() > 0) {
for (String error : SBOLValidate.getErrors()) {
System.out.println(error);
}
return;
}
}
Aggregations