Search in sources :

Example 66 with SBOLDocument

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

the class Provenance_SpecifyBuildOperations method specifyCutOperation.

/**
 * specifies to perform a cut operation in order to linearize a vector using a restriction enzyme
 *
 * @throws Exception
 */
public static void specifyCutOperation() throws Exception {
    // instantiate a document
    SBOLDocument document = new SBOLDocument();
    document.setDefaultURIprefix(BUILD_PREFIX);
    ComponentDefinition vector = document.createComponentDefinition("vector", VECTOR_PLASMID);
    vector.setName("vector");
    ComponentDefinition enzyme = document.createComponentDefinition("restriction_enzyme", RESTRICTION_ENZYME);
    enzyme.setName("restriction_enzyme");
    // Create the generic top level entity for the cut operation
    Activity activity = document.createActivity("cut_" + vector.getName() + "_with_" + enzyme.getName());
    activity.setName("cut(" + vector.getName() + ", " + enzyme.getName() + ")");
    // Create the qualifiedUsage annotation to describe the inputs of the cut operation
    activity.createUsage("vector", vector.getIdentity()).addRole(VECTOR_PLASMID);
    activity.createUsage("enzyme", enzyme.getIdentity()).addRole(RESTRICTION_ENZYME);
    // the result of the cut operation
    ComponentDefinition linearized_vector = document.createComponentDefinition("linearized_vector", LINEAR_DOUBLE_STRANDED_DNA);
    linearized_vector.setName("linearized_vector");
    linearized_vector.addWasGeneratedBy(activity.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)

Example 67 with SBOLDocument

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

the class SequenceOutput method main.

public static void main(String[] args) throws Exception {
    String prURI = "http://partsregistry.org/";
    SBOLDocument document = new SBOLDocument();
    document.setDefaultURIprefix(prURI);
    document.setTypesInURIs(true);
    Sequence seq = document.createSequence("BBa_J23119", "", "ttgacagctagctcagtcctaggtataatgctagc", URI.create("http://www.chem.qmul.ac.uk/iubmb/misc/naseq.html"));
    seq.addWasDerivedFrom(URI.create("http://parts.igem.org/Part:BBa_J23119:Design"));
    SBOLWriter.write(document, (System.out));
}
Also used : SBOLDocument(org.sbolstandard.core2.SBOLDocument) Sequence(org.sbolstandard.core2.Sequence)

Example 68 with SBOLDocument

use of org.sbolstandard.core2.SBOLDocument 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 69 with SBOLDocument

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

the class SequenceConstraintOutput method main.

public static void main(String[] args) throws Exception {
    String prURI = "http://partsregistry.org/";
    SBOLDocument document = new SBOLDocument();
    document.setDefaultURIprefix(prURI);
    document.setTypesInURIs(true);
    ComponentDefinition promoter = document.createComponentDefinition("BBa_K174004", "", new HashSet<URI>(Arrays.asList(ComponentDefinition.DNA)));
    promoter.addRole(SequenceOntology.PROMOTER);
    promoter.setName("pspac promoter");
    promoter.setDescription("LacI repressible promoter");
    ComponentDefinition constPromoter = document.createComponentDefinition("pspac", "", new HashSet<URI>(Arrays.asList(ComponentDefinition.DNA)));
    constPromoter.addRole(SequenceOntology.PROMOTER);
    constPromoter.setName("constitutive promoter");
    constPromoter.setDescription("pspac core promoter region");
    ComponentDefinition operator = document.createComponentDefinition("LacI_operator", "", new HashSet<URI>(Arrays.asList(ComponentDefinition.DNA)));
    operator.addRole(SequenceOntology.OPERATOR);
    operator.setName("LacI operator");
    operator.setDescription("LacI binding site");
    Component promoterComponent = promoter.createComponent("promoter", AccessType.PUBLIC, constPromoter.getIdentity());
    Component operatorComponent = promoter.createComponent("operator", AccessType.PUBLIC, operator.getIdentity());
    promoter.createSequenceConstraint("r1", RestrictionType.PRECEDES, promoterComponent.getIdentity(), operatorComponent.getIdentity());
    SBOLWriter.write(document, (System.out));
}
Also used : SBOLDocument(org.sbolstandard.core2.SBOLDocument) Component(org.sbolstandard.core2.Component) URI(java.net.URI) ComponentDefinition(org.sbolstandard.core2.ComponentDefinition)

Example 70 with SBOLDocument

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

the class AnnotationOutput method main.

public static void main(String[] args) throws Exception {
    String prURI = "http://partsregistry.org/";
    String prPrefix = "pr";
    SBOLDocument document = new SBOLDocument();
    document.setDefaultURIprefix(prURI);
    document.setTypesInURIs(true);
    document.addNamespace(URI.create(prURI), prPrefix);
    ComponentDefinition promoter = document.createComponentDefinition("BBa_J23119", "", new HashSet<URI>(Arrays.asList(URI.create("http://www.biopax.org/release/biopax-level3.owl#DnaRegion"))));
    promoter.addRole(SequenceOntology.PROMOTER);
    promoter.setName("J23119");
    promoter.setDescription("Constitutive promoter");
    promoter.createAnnotation(new QName(prURI, "group", prPrefix), "iGEM2006_Berkeley");
    promoter.createAnnotation(new QName(prURI, "experience", prPrefix), URI.create("http://parts.igem.org/cgi/partsdb/part_info.cgi?part_name=BBa_J23119"));
    Annotation sigmaFactor = new Annotation(QName(prURI, "sigmafactor", prPrefix), "//rnap/prokaryote/ecoli/sigma70");
    Annotation regulation = new Annotation(QName(prURI, "regulation", prPrefix), "//regulation/constitutive");
    promoter.createAnnotation(new QName(prURI, "information", prPrefix), new QName(prURI, "Information", prPrefix), URI.create("http://partsregistry.org/cd/BBa_J23119/information"), new ArrayList<Annotation>(Arrays.asList(sigmaFactor, regulation)));
    SBOLWriter.write(document, (System.out));
}
Also used : QName(javax.xml.namespace.QName) SBOLDocument(org.sbolstandard.core2.SBOLDocument) URI(java.net.URI) Annotation(org.sbolstandard.core2.Annotation) ComponentDefinition(org.sbolstandard.core2.ComponentDefinition)

Aggregations

SBOLDocument (org.sbolstandard.core2.SBOLDocument)44 URI (java.net.URI)39 URIcompliance.createCompliantURI (org.sbolstandard.core2.URIcompliance.createCompliantURI)27 QName (javax.xml.namespace.QName)26 ArrayList (java.util.ArrayList)23 HashSet (java.util.HashSet)23 Literal (org.sbolstandard.core.datatree.Literal)22 StringifyQName (org.sbolstandard.core.io.json.StringifyQName)22 ComponentDefinition (org.sbolstandard.core2.ComponentDefinition)20 Before (org.junit.Before)17 IdentifiableDocument (org.sbolstandard.core.datatree.IdentifiableDocument)17 NestedDocument (org.sbolstandard.core.datatree.NestedDocument)11 Sequence (org.sbolstandard.core2.Sequence)8 ModuleDefinition (org.sbolstandard.core2.ModuleDefinition)7 FunctionalComponent (org.sbolstandard.core2.FunctionalComponent)6 Activity (org.sbolstandard.core2.Activity)5 Component (org.sbolstandard.core2.Component)4 GenericTopLevel (org.sbolstandard.core2.GenericTopLevel)3 Interaction (org.sbolstandard.core2.Interaction)3 Module (org.sbolstandard.core2.Module)3