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

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


     */
    private Integer mergeTerm(Integer termId, ProtoNetwork protoNetwork1,
            ProtoNetwork protoNetwork2, int documentId,
            Map<Integer, Integer> termMap) {
        TermTable termTable = protoNetwork2.getTermTable();
        TermParameterMapTable mapTable =
                protoNetwork2.getTermParameterMapTable();
        ParameterTable parameterTable = protoNetwork2.getParameterTable();

        Term termToMerge = termTable.getIndexedTerms().get(termId);

        // tables for proto network we're merging into (1)
        final TermTable mtt = protoNetwork1.getTermTable();
        final ParameterTable mpt = protoNetwork1.getParameterTable();
        final TermParameterMapTable mtpmt =
                protoNetwork1.getTermParameterMapTable();
        final ProtoNodeTable mpnt = protoNetwork1.getProtoNodeTable();

        // if p1 contains an equivalent Term then return it's inndex without
        // adding a new one.
        Integer p1Index = mtt.getVisitedTerms().get(termToMerge);
        if (p1Index != null) {
            termMap.put(termId, p1Index);
            return p1Index;
        }

        List<Integer> newTermParameterIndices = new ArrayList<Integer>();
        List<Integer> termParameterIndices = mapTable.getTermParameterIndex()
                .get(termId);

        if (hasItems(termParameterIndices)) {
            for (Integer termParameterIndex : termParameterIndices) {
                TableParameter parameter = parameterTable.
                        getIndexTableParameter().get(termParameterIndex);
                newTermParameterIndices.add(mpt
                        .addTableParameter(parameter));
            }
        }

        Integer newTermIndex = mtt.addTerm(termToMerge);
        mtpmt.addTermParameterMapping(
                newTermIndex, newTermParameterIndices);

        Integer newNode = mpnt.addNode(newTermIndex, mtt.getTermValues().get(newTermIndex));

        termMap.put(termId, newNode);
View Full Code Here


        //      -   find object parameter's uuid in a proto network term, if found
        //          continue (orthologous statement intersects the proto network)

        // 1. Map parameter UUIDs to containing term ids in the proto network
        final TermTable tt = pn.getTermTable();
        final TermParameterMapTable tpmt = pn.getTermParameterMapTable();
        final ParameterTable pt = pn.getParameterTable();
        final Map<Integer, Integer> pglob = pt.getGlobalIndex();
        final Map<Integer, SkinnyUUID> puuid = pt.getGlobalUUIDs();
        final Set<Integer> tidset = tt.getIndexedTerms().keySet();
        final Map<SkinnyUUID, Set<Integer>> uuidterms = sizedHashMap(puuid
                .size());
        final Set<Term> pnterms = new HashSet<Term>(tt.getVisitedTerms().keySet());
        // for each term
        for (final Integer tid : tidset) {
            // get its parameters
            final List<Integer> pids = tpmt.getParameterIndexes(tid);
            for (final Integer pid : pids) {
                // find global parameter index for pid
                Integer globalpid = pglob.get(pid);

                // find UUID for global parameter index
View Full Code Here

TOP

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

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.