Package org.openbel.framework.common.protonetwork.model

Examples of org.openbel.framework.common.protonetwork.model.SkinnyUUID


                            // 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
View Full Code Here


                    String rl = ns.getResourceLocation();

                    // ... do we have set membership?
                    JDBMEquivalenceLookup jdbmLookup = lookups.get(rl);
                    if (jdbmLookup != null) {
                        SkinnyUUID uuid = jdbmLookup.lookup(val);
                        // Check for set membership, uuid ∊ uuids
                        if (uuids.contains(uuid)) {

                            // This indicates equivalent parameters are being
                            // used by both document and network. This
View Full Code Here

                JDBMEquivalenceLookup jdbmLookup = lookups.get(rl);
                if (jdbmLookup == null) {
                    continue;
                }

                SkinnyUUID uuid = jdbmLookup.lookup(val);
                if (uuid != null) {
                    uuids.add(uuid);
                }
            }
        }

        // Establish set of UUIDs relevant for the proto-network
        Set<SkinnyUUID> pnUUIDs = new HashSet<SkinnyUUID>();
        ParameterTable paramTbl = network.getParameterTable();
        TableParameter[] paramArr = paramTbl.getTableParameterArray();
        for (final TableParameter tp : paramArr) {
            if (!validParameter(tp)) {
                continue;
            }
            TableNamespace namespace = tp.getNamespace();
            String value = tp.getValue();
            String rl = namespace.getResourceLocation();
            JDBMEquivalenceLookup jdbmLookup = lookups.get(rl);
            if (jdbmLookup == null) {
                continue;
            }

            SkinnyUUID uuid = jdbmLookup.lookup(value);
            if (uuid != null) {
                pnUUIDs.add(uuid);
            }
        }

        // Two sets of UUIDs have been established at this point.
        // The first set, uuids, is the set based on the genes.
        // The second set, pnUUIDs, is the set based on the proto-network.

        // Make uuids the intersection of the two: (uuids ∩ pnUUIDs)
        uuids.retainAll(pnUUIDs);

        final Set<Statement> toPrune = new HashSet<Statement>();
        int pruned = 0;

        // Pruning is simply a matter of iterating all statements in genes...
        GENES: for (final Statement stmt : genes) {
            List<Parameter> parameters = stmt.getAllParameters();

            // ... and all parameters in each statement...
            for (final Parameter p : parameters) {
                if (!validParameter(p)) {
                    continue;
                }

                Namespace ns = p.getNamespace();
                String val = p.getValue();
                String rl = ns.getResourceLocation();

                // ... do we have set membership?
                JDBMEquivalenceLookup jdbmLookup = lookups.get(rl);
                if (jdbmLookup == null) {
                    continue;
                }
                SkinnyUUID uuid = jdbmLookup.lookup(val);
                // Check for set membership, uuid ∊ uuids
                if (uuids.contains(uuid)) {

                    // This indicates equivalent parameters are being
                    // used by both document and network. This
View Full Code Here

                JDBMEquivalenceLookup jdbmLookup = lookups.get(rl);
                if (jdbmLookup == null) {
                    continue;
                }

                SkinnyUUID uuid = jdbmLookup.lookup(val);
                if (uuid != null) {
                    uuids.add(uuid);
                }
            }
        }

        // Establish set of UUIDs relevant for the proto-network
        Set<SkinnyUUID> pnUUIDs = new HashSet<SkinnyUUID>();
        ParameterTable paramTbl = network.getParameterTable();
        TableParameter[] paramArr = paramTbl.getTableParameterArray();
        for (final TableParameter tp : paramArr) {
            if (!validParameter(tp)) {
                continue;
            }
            TableNamespace namespace = tp.getNamespace();
            String value = tp.getValue();
            String rl = namespace.getResourceLocation();
            JDBMEquivalenceLookup jdbmLookup = lookups.get(rl);
            if (jdbmLookup == null) {
                continue;
            }

            SkinnyUUID uuid = jdbmLookup.lookup(value);
            if (uuid != null) {
                pnUUIDs.add(uuid);
            }
        }
View Full Code Here

            JDBMEquivalenceLookup jdbmLookup = lookups.get(rl);
            if (jdbmLookup == null) {
                continue;
            }

            SkinnyUUID uuid = jdbmLookup.lookup(val);
            if (uuid != null) {
                uuids.add(uuid);
            }
        }
View Full Code Here

            for (final Integer pid : pids) {
                // find global parameter index for pid
                Integer globalpid = pglob.get(pid);

                // find UUID for global parameter index
                final SkinnyUUID pu = puuid.get(globalpid);

                // save this term to this UUID
                Set<Integer> terms = uuidterms.get(pu);
                if (terms == null) {
                    terms = new HashSet<Integer>();
                    uuidterms.put(pu, terms);
                }
                terms.add(tid);
            }
        }

        // get all statement in orthology document
        final List<Statement> orthoStmts = d.getAllStatements();
        // map them to statement groups for efficient pruning
        Map<StatementGroup, Set<Statement>> orthomap = d.mapStatements();

        // set up pruning result
        int total = orthoStmts.size();
        int pruned = 0;

        // establish cache to skinny uuids to avoid superfluous jdbm lookups
        final Map<Parameter, SkinnyUUID> paramcache = sizedHashMap(total * 2);

        // iterate all statements in the orthology document
        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) {
View Full Code Here

TOP

Related Classes of org.openbel.framework.common.protonetwork.model.SkinnyUUID

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.