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

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


    /**
     * {@inheritDoc}
     */
    @Override
    public int equivalence() {
        ProtoNodeTable pnt = network.getProtoNodeTable();
        ProtoEdgeTable pet = network.getProtoEdgeTable();

        List<TableProtoEdge> edges = pet.getProtoEdges();
        Map<Integer, Set<Integer>> edgeStmts = pet.getEdgeStatements();
        Map<Integer, Integer> eqn = pnt.getEquivalences();
        Map<Integer, Integer> eqe = pet.getEquivalences();

        return equivalenceInternal(edges, edgeStmts, eqn, eqe);
    }
View Full Code Here


     * {@code pnb} is {@code null}
     */
    private int createNode(final Term term, final int supporting,
            final ProtoNetwork pn, final ProtoNetworkBuilder pnb) {
        final TermTable tt = pn.getTermTable();
        final ProtoNodeTable pnt = pn.getProtoNodeTable();

        int subIndex = pnb.buildProtoNetwork(pn, term);
        String subLbl = tt.getTermValues().get(subIndex);
        return pnt.addNode(subIndex, subLbl);
    }
View Full Code Here

     */
    private void remapEdges(ProtoNetwork protoNetwork1,
            ProtoNetwork protoNetwork2, int documentId,
            Map<Integer, Integer> termMap, int newStatementIndex,
            List<TableProtoEdge> edges, Set<Integer> edgeIndices) {
        ProtoNodeTable nt = protoNetwork2.getProtoNodeTable();
        Map<Integer, Integer> nodeTermIndex = nt.getNodeTermIndex();

        TableProtoEdge[] remappedEdges = new TableProtoEdge[edgeIndices.size()];
        int i = 0;
        for (Integer edgeIndex : edgeIndices) {
            TableProtoEdge edge = edges.get(edgeIndex);
View Full Code Here

        // 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);
        return newTermIndex;
    }
View Full Code Here

TOP

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

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.