Package org.openbel.framework.common.model

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


                    // have we seen a molecular activity function for this
                    // 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,
                                        null, new Object(fat), IS_A));
                                inferred++;
View Full Code Here


        ORTHO_STATEMENT: for (final Statement orthoStmt : orthoStmts) {

            // rule out invalid or non-orthologous statements
            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
                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() == objf) {
                                pnterms.add(obj);
                                pnterms.add(t);
                                pnterms.add(sub);

                                continue ORTHO_STATEMENT;
View Full Code Here

        if (stmt.getRelationshipType() == RelationshipType.ORTHOLOGOUS
                && stmt.getObject() != null
                && stmt.getObject().getTerm() != null) {

            // test subject has only one namespace parameter
            final Term subject = stmt.getSubject();
            List<Parameter> subparams = subject.getParameters();
            if (subparams == null || subparams.size() != 1
                    || subparams.get(0).getNamespace() == null) {
                return false;
            }

            // test object has only one namespace parameter
            final Term object = stmt.getObject().getTerm();
            List<Parameter> objparams = object.getParameters();
            if (objparams == null || objparams.size() != 1
                    || objparams.get(0).getNamespace() == null) {
                return false;
            }
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.