Package org.openbel.framework.common.model

Examples of org.openbel.framework.common.model.Parameter


    @Test
    public void testComplexArgument() {
        err.println("testComplexArgument");
        FunctionEnum funcEnum = FunctionEnum.COMPLEX_ABUNDANCE;
        List<BELObject> args = new ArrayList<BELObject>();
        Parameter parameter = getInstance().createParameter(null, "value");
        args.add(parameter);
        Term t = new Term(funcEnum, args);

        try {
            subject.checkParameterizedTerm(t);
View Full Code Here


    @Test(expected = SemanticWarning.class)
    public void testMultipleEncodings() throws SemanticWarning {
        err.println("testMultipleEncodings");
        FunctionEnum funcEnum = FunctionEnum.COMPLEX_ABUNDANCE;
        List<BELObject> args = new ArrayList<BELObject>();
        Parameter g1 = getInstance().createParameter(null, "value1");
        Parameter g2 = getInstance().createParameter(null, "value2");
        args.add(g1);
        args.add(g2);

        Term t = new Term(funcEnum, args);
View Full Code Here

    @Test(expected = SemanticWarning.class)
    public void testTooManyArgumentsFailure() throws SemanticWarning {
        err.println("testTooManyArgumentsFailure");
        FunctionEnum funcEnum = FunctionEnum.PHOSPHATASE_ACTIVITY;
        List<BELObject> args = new ArrayList<BELObject>();
        Parameter abundance1 = getInstance().createParameter(null, "value1");
        Parameter abundance2 = getInstance().createParameter(null, "value2");
        args.add(abundance1);
        args.add(abundance2);

        Term t = new Term(funcEnum, args);
        subject.checkParameterizedTerm(t);
View Full Code Here

    public void testTicket106_1() throws SemanticWarning {
        err.println("testTicket106_1");
        FunctionEnum funcEnum = FunctionEnum.PROTEIN_ABUNDANCE;
        List<BELObject> args = new ArrayList<BELObject>();

        Parameter arg1 = getInstance().createParameter(null, "value1");
        Term arg2 = new Term(FunctionEnum.SUBSTITUTION);
        Term arg3 = new Term(FunctionEnum.SUBSTITUTION);
        Term arg4 = new Term(FunctionEnum.SUBSTITUTION);
        args.addAll(asList(new BELObject[] { arg1, arg2, arg3, arg4 }));
View Full Code Here

        //         proteinAbundance(HGNC:ARAF),
        //         proteinAbundance(HGNC:BRAF),
        //         proteinAbundance(HGNC:RAF1))

        Term subject1 = new Term(FunctionEnum.PROTEIN_ABUNDANCE,
                asBelObjs(new Parameter(pfh, "RAF Family")));

        Statement.Object object1 =
                new Statement.Object(new Term(FunctionEnum.LIST, asBelObjs(
                        new Term(FunctionEnum.PROTEIN_ABUNDANCE,
                                asBelObjs(new Parameter(hgnc, "ARAF"))),
                        new Term(FunctionEnum.PROTEIN_ABUNDANCE,
                                asBelObjs(new Parameter(hgnc, "BRAF"))),
                        new Term(FunctionEnum.PROTEIN_ABUNDANCE,
                                asBelObjs(new Parameter(hgnc, "RAF1")))
                        )));

        Statement s1 =
                new Statement(subject1, null, null, object1,
                        RelationshipType.HAS_MEMBERS);

        // Example 2:
        // complexAbundance(NCH:"NADPH Oxidase Complex") hasComponents list(
        //         proteinAbundance(HGNC:NCF1),
        //         proteinAbundance(HGNC:CYBB))

        Term subject2 = new Term(FunctionEnum.COMPLEX_ABUNDANCE,
                asBelObjs(new Parameter(nch, "NADPH Oxidase Complex")));

        Statement.Object object2 =
                new Statement.Object(new Term(FunctionEnum.LIST, asBelObjs(
                        new Term(FunctionEnum.PROTEIN_ABUNDANCE,
                                asBelObjs(new Parameter(hgnc, "NCF1"))),
                        new Term(FunctionEnum.PROTEIN_ABUNDANCE,
                                asBelObjs(new Parameter(hgnc, "CYBB"))))));

        Statement s2 =
                new Statement(subject2, null, null, object2,
                        RelationshipType.HAS_COMPONENTS);
View Full Code Here

        // pathology(MESHD:"Atherosclerosis") positiveCorrelation list(
        //         biologicalProcess(GO:"lipid oxidation"),
        //         biologicalProcess(GO:"protein oxidation"))

        Term stmtSubject = new Term(FunctionEnum.PATHOLOGY,
                asBelObjs(new Parameter(meshd, "Atherosclerosis")));

        Statement.Object stmtObject =
                new Statement.Object(new Term(FunctionEnum.LIST,
                        asBelObjs(
                                new Term(FunctionEnum.BIOLOGICAL_PROCESS,
                                        asBelObjs(new Parameter(go,
                                                "lipid oxidation"))),
                                new Term(FunctionEnum.BIOLOGICAL_PROCESS,
                                        asBelObjs(new Parameter(go,
                                                "protein oxidation"))))));

        Statement s = new Statement(stmtSubject, null, null, stmtObject,
                RelationshipType.POSITIVE_CORRELATION);
View Full Code Here

        if (nsFileUrl == null) {
            fail("Cannot read namespace location: " + nsFileUrl);
        }

        final Parameter p = CommonModelFactory.getInstance().createParameter(
                new Namespace("COMPLEX", nsFileUrl),
                "Propionyl Coa Carboxylase Complex");

        try {
            namespaceService.verify(p);
View Full Code Here

    @Override
    public Parameter convert(final XBELParameter source) {
        if (source == null) return null;

        // Destination type
        Parameter dest = new Parameter();

        if (source.isSetNs()) {
            String prefix = source.getNs();
            Namespace ns = new Namespace(prefix, UNRESOVLED_NS);
            dest.setNamespace(ns);
        }

        if (source.isSetValue()) {
            dest.setValue(CommonModelFactory.getInstance().resolveValue(
                    source.getValue()));
        }

        return dest;
    }
View Full Code Here

                    // protein family parameter
                    entry = new TableEntry(val, rl);
                    if (entries.contains(entry)) {
                        // construct family term once, in case we find matches
                        final Term fpt = new Term(PROTEIN_ABUNDANCE);
                        fpt.addFunctionArgument(new Parameter(ns, val));
                        final Term fat = new Term(f);
                        fat.addFunctionArgument(fpt);

                        // since we found a molecular activity function for a
                        // protein family look up UUIDs for all entries
                        // ... loading uuids on demand to save resources
                        if (eu == null) {
                            eu = findUUIDs(entries, lookups);
                        }

                        // search protein family member parameters for same
                        // molecular activity function
                        final List<Parameter> op = stmt.getObject().getTerm()
                                .getAllParameters();
                        for (final Parameter mp : op) {
                            Namespace mns = mp.getNamespace();
                            String mval = mp.getValue();
                            String mrl = mns.getResourceLocation();

                            // lookup UUID for protein family member
                            JDBMEquivalenceLookup jdbmLookup = lookups.get(mrl);
                            if (jdbmLookup == null) {
                                continue;
                            }
                            SkinnyUUID uuid = jdbmLookup.lookup(mval);

                            // do we have protein family member parameter uuid
                            // in molecular activity function entries?
                            if (eu.contains(uuid)) {
                                // construct member term
                                final Term mpt = new Term(PROTEIN_ABUNDANCE);
                                mpt.addFunctionArgument(new Parameter(mns, mval));
                                final Term mat = new Term(f);
                                mat.addFunctionArgument(mpt);

                                // construct isA statement between member and family
                                isaStmts.add(new Statement(mat, null,
View Full Code Here

            if (validOrthologousStatement(orthoStmt)) {
                // break down subject
                final Term sub = orthoStmt.getSubject();
                final FunctionEnum subf = sub.getFunctionEnum();
                final List<Parameter> subp = sub.getParameters();
                final Parameter subjectParam = subp.get(0);

                // break down object
                final Term obj = orthoStmt.getObject().getTerm();
                final FunctionEnum objf = obj.getFunctionEnum();
                final List<Parameter> objp = obj.getParameters();
                final Parameter objectParam = objp.get(0);

                // lookup exact match of subject term
                if (pnterms.contains(sub)) {
                    pnterms.add(obj);

                    continue;
                }

                // find UUID for subject parameter
                SkinnyUUID uuid = paramcache.get(subjectParam);
                if (uuid == null) {
                    final Namespace ns = subjectParam.getNamespace();
                    final JDBMEquivalenceLookup lookup = lookups.get(ns
                            .getResourceLocation());
                    if (lookup == null) {
                        continue;
                    }

                    uuid = lookup.lookup(subjectParam.getValue());
                    paramcache.put(subjectParam, uuid);
                }

                // if there is a proto network term with this UUID contained, then
                // this orthologous statement intersects the proto network, continue
                if (uuid != null) {
                    Set<Integer> tids = uuidterms.get(uuid);
                    if (hasItems(tids)) {
                        for (final Integer tid : tids) {
                            final Term t = tt.getIndexedTerms().get(tid);
                            if (t.getFunctionEnum() == subf) {
                                pnterms.add(sub);
                                pnterms.add(t);
                                pnterms.add(obj);

                                continue ORTHO_STATEMENT;
                            }
                        }
                    }
                }

                // lookup exact match of object term
                if (pnterms.contains(obj)) {
                    pnterms.add(sub);
                    continue;
                }

                // find UUID for object parameter
                uuid = paramcache.get(objectParam);
                if (uuid == null) {
                    final Namespace ns = objectParam.getNamespace();
                    final JDBMEquivalenceLookup lookup = lookups.get(ns
                            .getResourceLocation());
                    if (lookup == null) {
                        continue;
                    }

                    uuid = lookup.lookup(objectParam.getValue());
                    paramcache.put(objectParam, uuid);
                }

                // if there is a proto network term with this UUID contained, then
                // this orthologous statement intersects the proto network, continue
View Full Code Here

TOP

Related Classes of org.openbel.framework.common.model.Parameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.