Package org.openbel.framework.common.model

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


        if (equivalentValue == null) {
            return null;
        }

        return new Parameter(destinationNamespace, equivalentValue);
    }
View Full Code Here


    public List<Statement> expand(Term term) {
        List<Statement> statements = new ArrayList<Statement>();

        // first argument of a protein mod term is the protein parameter
        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;
View Full Code Here

        }

        List<Parameter> parameters = term.getParameters();

        // Check mod type
        Parameter parameter = parameters.get(0);
        String pval = parameter.getValue();

        if (!validPType(pval)) {
            String msg;
            if (pval == null) {
                msg = SEMANTIC_NOT_CM;
            } else {
                msg = format(SEMANTIC_PTYPE_NOT_CM, pval);
            }
            ret.add(new SemanticWarning(term.toBELLongForm(), msg));
        }

        if (numargs == 1) {
            return ret;
        }

        // Check mod code
        parameter = parameters.get(1);
        pval = parameter.getValue();

        if (!validAcid(pval)) {
            String msg;
            if (pval == null) {
                msg = SEMANTIC_NOT_AA;
            } else {
                msg = format(SEMANTIC_CODE_NOT_AA, pval);
            }
            ret.add(new SemanticWarning(term.toBELLongForm(), msg));
        }

        if (numargs == 2) {
            return ret;
        }

        // Check mod position
        parameter = parameters.get(2);
        pval = parameter.getValue();

        if (!validPosition(pval)) {
            String msg;
            if (pval == null) {
                msg = SEMANTIC_NOT_INT;
View Full Code Here

        if (numargs != 3) {
            return ret;
        }

        // Check amino acid variant
        Parameter parameter = parameters.get(0);
        String pval = parameter.getValue();

        if (!validAcid(pval)) {
            String msg;
            if (pval == null) {
                msg = SEMANTIC_NOT_AA;
            } else {
                msg = format(SEMANTIC_CODE_NOT_AA, pval);
            }
            ret.add(new SemanticWarning(term.toBELLongForm(), msg));
        }

        // Check mod position
        parameter = parameters.get(1);
        pval = parameter.getValue();

        if (!validPosition(pval)) {
            String msg;
            if (pval == null) {
                msg = SEMANTIC_NOT_INT;
            } else {
                msg = format(SEMANTIC_POS_NOT_INT, pval);
            }
            ret.add(new SemanticWarning(term.toBELLongForm(), msg));
        }

        // Check amino acid variant
        parameter = parameters.get(2);
        pval = parameter.getValue();

        if (!validAcid(pval)) {
            String msg;
            if (pval == null) {
                msg = SEMANTIC_NOT_AA;
View Full Code Here

        if (numargs != 1) {
            return ret;
        }

        // Check mod position
        Parameter parameter = parameters.get(0);
        String pval = parameter.getValue();

        if (!validPosition(pval)) {
            String msg;
            if (pval == null) {
                msg = SEMANTIC_NOT_INT;
View Full Code Here

        if (parameters.size() != 3) {
            return ret;
        }

        for (int i = 1; i <= 2; i++) {
            Parameter parameter = parameters.get(i);
            String pval = parameter.getValue();

            if (!validPosition(pval)) {
                String msg;
                if (pval == null) {
                    msg = SEMANTIC_NOT_INT;
View Full Code Here

            }
            // find first equivalent in list of desired
            for (Namespace ns : coll) {
                String v = equivalencer.equivalence(uuid, ns);
                if (v != null) {
                    return removeNamespacePrefix ? new Parameter(null, v)
                            : new Parameter(ns, v);
                }
            }
        } catch (EquivalencerException e) {
            // TODO exception
            return null;
View Full Code Here

    static Parameter readParameter(ObjectInput in) throws IOException,
            ClassNotFoundException {
        Namespace ns = (Namespace) readObject(in);
        String value = (String) readObject(in);
        return new Parameter(ns, value);
    }
View Full Code Here

                                    String prefix = nsp.getText();
                                    prefix = prefix.substring(0, prefix.length() - 1);
                                    ns = new Namespace(prefix, "FIX_ME");
                                }
                           
                                retval.r = new Parameter();
                                retval.r.setValue(NS_VALUE9.getText());
                                retval.r.setNamespace(ns);
                           

                    }
                    break;
                case 2 :
                    // BELStatement.g:147:9: QUOTED_VALUE
                    {
                    QUOTED_VALUE10=(Token)match(input,QUOTED_VALUE,FOLLOW_QUOTED_VALUE_in_param541);
                    QUOTED_VALUE10_tree = (Object)adaptor.create(QUOTED_VALUE10);
                    adaptor.addChild(root_0, QUOTED_VALUE10_tree);


                                Namespace ns = null;
                               
                                if(nsp != null) {
                                    String prefix = nsp.getText();
                                    prefix = prefix.substring(0, prefix.length() - 1);
                                    ns = new Namespace(prefix, "FIX_ME");
                                }
                               
                                retval.r = new Parameter();
                                retval.r.setNamespace(ns);

                                // Strip quotes
                                String quoted = QUOTED_VALUE10.getText();
                                retval.r.setValue(quoted.substring(1, quoted.length() - 1));
View Full Code Here

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

        try {
            subject.checkParameterizedTerm(t);
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.