Search in sources :

Example 6 with Component

use of org.powerbot.script.rt6.Component 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 7 with Component

use of org.powerbot.script.rt6.Component in project zipkin by openzipkin.

the class ComponentHealthTest method addsMessageToDetails.

@Test
public void addsMessageToDetails() {
    ComponentHealth health = ComponentHealth.ofComponent(new Component() {

        @Override
        public CheckResult check() {
            return CheckResult.failed(new IOException("socket disconnect"));
        }
    });
    assertThat(health.error).isEqualTo("java.io.IOException: socket disconnect");
}
Also used : CheckResult(zipkin2.CheckResult) IOException(java.io.IOException) Component(zipkin2.Component) Test(org.junit.Test)

Example 8 with Component

use of org.powerbot.script.rt6.Component in project zipkin by openzipkin.

the class ComponentHealthTest method doesntAddNullMessageToDetails.

@Test
public void doesntAddNullMessageToDetails() {
    ComponentHealth health = ComponentHealth.ofComponent(new Component() {

        @Override
        public CheckResult check() {
            return CheckResult.failed(ClosedSessionException.get());
        }
    });
    assertThat(health.error).isEqualTo("com.linecorp.armeria.common.ClosedSessionException");
}
Also used : CheckResult(zipkin2.CheckResult) Component(zipkin2.Component) Test(org.junit.Test)

Example 9 with Component

use of org.powerbot.script.rt6.Component in project libSBOLj by SynBioDex.

the class ModuleDefinitionOutput method addSubComponents.

private static void addSubComponents(SBOLDocument document, ComponentDefinition componentDef, List<ComponentDefinition> subComponents) throws Exception {
    int i = 1;
    int start = 0;
    int end = 0;
    for (ComponentDefinition subComponent : subComponents) {
        Component component = componentDef.createComponent(subComponent.getDisplayId(), AccessType.PUBLIC, subComponent.getIdentity());
        start = end + 1;
        end = start + getSequenceLength(document, subComponent);
        SequenceAnnotation annotation = componentDef.createSequenceAnnotation("anno" + i, "location" + i, start, end, OrientationType.INLINE);
        annotation.setComponent(component.getIdentity());
        i++;
    }
}
Also used : SequenceAnnotation(org.sbolstandard.core2.SequenceAnnotation) Component(org.sbolstandard.core2.Component) FunctionalComponent(org.sbolstandard.core2.FunctionalComponent) ComponentDefinition(org.sbolstandard.core2.ComponentDefinition)

Example 10 with Component

use of org.powerbot.script.rt6.Component in project libSBOLj by SynBioDex.

the class ModuleDefinitionOutput method getSequenceLength.

private static int getSequenceLength(SBOLDocument document, ComponentDefinition componentDef) throws Exception {
    if (componentDef.getSequences() != null && componentDef.getSequences().size() > 0) {
        Sequence sequence = componentDef.getSequences().iterator().next();
        return sequence.getElements().length();
    } else {
        int total = 0;
        for (SequenceAnnotation annotation : componentDef.getSequenceAnnotations()) {
            if (annotation.getComponent() != null) {
                Component component = annotation.getComponent();
                ComponentDefinition subComponentDef = component.getDefinition();
                total = total + getSequenceLength(document, subComponentDef);
            } else {
                throw new Exception("Can't get sequence length for an incomplete design");
            }
        }
        return total;
    }
}
Also used : SequenceAnnotation(org.sbolstandard.core2.SequenceAnnotation) Sequence(org.sbolstandard.core2.Sequence) Component(org.sbolstandard.core2.Component) FunctionalComponent(org.sbolstandard.core2.FunctionalComponent) SBOLValidationException(org.sbolstandard.core2.SBOLValidationException) ComponentDefinition(org.sbolstandard.core2.ComponentDefinition)

Aggregations

Point (java.awt.Point)5 Component (org.powerbot.script.rt6.Component)5 Condition (org.powerbot.script.Condition)4 Component (org.sbolstandard.core2.Component)4 ComponentDefinition (org.sbolstandard.core2.ComponentDefinition)4 SequenceAnnotation (org.sbolstandard.core2.SequenceAnnotation)3 Font (java.awt.Font)2 URI (java.net.URI)2 ArrayList (java.util.ArrayList)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 Test (org.junit.Test)2 Component (org.powerbot.script.rt4.Component)2 Item (org.powerbot.script.rt6.Item)2 FunctionalComponent (org.sbolstandard.core2.FunctionalComponent)2 SBOLDocument (org.sbolstandard.core2.SBOLDocument)2 Sequence (org.sbolstandard.core2.Sequence)2 CheckResult (zipkin2.CheckResult)2 Component (zipkin2.Component)2 Color (java.awt.Color)1 Rectangle (java.awt.Rectangle)1