use of org.orcid.jaxb.model.record_rc2.Activity 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);
}
Aggregations