Package org.openbel.framework.common.model

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


        System.out.println(term.toBELLongForm());
    }

    @Test
    public void testThreeLevelNesting() {
        Term term =
                BELParser
                        .parseTerm("complexAbundance(complexAbundance(proteinAbundance(HGNC:GABPA),proteinAbundance(HGNC:GABPB1)),complexAbundance(proteinAbundance(HGNC:GABPA),proteinAbundance(HGNC:GABPB1)))");
        System.out.println(term.toBELLongForm());
    }
View Full Code Here


        System.out.println(term.toBELLongForm());
    }

    @Test
    public void testNestedReaction() {
        Term term =
                BELParser
                        .parseTerm("reaction(reactants(complexAbundance(proteinAbundance(HGNC:ESR1),proteinAbundance(PFAM:\"Ncor Family\"))),products(complexAbundance(proteinAbundance(PFAM:\"Ncoa Family\"),proteinAbundance(HGNC:ESR1))))");
        System.out.println(term.toBELLongForm());
    }
View Full Code Here

        System.out.println(term.toBELLongForm());
    }

    @Test
    public void testModificationTwoParams() {
        Term term =
                BELParser
                        .parseTerm("reaction(reactants(proteinAbundance(HGNC:AR)),products(proteinAbundance(HGNC:AR,proteinModification(A,K632))))");
        System.out.println(term.toBELLongForm());
    }
View Full Code Here

            // find first term and convert to species namespaces
            final List<BelTerm> terms = kAMStore
                    .getSupportingTerms(kamNode);
            if (hasItems(terms)) {
                final BelTerm term = terms.get(0);
                final Term ts = BELParser.parseTerm(term.getLabel());
                final Term converted = convert(ts, param);

                cached = displayLongForm ? converted.toBELLongForm()
                        : converted.toBELShortForm();
                labelCache.put(nodeLabel, cached);
                return cached;
            }

            // if there are no supporting terms, return node label,
View Full Code Here

        System.out.println(term.toBELLongForm());
    }

    @Test
    public void testCollidingParamWithFunction() {
        Term term = BELParser.parseTerm("proteinAbundance(MGI:t)");
        System.out.println(term.toBELLongForm());
    }
View Full Code Here

     *
     * @param orig
     * @return
     */
    protected Term convert(Term orig, Parameter speciesParam) {
        Term t = new Term(orig.getFunctionEnum());
        for (BELObject o : orig.getFunctionArguments()) {
            t.addFunctionArgument(convert(o, speciesParam));
        }
        return t;
    }
View Full Code Here

        if (supportingTermLabelReverseCache.containsKey(belTerm)) {
            return supportingTermLabelReverseCache.get(belTerm);
        }

        // parse the BelTerm
        Term t;
        try {
            t = BELParser.parseTerm(belTerm);
        } catch (Exception e) {
            // invalid BEL
            return null;
        }

        // convert to short form
        String shortForm = t.toBELShortForm();

        // 1: short circuit; try by kam node label
        PreparedStatement ps = getPreparedStatement(SELECT_KAM_NODE_BY_LABEL_SQL);
        ResultSet rset = null;
        try {
            ps.setString(1, shortForm);
            rset = ps.executeQuery();
            if (rset.next()) {
                int kamNodeId = rset.getInt(1);
                supportingTermLabelReverseCache.put(belTerm, kamNodeId);
                return kamNodeId;
            }
        } finally {
            close(rset);
        }

        // 2: try by bel terms
        Collection<Integer> possibleTermIds = null;
        int ordinal = 0;
        for (Parameter param : t.getAllParametersLeftToRight()) {
            Integer namespaceId = null;
            if (param.getNamespace() != null
                    && StringUtils.isNotBlank(param.getNamespace().getPrefix())) {
                Namespace ns =
                        getNamespaceByPrefix(param.getNamespace().getPrefix());
View Full Code Here

        // Iterate each node
        int eq = 0;
        for (int i = 0, n = nodes.size(); i < n; i++) {
            final Integer termidx = nodeTerms.get(i);
            final Term term = tt.getIndexedTerms().get(termidx);
            // Convert to an equivalent term
            EquivalentTerm equiv = eqCvtr.convert(term);
            Integer eqId = nodeCache.get(equiv);
            if (eqId != null) {
                // We've seen an equivalent term before, use that.
View Full Code Here

        if (!(y instanceof Term)) {
            // Second argument must be a term
            return false;
        }

        Term ytrm = (Term) y;
        if (!isProteinDecorator(ytrm.getFunctionEnum())) {
            // Protein decorator functions only
            return false;
        }

        return true;
View Full Code Here

        BELObject proteinArgument = term.getFunctionArguments().get(0);
        Parameter pp = (Parameter) proteinArgument;

        // second argument of a protein mod term is the modification
        BELObject modArgument = term.getFunctionArguments().get(1);
        Term mt = (Term) modArgument;

        FunctionEnum fx = mt.getFunctionEnum();

        Term proteinTrm = new Term(PROTEIN_ABUNDANCE);
        proteinTrm.addFunctionArgument(pp);

        Statement stmt = null;
        final Object obj = new Object(term);
        if (isMutation(fx)) {
            // mutation
View Full Code Here

TOP

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

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.