Search in sources :

Example 11 with FunctionalComponent

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));
}
Also used : ModuleDefinition(org.sbolstandard.core2.ModuleDefinition) Interaction(org.sbolstandard.core2.Interaction) SBOLDocument(org.sbolstandard.core2.SBOLDocument) FunctionalComponent(org.sbolstandard.core2.FunctionalComponent) URI(java.net.URI)

Example 12 with FunctionalComponent

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;
    }
}
Also used : ModuleDefinition(org.sbolstandard.core2.ModuleDefinition) SBOLDocument(org.sbolstandard.core2.SBOLDocument) FunctionalComponent(org.sbolstandard.core2.FunctionalComponent) ComponentDefinition(org.sbolstandard.core2.ComponentDefinition)

Aggregations

URI (java.net.URI)10 URIcompliance.createCompliantURI (org.sbolstandard.core2.URIcompliance.createCompliantURI)8 FunctionalComponent (org.sbolstandard.core2.FunctionalComponent)4 ModuleDefinition (org.sbolstandard.core2.ModuleDefinition)3 SBOLDocument (org.sbolstandard.core2.SBOLDocument)3 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 QName (javax.xml.namespace.QName)2 IdentifiableDocument (org.sbolstandard.core.datatree.IdentifiableDocument)2 Literal (org.sbolstandard.core.datatree.Literal)2 NestedDocument (org.sbolstandard.core.datatree.NestedDocument)2 StringifyQName (org.sbolstandard.core.io.json.StringifyQName)2 ComponentDefinition (org.sbolstandard.core2.ComponentDefinition)2 Interaction (org.sbolstandard.core2.Interaction)2 Model (org.sbolstandard.core2.Model)1 Module (org.sbolstandard.core2.Module)1 Participation (org.sbolstandard.core2.Participation)1