Search in sources :

Example 11 with SEQUENCE

use of org.openmuc.jasn1.compiler.modules.module1.PersonnelRecord.TestSequenceOf2.SEQUENCE in project libSBOLj by SynBioDex.

the class SimpleComponentDefinitionExample 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, URI.create("http://identifiers.org/chebi/CHEBI:4705"))));
    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());
    SBOLWriter.write(document, (System.out));
}
Also used : SBOLDocument(org.sbolstandard.core2.SBOLDocument) Sequence(org.sbolstandard.core2.Sequence) URI(java.net.URI) ComponentDefinition(org.sbolstandard.core2.ComponentDefinition)

Example 12 with SEQUENCE

use of org.openmuc.jasn1.compiler.modules.module1.PersonnelRecord.TestSequenceOf2.SEQUENCE in project libSBOLj by SynBioDex.

the class GettingStartedExample method main.

public static void main(String[] args) throws IOException, SBOLValidationException, SBOLConversionException {
    String prURI = "http://partsregistry.org/";
    String prPrefix = "pr";
    String myersLabURI = "http://www.async.ece.utah.edu/";
    String myersLabPrefix = "myersLab";
    SBOLDocument document = new SBOLDocument();
    document.setDefaultURIprefix(prURI);
    document.setTypesInURIs(true);
    document.setComplete(true);
    document.setCreateDefaults(true);
    document.addNamespace(URI.create(prURI), prPrefix);
    document.addNamespace(URI.create(myersLabURI), myersLabPrefix);
    // Creating a Top-level SBOL Data Object
    HashSet<URI> types = new HashSet<URI>(Arrays.asList(ComponentDefinition.DNA, URI.create("http://identifiers.org/chebi/CHEBI:4705")));
    ComponentDefinition TetR_promoter = document.createComponentDefinition("BBa_R0040", types);
    ComponentDefinition LacI_repressor = document.createComponentDefinition("BBa_C0012", types);
    ComponentDefinition pIKELeftCassette = document.createComponentDefinition("pIKELeftCassette", types);
    Sequence seq_187 = document.createSequence("partseq_187", "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac", Sequence.IUPAC_DNA);
    String element2 = "atggtgaatgtgaaaccagtaacgttatacgatgtcgcagagtatgccggtgtc" + "tcttatcagaccgtttcccgcgtggtgaaccaggccagccacgtttctgcgaaaacgcggga" + "aaaagtggaagcggcgatggcggagctgaattacattcccaaccgcgtggcacaacaactgg" + "cgggcaaacagtcgttgctgattggcgttgccacctccagtctggccctgcacgcgccgtcg" + "caaattgtcgcggcgattaaatctcgcgccgatcaactgggtgccagcgtggtggtgtcgat" + "ggtagaacgaagcggcgtcgaagcctgtaaagcggcggtgcacaatcttctcgcgcaacgcg" + "tcagtgggctgatcattaactatccgctggatgaccaggatgccattgctgtggaagctgcc" + "tgcactaatgttccggcgttatttcttgatgtctctgaccagacacccatcaacagtattat" + "tttctcccatgaagacggtacgcgactgggcgtggagcatctggtcgcattgggtcaccagc" + "aaatcgcgctgttagcgggcccattaagttctgtctcggcgcgtctgcgtctggctggctgg" + "cataaatatctcactcgcaatcaaattcagccgatagcggaacgggaaggcgactggagtgc" + "catgtccggttttcaacaaaccatgcaaatgctgaatgagggcatcgttcccactgcgatgc" + "tggttgccaacgatcagatggcgctgggcgcaatgcgcgccattaccgagtccgggctgcgc" + "gttggtgcggatatctcggtagtgggatacgacgataccgaagacagctcatgttatatccc" + "gccgttaaccaccatcaaacaggattttcgcctgctggggcaaaccagcgtggaccgcttgc" + "tgcaactctctcagggccaggcggtgaagggcaatcagctgttgcccgtctcactggtgaaa" + "agaaaaaccaccctggcgcccaatacgcaaaccgcctctccccgcgcgttggccgattcatt" + "aatgcagctggcacgacaggtttcccgactggaaagcgggcaggctgcaaacgacgaaaact" + "acgctttagtagcttaataa";
    Sequence seq_153 = document.createSequence("partseq_153", element2, Sequence.IUPAC_DNA);
    // Setting and editing optional fields
    TetR_promoter.setName("p(tetR)");
    LacI_repressor.setName("lacI");
    TetR_promoter.setDescription("TetR repressible promoter");
    LacI_repressor.setDescription("lacI repressor from E. coli (+LVA)");
    if (TetR_promoter.isSetName()) {
        TetR_promoter.unsetName();
    }
    TetR_promoter.setName("p(tetR)");
    TetR_promoter.addRole(SequenceOntology.PROMOTER);
    LacI_repressor.addRole(SequenceOntology.CDS);
    URI TetR_promoter_role2 = URI.create("http://identifiers.org/so/SO:0000613");
    TetR_promoter.addRole(TetR_promoter_role2);
    if (TetR_promoter.containsRole(TetR_promoter_role2)) {
        TetR_promoter.removeRole(TetR_promoter_role2);
    }
    TetR_promoter.clearRoles();
    if (!TetR_promoter.getRoles().isEmpty()) {
        System.out.println("TetR_promoter set is not empty");
    }
    TetR_promoter.setRoles(new HashSet<URI>(Arrays.asList(SequenceOntology.PROMOTER)));
    // Creating and editing references
    TetR_promoter.addSequence(seq_187);
    LacI_repressor.addSequence(seq_153);
    pIKELeftCassette.addSequence(seq_187);
    pIKELeftCassette.clearSequences();
    // Adding the sequence below causes an exception because it cannot be found
    // pIKELeftCassette.addSequence(URI.create("http://partsregistry.org/seq/partseq_154"));
    // Creating Annotations
    TetR_promoter.createAnnotation(new QName(prURI, "experience", prPrefix), URI.create("http://parts.igem.org/Part:BBa_R0040"));
    // Creating Generic TopLevel Object
    GenericTopLevel datasheet = document.createGenericTopLevel("datasheet", "1.0", new QName(myersLabURI, "datasheet", myersLabPrefix));
    datasheet.setName("Datasheet for Custom Parameters");
    datasheet.createAnnotation(new QName(myersLabURI, "characterizationData", myersLabPrefix), URI.create(myersLabURI + "/measurement/Part:BBa_R0040"));
    datasheet.createAnnotation(new QName(myersLabURI, "transcriptionRate", myersLabPrefix), "0.75");
    TetR_promoter.createAnnotation(new QName(myersLabURI, "datasheet", myersLabPrefix), datasheet.getIdentity());
    // Creating and editing Child Objects
    // For pIKELeftCassette, create sequence constraint that says BBa_R0040 precedes BBa_C0012.
    // Note that with CreateDefaults that components get created automatically.
    // The position of the subject Component MUST precede that of the object Component.
    pIKELeftCassette.createSequenceConstraint("pIKELeftCassette_sc", RestrictionType.PRECEDES, TetR_promoter.getDisplayId(), LacI_repressor.getDisplayId());
    if (pIKELeftCassette.getComponent("BBa_R0040") == null) {
        System.out.println("TetR_promoter component is missing");
    }
    if (pIKELeftCassette.getComponent("BBa_C0012") == null) {
        System.out.println("LacI_repressor component is missing");
    }
    // Removing the subject component below causes an exception.
    // pIKELeftCassette.removeComponent(pIKELeftCassette.getComponent("BBa_R0040"));
    // Copying objects
    ComponentDefinition TetR_promoter_copy = (ComponentDefinition) document.createCopy(TetR_promoter, "BBa_K137046");
    Sequence seq = document.createSequence("seq_K137046", "gtgctcagtatctctatcactgatagggatgtcaatctctatcactgatagggactctagtatat" + "aaacgcagaaaggcccacccgaaggtgagccagtgtgactctagtagagagcgttcaccgaca" + "aacaacagataaaacgaaaggc", Sequence.IUPAC_DNA);
    TetR_promoter_copy.addSequence(seq);
    SBOLWriter.write(document, "GettingStartedExample.rdf");
    writeThenRead(document);
}
Also used : QName(javax.xml.namespace.QName) SBOLDocument(org.sbolstandard.core2.SBOLDocument) GenericTopLevel(org.sbolstandard.core2.GenericTopLevel) Sequence(org.sbolstandard.core2.Sequence) URI(java.net.URI) HashSet(java.util.HashSet) ComponentDefinition(org.sbolstandard.core2.ComponentDefinition)

Example 13 with SEQUENCE

use of org.openmuc.jasn1.compiler.modules.module1.PersonnelRecord.TestSequenceOf2.SEQUENCE in project libSBOLj by SynBioDex.

the class ComponentDefinitionOutput method createComponentDefinitionOutput.

public static SBOLDocument createComponentDefinitionOutput() throws SBOLValidationException {
    String prURI = "http://partsregistry.org/";
    String prPrefix = "pr";
    SBOLDocument document = new SBOLDocument();
    document.setTypesInURIs(true);
    document.addNamespace(URI.create(prURI), prPrefix);
    document.setDefaultURIprefix(prURI);
    Sequence seqpTetR = document.createSequence("BBa_R0040", "", "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac", URI.create("http://www.chem.qmul.ac.uk/iubmb/misc/naseq.html"));
    Sequence seqRbs = document.createSequence("BBa_B0034", "", "aaagaggagaaa", URI.create("http://www.chem.qmul.ac.uk/iubmb/misc/naseq.html"));
    Sequence seqCds = document.createSequence("BBa_C0062", "", "atgcttatctgatatgactaaaatggtacattgtgaatattatttactcgcgatcatttatcctcattctatggttaaatctgatatttcaatcctagataattaccctaaaaaatggaggcaatattatgatgacgctaatttaataaaatatgatcctatagtagattattctaactccaatcattcaccaattaattggaatatatttgaaaacaatgctgtaaataaaaaatctccaaatgtaattaaagaagcgaaaacatcaggtcttatcactgggtttagtttccctattcatacggctaacaatggcttcggaatgcttagttttgcacattcagaaaaagacaactatatagatagtttatttttacatgcgtgtatgaacataccattaattgttccttctctagttgataattatcgaaaaataaatatagcaaataataaatcaaacaacgatttaaccaaaagagaaaaagaatgtttagcgtgggcatgcgaaggaaaaagctcttgggatatttcaaaaatattaggttgcagtgagcgtactgtcactttccatttaaccaatgcgcaaatgaaactcaatacaacaaaccgctgccaaagtatttctaaagcaattttaacaggagcaattgattgcccatactttaaaaattaataacactgatagtgctagtgtagatcac", URI.create("http://www.chem.qmul.ac.uk/iubmb/misc/naseq.html"));
    Sequence seqTer = document.createSequence("BBa_B0015", "", "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctctactagagtcacactggctcaccttcgggtgggcctttctgcgtttata", URI.create("http://www.chem.qmul.ac.uk/iubmb/misc/naseq.html"));
    Sequence seqPluxR = document.createSequence("BBa_R0062", "", "acctgtaggatcgtacaggtttacgcaagaaaatggtttgttatagtcgaataaa", URI.create("http://www.chem.qmul.ac.uk/iubmb/misc/naseq.html"));
    ComponentDefinition pTetR = document.createComponentDefinition("BBa_R0040", "", new HashSet<URI>(Arrays.asList(ComponentDefinition.DNA)));
    pTetR.addRole(SequenceOntology.PROMOTER);
    pTetR.setName("pTetR");
    pTetR.setDescription("TetR repressible promoter");
    pTetR.addSequence(seqpTetR.getIdentity());
    ComponentDefinition rbs = document.createComponentDefinition("BBa_B0034", "", new HashSet<URI>(Arrays.asList(ComponentDefinition.DNA)));
    rbs.addRole(SequenceOntology.RIBOSOME_ENTRY_SITE);
    rbs.setName("BBa_B0034");
    rbs.setDescription("RBS based on Elowitz repressilator");
    rbs.addSequence(seqRbs.getIdentity());
    ComponentDefinition cds = document.createComponentDefinition("BBa_C0062", "", new HashSet<URI>(Arrays.asList(ComponentDefinition.DNA)));
    cds.addRole(SequenceOntology.CDS);
    cds.setName("luxR");
    cds.setDescription("luxR coding sequence");
    cds.addSequence(seqCds.getIdentity());
    ComponentDefinition ter = document.createComponentDefinition("BBa_B0015", "", new HashSet<URI>(Arrays.asList(ComponentDefinition.DNA)));
    ter.addRole(URI.create("http://identifiers.org/so/SO:0000141"));
    ter.setName("BBa_B0015");
    ter.setDescription("Double terminator");
    ter.addSequence(seqTer.getIdentity());
    ComponentDefinition pluxR = document.createComponentDefinition("BBa_R0062", "", new HashSet<URI>(Arrays.asList(ComponentDefinition.DNA)));
    // 
    pluxR.addRole(SequenceOntology.PROMOTER);
    pluxR.setName("pLuxR");
    pluxR.setDescription("LuxR inducible promoter");
    pluxR.addSequence(seqPluxR.getIdentity());
    ComponentDefinition device = document.createComponentDefinition("BBa_F2620", "", new HashSet<URI>(Arrays.asList(ComponentDefinition.DNA)));
    // biological region
    device.addRole(URI.create("http://identifiers.org/so/SO:00001411"));
    device.setName("BBa_F2620");
    device.setDescription("3OC6HSL -> PoPS Receiver");
    Component comPtetR = device.createComponent("pTetR", AccessType.PUBLIC, pTetR.getIdentity());
    Component comRbs = device.createComponent("rbs", AccessType.PUBLIC, rbs.getIdentity());
    Component comCds = device.createComponent("luxR", AccessType.PUBLIC, cds.getIdentity());
    Component comTer = device.createComponent("ter", AccessType.PUBLIC, ter.getIdentity());
    Component comPluxR = device.createComponent("pLuxR", AccessType.PUBLIC, pluxR.getIdentity());
    int start = 1;
    int end = seqPluxR.getElements().length();
    SequenceAnnotation anno = device.createSequenceAnnotation("anno1", "location1", start, end, OrientationType.INLINE);
    anno.setComponent(comPtetR.getIdentity());
    start = end + 1;
    end = seqRbs.getElements().length() + end + 1;
    SequenceAnnotation anno2 = device.createSequenceAnnotation("anno2", "location2", start, end, OrientationType.INLINE);
    anno2.setComponent(comRbs.getIdentity());
    start = end + 1;
    end = seqCds.getElements().length() + end + 1;
    SequenceAnnotation anno3 = device.createSequenceAnnotation("anno3", "location3", start, end, OrientationType.INLINE);
    anno3.setComponent(comCds.getIdentity());
    start = end + 1;
    end = seqTer.getElements().length() + end + 1;
    SequenceAnnotation anno4 = device.createSequenceAnnotation("anno4", "location4", start, end, OrientationType.INLINE);
    anno4.setComponent(comTer.getIdentity());
    start = end + 1;
    end = seqPluxR.getElements().length() + end + 1;
    SequenceAnnotation anno5 = device.createSequenceAnnotation("anno5", "location5", start, end, OrientationType.INLINE);
    anno5.setComponent(comPluxR.getIdentity());
    return document;
}
Also used : SBOLDocument(org.sbolstandard.core2.SBOLDocument) SequenceAnnotation(org.sbolstandard.core2.SequenceAnnotation) Sequence(org.sbolstandard.core2.Sequence) Component(org.sbolstandard.core2.Component) URI(java.net.URI) ComponentDefinition(org.sbolstandard.core2.ComponentDefinition)

Example 14 with SEQUENCE

use of org.openmuc.jasn1.compiler.modules.module1.PersonnelRecord.TestSequenceOf2.SEQUENCE in project libSBOLj by SynBioDex.

the class SequenceTest method test_deep_copy.

@Test
public void test_deep_copy() throws SBOLValidationException {
    Sequence gen_seq = doc.createSequence("CRa_U6_seq", CRa_U6_seq, Sequence.IUPAC_DNA);
    Sequence copy_seq = (Sequence) doc.createCopy(gen_seq, "copy_seq");
    // assertTrue(copy_seq.equals(gen_seq));
    assertTrue(copy_seq.getElements().equals(CRa_U6_seq));
}
Also used : Sequence(org.sbolstandard.core2.Sequence) Test(org.junit.Test)

Example 15 with SEQUENCE

use of org.openmuc.jasn1.compiler.modules.module1.PersonnelRecord.TestSequenceOf2.SEQUENCE in project OpenAM by OpenRock.

the class SecureLogHelperJSSImpl method AddToSecretStore.

/**
     * Adds  secret information to the secret Storage.
     * @param cryptoMaterial : The data to be added
     */
private SEQUENCE AddToSecretStore(byte[] cryptoMaterial, String DataType) throws Exception {
    SEQUENCE encSafeContents = new SEQUENCE();
    ASN1Value data = new OCTET_STRING(cryptoMaterial);
    byte[] localKeyId = createLocalKeyId(cryptoMaterial);
    SET keyAttrs = createBagAttrs(DataType, localKeyId);
    // attributes: user friendly name, Local Key ID
    SafeBag keyBag = new SafeBag(SafeBag.SECRET_BAG, data, keyAttrs);
    encSafeContents.addElement(keyBag);
    return encSafeContents;
}
Also used : ASN1Value(org.mozilla.jss.asn1.ASN1Value) OCTET_STRING(org.mozilla.jss.asn1.OCTET_STRING) SET(org.mozilla.jss.asn1.SET) SEQUENCE(org.mozilla.jss.asn1.SEQUENCE) SafeBag(org.mozilla.jss.pkcs12.SafeBag)

Aggregations

IOException (java.io.IOException)11 EOFException (java.io.EOFException)10 Sequence (org.sbolstandard.core2.Sequence)9 ComponentDefinition (org.sbolstandard.core2.ComponentDefinition)6 SBOLDocument (org.sbolstandard.core2.SBOLDocument)6 URI (java.net.URI)5 Certificate (org.openmuc.jasn1.compiler.pkix1explicit88.Certificate)5 Test (org.junit.Test)4 SEQUENCE (org.mozilla.jss.asn1.SEQUENCE)4 BerTag (org.openmuc.jasn1.ber.BerTag)4 ByteArrayInputStream (java.io.ByteArrayInputStream)3 BMPString (org.mozilla.jss.asn1.BMPString)3 SET (org.mozilla.jss.asn1.SET)3 ReverseByteArrayOutputStream (org.openmuc.jasn1.ber.ReverseByteArrayOutputStream)3 BerInteger (org.openmuc.jasn1.ber.types.BerInteger)3 AsnBitString (org.openmuc.jasn1.compiler.model.AsnBitString)3 AsnCharacterString (org.openmuc.jasn1.compiler.model.AsnCharacterString)3 AsnElementType (org.openmuc.jasn1.compiler.model.AsnElementType)3 AsnOctetString (org.openmuc.jasn1.compiler.model.AsnOctetString)3 AsnTag (org.openmuc.jasn1.compiler.model.AsnTag)3