Search in sources :

Example 1 with ComponentDefinition

use of org.sbolstandard.core2.ComponentDefinition in project libSBOLj by SynBioDex.

the class ModuleDefinitionOutput method createInverter.

private static void createInverter(SBOLDocument document, ModuleDefinition moduleDef, ComponentDefinition promoter, ComponentDefinition TF) throws Exception {
    FunctionalComponent laciInverterModuleDef_promoter = moduleDef.createFunctionalComponent("promoter", AccessType.PUBLIC, promoter.getIdentity(), DirectionType.INOUT);
    FunctionalComponent laciInverterModuleDef_TF = moduleDef.createFunctionalComponent("TF", AccessType.PUBLIC, TF.getIdentity(), DirectionType.INOUT);
    Interaction interaction = moduleDef.createInteraction("LacI_pLacI", new HashSet<URI>(Arrays.asList(toURI(Terms.interactionTypes.transcriptionalRepression))));
    Participation participation = interaction.createParticipation(promoter.getDisplayId(), laciInverterModuleDef_promoter.getIdentity(), toURI(Terms.participantRoles.promoter));
    Participation participation2 = interaction.createParticipation(TF.getDisplayId(), laciInverterModuleDef_TF.getIdentity(), toURI(Terms.participantRoles.inhibitor));
}
Also used : Participation(org.sbolstandard.core2.Participation) Interaction(org.sbolstandard.core2.Interaction) FunctionalComponent(org.sbolstandard.core2.FunctionalComponent) URI(java.net.URI)

Example 2 with ComponentDefinition

use of org.sbolstandard.core2.ComponentDefinition in project libSBOLj by SynBioDex.

the class ModuleDefinitionOutput method createComponenDefinition.

private static ComponentDefinition createComponenDefinition(SBOLDocument document, QName identifier, String name, QName type, QName role, String description) throws SBOLValidationException {
    ComponentDefinition componentDef = document.createComponentDefinition(identifier.getLocalPart(), new HashSet<URI>(Arrays.asList(toURI(type))));
    componentDef.addRole(toURI(role));
    componentDef.setName(name);
    componentDef.setDescription(description);
    return componentDef;
}
Also used : URI(java.net.URI) ComponentDefinition(org.sbolstandard.core2.ComponentDefinition)

Example 3 with ComponentDefinition

use of org.sbolstandard.core2.ComponentDefinition in project libSBOLj by SynBioDex.

the class ModuleDefinitionOutput method main.

public static void main(String[] args) throws Exception {
    SBOLDocument document = new SBOLDocument();
    setDefaultNameSpace(document, pr.getNamespaceURI());
    ComponentDefinition gfp = createComponenDefinition(document, pr.withLocalPart("BBa_E0040"), "gfp", Terms.biopaxTerms.DnaRegion, Terms.soTerms.CDS, "gfp coding sequence");
    ComponentDefinition tetR = createComponenDefinition(document, pr.withLocalPart("BBa_C0040"), "tetR", Terms.biopaxTerms.DnaRegion, Terms.soTerms.CDS, "tetR coding sequence");
    ComponentDefinition lacI = createComponenDefinition(document, pr.withLocalPart("BBa_C0012"), "lacI", Terms.biopaxTerms.DnaRegion, Terms.soTerms.CDS, "lacI coding sequence");
    ComponentDefinition placI = createComponenDefinition(document, pr.withLocalPart("BBa_R0010"), "pLacI", Terms.biopaxTerms.DnaRegion, Terms.soTerms.promoter, "pLacI promoter");
    ComponentDefinition ptetR = createComponenDefinition(document, pr.withLocalPart("BBa_R0040"), "pTetR", Terms.biopaxTerms.DnaRegion, Terms.soTerms.promoter, "pTet promoter");
    ComponentDefinition rbslacI = createComponenDefinition(document, pr.withLocalPart("BBa_J61101"), "BBa_J61101 RBS", Terms.biopaxTerms.DnaRegion, Terms.soTerms.RBS, "RBS1");
    ComponentDefinition rbstetR = createComponenDefinition(document, pr.withLocalPart("BBa_J61120"), "BBa_J61101 RBS", Terms.biopaxTerms.DnaRegion, Terms.soTerms.RBS, "RBS2");
    ComponentDefinition rbsgfp = createComponenDefinition(document, pr.withLocalPart("BBa_J61130"), "BBa_J61101 RBS", Terms.biopaxTerms.DnaRegion, Terms.soTerms.RBS, "RBS2");
    setDefaultNameSpace(document, uniprot.getNamespaceURI());
    ComponentDefinition GFP = createComponenDefinition(document, uniprot.withLocalPart("P42212"), "GFP", Terms.biopaxTerms.Protein, Terms.sboTerms.product, "GFP protein");
    ComponentDefinition TetR = createComponenDefinition(document, uniprot.withLocalPart("Q6QR72"), "TetR", Terms.biopaxTerms.Protein, Terms.sboTerms.inhibitor, "TetR protein");
    ComponentDefinition LacI = createComponenDefinition(document, uniprot.withLocalPart("P03023"), "LacI", Terms.biopaxTerms.Protein, Terms.sboTerms.inhibitor, "LacI protein");
    setDefaultNameSpace(document, pr.getNamespaceURI());
    ComponentDefinition lacITerminator = createComponenDefinition(document, pr.withLocalPart("ECK120029600"), "ECK120029600", Terms.biopaxTerms.DnaRegion, Terms.soTerms.terminator, "Terminator1");
    ComponentDefinition tetRTerminator = createComponenDefinition(document, pr.withLocalPart("ECK120033736"), "ECK120033736", Terms.biopaxTerms.DnaRegion, Terms.soTerms.terminator, "Terminator2");
    setDefaultNameSpace(document, vpr.getNamespaceURI());
    ComponentDefinition tetRInverter = createComponenDefinition(document, vpr.withLocalPart("pIKELeftCassette_1"), "TetR Inverter", Terms.biopaxTerms.DnaRegion, Terms.soTerms.engineeredGene, "TetR Inverter");
    ComponentDefinition lacIInverter = createComponenDefinition(document, vpr.withLocalPart("pIKERightCassette_1"), "LacI Inverter", Terms.biopaxTerms.DnaRegion, Terms.soTerms.engineeredGene, "LacI Inverter");
    ComponentDefinition toggleSwitch = createComponenDefinition(document, vpr.withLocalPart("pIKE_Toggle_1"), "LacI/TetR Toggle Switch", Terms.biopaxTerms.DnaRegion, Terms.soTerms.engineeredGene, "LacI/TetR Toggle Switch");
    // tetR inverter sequences
    addPRSequence(document, ptetR, "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac");
    addPRSequence(document, rbslacI, "aaagacaggacc");
    addPRSequence(document, lacI, "atggtgaatgtgaaaccagtaacgttatacgatgtcgcagagtatgccggtgtctcttatcagaccgtttcccgcgtggtgaaccaggccagccacgtttctgcgaaaacgcgggaaaaagtggaagcggcgatggcggagctgaattacattcccaaccgcgtggcacaacaactggcgggcaaacagtcgttgctgattggcgttgccacctccagtctggccctgcacgcgccgtcgcaaattgtcgcggcgattaaatctcgcgccgatcaactgggtgccagcgtggtggtgtcgatggtagaacgaagcggcgtcgaagcctgtaaagcggcggtgcacaatcttctcgcgcaacgcgtcagtgggctgatcattaactatccgctggatgaccaggatgccattgctgtggaagctgcctgcactaatgttccggcgttatttcttgatgtctctgaccagacacccatcaacagtattattttctcccatgaagacggtacgcgactgggcgtggagcatctggtcgcattgggtcaccagcaaatcgcgctgttagcgggcccattaagttctgtctcggcgcgtctgcgtctggctggctggcataaatatctcactcgcaatcaaattcagccgatagcggaacgggaaggcgactggagtgccatgtccggttttcaacaaaccatgcaaatgctgaatgagggcatcgttcccactgcgatgctggttgccaacgatcagatggcgctgggcgcaatgcgcgccattaccgagtccgggctgcgcgttggtgcggatatctcggtagtgggatacgacgataccgaagacagctcatgttatatcccgccgttaaccaccatcaaacaggattttcgcctgctggggcaaaccagcgtggaccgcttgctgcaactctctcagggccaggcggtgaagggcaatcagctgttgcccgtctcactggtgaaaagaaaaaccaccctggcgcccaatacgcaaaccgcctctccccgcgcgttggccgattcattaatgcagctggcacgacaggtttcccgactggaaagcgggcaggctgcaaacgacgaaaactacgctttagtagcttaataa");
    addPRSequence(document, lacITerminator, "ttcagccaaaaaacttaagaccgccggtcttgtccactaccttgcagtaatgcggtggacaggatcggcggttttcttttctcttctcaa");
    // lacI inverter sequences
    addPRSequence(document, placI, "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac");
    addPRSequence(document, rbstetR, "aaagacaggacc");
    addPRSequence(document, tetR, "atgtccagattagataaaagtaaagtgattaacagcgcattagagctgcttaatgaggtcggaatcgaaggtttaacaacccgtaaactcgcccagaagctaggtgtagagcagcctacattgtattggcatgtaaaaaataagcgggctttgctcgacgccttagccattgagatgttagataggcaccatactcacttttgccctttagaaggggaaagctggcaagattttttacgtaataacgctaaaagttttagatgtgctttactaagtcatcgcgatggagcaaaagtacatttaggtacacggcctacagaaaaacagtatgaaactctcgaaaatcaattagcctttttatgccaacaaggtttttcactagagaatgcattatatgcactcagcgctgtggggcattttactttaggttgcgtattggaagatcaagagcatcaagtcgctaaagaagaaagggaaacacctactactgatagtatgccgccattattacgacaagctatcgaattatttgatcaccaaggtgcagagccagccttcttattcggccttgaattgatcatatgcggattagaaaaacaacttaaatgtgaaagtgggtccgctgcaaacgacgaaaactacgctttagtagcttaataa");
    addPRSequence(document, rbsgfp, "aaagaaacgaca");
    addPRSequence(document, gfp, "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa");
    addPRSequence(document, tetRTerminator, "ttcagccaaaaaacttaagaccgccggtcttgtccactaccttgcagtaatgcggtggacaggatcggcggttttcttttctcttctcaa");
    addSubComponents(document, tetRInverter, ptetR, rbslacI, lacI, lacITerminator);
    addSubComponents(document, lacIInverter, placI, rbstetR, tetR, rbsgfp, gfp, tetRTerminator);
    addSubComponents(document, toggleSwitch, tetRInverter, lacIInverter);
    setDefaultNameSpace(document, example.getNamespaceURI());
    ModuleDefinition laciInverterModuleDef = document.createModuleDefinition("laci_inverter");
    laciInverterModuleDef.addRole(Terms.moduleRoles.inverter);
    ModuleDefinition tetRInverterModuleDef = document.createModuleDefinition("tetr_inverter");
    tetRInverterModuleDef.addRole(Terms.moduleRoles.inverter);
    createInverter(document, laciInverterModuleDef, placI, LacI);
    createInverter(document, tetRInverterModuleDef, ptetR, TetR);
    ModuleDefinition toggleSwitchModuleDef = document.createModuleDefinition("toggle_switch");
    toggleSwitchModuleDef.addRole(toURI(example.withLocalPart("module_role/toggle_switch")));
    FunctionalComponent toggleSwitchModuleDef_TetR = toggleSwitchModuleDef.createFunctionalComponent("TetR", AccessType.PUBLIC, TetR.getIdentity(), DirectionType.INOUT);
    FunctionalComponent toggleSwitchModuleDef_LacI = toggleSwitchModuleDef.createFunctionalComponent("LacI", AccessType.PUBLIC, LacI.getIdentity(), DirectionType.INOUT);
    Module lacInverterSubModule = toggleSwitchModuleDef.createModule("laci_inverter", laciInverterModuleDef.getIdentity());
    lacInverterSubModule.createMapsTo("LacI_mapping", RefinementType.USEREMOTE, toggleSwitchModuleDef_LacI.getIdentity(), laciInverterModuleDef.getFunctionalComponent("TF").getIdentity());
    Module tetRInverterSubModule = toggleSwitchModuleDef.createModule("tetr_inverter", tetRInverterModuleDef.getIdentity());
    tetRInverterSubModule.createMapsTo("TetR_mapping", RefinementType.USEREMOTE, toggleSwitchModuleDef_TetR.getIdentity(), tetRInverterModuleDef.getFunctionalComponent("TF").getIdentity());
    Model model = document.createModel("toogleswitch", URI.create("http://virtualparts.org/part/pIKE_Toggle_1"), EDAMOntology.SBML, SystemsBiologyOntology.CONTINUOUS_FRAMEWORK);
    toggleSwitchModuleDef.addModel(model.getIdentity());
    SBOLWriter.write(document, (System.out));
}
Also used : ModuleDefinition(org.sbolstandard.core2.ModuleDefinition) SBOLDocument(org.sbolstandard.core2.SBOLDocument) Model(org.sbolstandard.core2.Model) FunctionalComponent(org.sbolstandard.core2.FunctionalComponent) Module(org.sbolstandard.core2.Module) ComponentDefinition(org.sbolstandard.core2.ComponentDefinition)

Example 4 with ComponentDefinition

use of org.sbolstandard.core2.ComponentDefinition in project libSBOLj by SynBioDex.

the class ModuleDefinitionOutput method addSequence.

private static Sequence addSequence(SBOLDocument document, ComponentDefinition componentDef, String displayId, URI sequenceType, String elements) throws SBOLValidationException {
    Sequence sequence = document.createSequence(displayId, elements, sequenceType);
    componentDef.addSequence(sequence.getIdentity());
    return sequence;
}
Also used : Sequence(org.sbolstandard.core2.Sequence)

Example 5 with ComponentDefinition

use of org.sbolstandard.core2.ComponentDefinition in project libSBOLj by SynBioDex.

the class Provenance_SpecifyBuildOperations method specifyJoinOperation.

/**
 * specifies a join operation, which joins two linear DNA constructs
 *
 * NOTE! at this point, we do not specify any further information
 * about how to execute the join operation!
 *
 * @throws Exception
 */
public static void specifyJoinOperation() throws Exception {
    // instantiate a document
    SBOLDocument document = new SBOLDocument();
    document.setDefaultURIprefix(BUILD_PREFIX);
    // the first linear DNA construct
    ComponentDefinition cdPart1 = document.createComponentDefinition("dna_part_1", LINEAR_DOUBLE_STRANDED_DNA);
    cdPart1.setName("dna_part_1");
    // the second linear DNA construct
    ComponentDefinition cdPart2 = document.createComponentDefinition("dna_part_2", LINEAR_DOUBLE_STRANDED_DNA);
    cdPart2.setName("dna_part_2");
    // Create the generic top level entity for the join operation
    Activity joinOperation = document.createActivity("join_" + cdPart1.getName() + "_with_" + cdPart2.getName());
    joinOperation.setName("join(" + cdPart1.getName() + ", " + cdPart2.getName() + ")");
    // specify the "inputs" to the join operation
    joinOperation.createUsage("dna_part_1", cdPart1.getIdentity()).addRole(UPSTREAM);
    joinOperation.createUsage("dna_part_2", cdPart2.getIdentity()).addRole(DOWNSTREAM);
    // specify the "output" of the join operation
    ComponentDefinition cdJoinedPart = document.createComponentDefinition("joined_dna_part", LINEAR_DOUBLE_STRANDED_DNA);
    cdJoinedPart.setName("joined_dna_part");
    cdJoinedPart.addWasGeneratedBy(joinOperation.getIdentity());
    // serialize the document to a file
    SBOLWriter.write(document, System.out);
}
Also used : SBOLDocument(org.sbolstandard.core2.SBOLDocument) Activity(org.sbolstandard.core2.Activity) ComponentDefinition(org.sbolstandard.core2.ComponentDefinition)

Aggregations

URI (java.net.URI)30 ComponentDefinition (org.sbolstandard.core2.ComponentDefinition)23 URIcompliance.createCompliantURI (org.sbolstandard.core2.URIcompliance.createCompliantURI)18 SBOLDocument (org.sbolstandard.core2.SBOLDocument)15 QName (javax.xml.namespace.QName)12 HashSet (java.util.HashSet)9 ArrayList (java.util.ArrayList)7 IdentifiableDocument (org.sbolstandard.core.datatree.IdentifiableDocument)7 Literal (org.sbolstandard.core.datatree.Literal)7 StringifyQName (org.sbolstandard.core.io.json.StringifyQName)7 Sequence (org.sbolstandard.core2.Sequence)7 NestedDocument (org.sbolstandard.core.datatree.NestedDocument)5 Activity (org.sbolstandard.core2.Activity)5 FunctionalComponent (org.sbolstandard.core2.FunctionalComponent)5 Component (org.sbolstandard.core2.Component)4 ModuleDefinition (org.sbolstandard.core2.ModuleDefinition)4 GenericTopLevel (org.sbolstandard.core2.GenericTopLevel)3 Interaction (org.sbolstandard.core2.Interaction)3 Module (org.sbolstandard.core2.Module)3 SequenceAnnotation (org.sbolstandard.core2.SequenceAnnotation)3