use of org.sbolstandard.core2.SBOLDocument in project libSBOLj by SynBioDex.
the class RangeTest method setUp.
@Before
public void setUp() throws Exception {
String prURI = "http://partsregistry.org";
doc = new SBOLDocument();
doc.setDefaultURIprefix(prURI);
doc.setTypesInURIs(false);
doc.setComplete(true);
/*create CD's for main CD and sub-components*/
gRNA_b_gene = doc.createComponentDefinition("gRNA_b_gene", "", ComponentDefinition.DNA);
gene_SA = gRNA_b_gene.createSequenceAnnotation("gene_SA", "cutAt50");
/*create SequenceAnnotations*/
gene_range = gene_SA.addRange("gene_range", 50, 99);
}
use of org.sbolstandard.core2.SBOLDocument in project libSBOLj by SynBioDex.
the class Provenance_StrainDerivation method getCds.
private static ComponentDefinition getCds(SBOLDocument document, String id, String name) throws SBOLValidationException {
ComponentDefinition cds = document.createComponentDefinition(id, ComponentDefinition.DNA);
cds.addRole(SequenceOntology.CDS);
cds.setName(name);
return cds;
}
use of org.sbolstandard.core2.SBOLDocument in project libSBOLj by SynBioDex.
the class CutExample 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_J23119", "", new HashSet<URI>(Arrays.asList(ComponentDefinition.DNA)));
promoter.addRole(SequenceOntology.PROMOTER);
promoter.addRole(URI.create("http://identifiers.org/so/SO:0000613"));
promoter.setName("J23119 promoter");
promoter.setDescription("Constitutive promoter");
promoter.addWasDerivedFrom(URI.create("http://partsregistry.org/Part:BBa_J23119"));
document.setDefaultURIprefix(prURI);
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"));
promoter.addSequence(seq.getIdentity());
promoter.createSequenceAnnotation("cutat10", "cut1", 10, OrientationType.INLINE);
promoter.createSequenceAnnotation("cutat12", "cut2", 12, OrientationType.INLINE);
SBOLWriter.write(document, (System.out));
}
use of org.sbolstandard.core2.SBOLDocument in project ice by JBEI.
the class SBOL2Formatter method format.
@Override
public void format(Sequence sequence, OutputStream outputStream) throws IOException {
SBOLDocument doc = new SBOLDocument();
try {
SBOL2Visitor visitor = new SBOL2Visitor(doc);
visitor.visit(sequence);
doc.write(outputStream);
} catch (SBOLValidationException | SBOLConversionException | URISyntaxException e) {
throw new IOException(e);
}
}
use of org.sbolstandard.core2.SBOLDocument in project ice by JBEI.
the class SBOLParser method createICEModuleDefinitionRecord.
protected void createICEModuleDefinitionRecord(SBOLDocument document, ModuleDefinition moduleDefinition) throws SBOLValidationException {
SBOLDocument rootedDocument = document.createRecursiveCopy(moduleDefinition);
Logger.debug("Creating ICE record for ModuleDefinition: " + moduleDefinition.getIdentity());
String identity = moduleDefinition.getIdentity().toString();
Long partId = identityEntryMap.get(identity);
if (partId == null) {
Logger.debug("Creating " + moduleDefinition.getDisplayId());
createNewEntry(moduleDefinition, rootedDocument);
}
for (FunctionalComponent functionalComponent : moduleDefinition.getFunctionalComponents()) {
ComponentDefinition componentDefinition = functionalComponent.getDefinition();
// Note: record may not exist yet, so you might need to create it now too
if (componentDefinition == null)
continue;
Long componentId = identityEntryMap.get(componentDefinition.getIdentity().toString());
if (componentId == null) {
SBOLDocument sbolDocument = document.createRecursiveCopy(componentDefinition);
componentId = createNewEntry(componentDefinition, sbolDocument);
}
EntryLinks links = new EntryLinks(userId, componentId.toString());
links.addLink(this.partData, LinkType.PARENT);
}
// Note: record may not exist yet, so you might need to create it now too
for (Module module : moduleDefinition.getModules()) {
if (module.getDefinition() == null)
continue;
Long moduleId = identityEntryMap.get(module.getDefinition().getIdentity().toString());
if (moduleId == null) {
SBOLDocument moduleDocument = document.createRecursiveCopy(module.getDefinition());
moduleId = createNewEntry(module.getDefinition(), moduleDocument);
}
EntryLinks links = new EntryLinks(userId, moduleId.toString());
links.addLink(this.partData, LinkType.PARENT);
Logger.debug(" Link to ModuleDefinition: " + module.getDefinition().getIdentity());
}
}
Aggregations