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

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


    private int process() {
        int equivalences = 0;

        // Establish access to all the necessary proto-network parts
        final ParameterTable pt = network.getParameterTable();
        final TableParameter[] params = pt.getTableParameterArray();
        final Map<TableParameter, Integer> tpIdx = pt.getTableParameterIndex();

        // Get the global index, clear it, and mark the baseline global index
        final Map<Integer, Integer> globalIndex = pt.getGlobalIndex();
        final Map<Integer, SkinnyUUID> globalUUIDs = pt.getGlobalUUIDs();
        globalIndex.clear();
        globalUUIDs.clear();
        int gi = 0;

        // Map UUID strings to global index (inverse of globalUUIDs)
View Full Code Here


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

     * @throws Exception
     */
    @Test
    public void validateGlobalUUIDs() throws Exception {
        be.equivalence();
        ParameterTable pt = pn.getParameterTable();
        TableParameter[] tpa = pt.getTableParameterArray();
        int j = 0; // idx to lookup UUIDs from list
        for (int i = 0; i < tpa.length; i = i + 2) { // increment for each pair of equivalent term params
            TableParameter tp1 = tpa[i];
            TableParameter tp2 = tpa[i + 1];
            Integer idx1 = pt.getTableParameterIndex().get(tp1);
            Integer idx2 = pt.getTableParameterIndex().get(tp2);
            Integer gi1 = pt.getGlobalIndex().get(idx1);
            Integer gi2 = pt.getGlobalIndex().get(idx2);
            Assert.assertEquals("Global ID for indices " + i + "and " + (i + 1)
                    + " failed equality", gi1, gi2);
            Assert.assertEquals("Global UUID for indices " + i + "and "
                    + (i + 1) + " failed equality", uuids.get(j++), pt
                    .getGlobalUUIDs().get(gi1));
        }
    }
View Full Code Here

                new ProtoNetworkBuilder(document);
        ProtoNetwork protoNetwork = protoNetworkBuilder.buildProtoNetwork();

        //Test extracted symbols
        NamespaceTable namespaceTable = protoNetwork.getNamespaceTable();
        ParameterTable parameterTable = protoNetwork.getParameterTable();
        TermTable termTable = protoNetwork.getTermTable();
        Namespace hgncNs =
                new Namespace(
                        "HGNC",
                        "http://resource.belframework.org/belframework/1.0/ns/hgnc-approved-symbols.belns");

        //check eg default namespace and hgnc specified namespace
        assertEquals(3, namespaceTable.getNamespaces().size());
        assertEquals(11, parameterTable.getTableParameters().size());

        assertEquals(9, termTable.getTermValues().size());
        assertTrue(parameterTable.getTableParameters().contains(
                new TableParameter(new TableNamespace(hgncNs), "AIFM1")));
        assertTrue(termTable.getTermValues().contains("proteinAbundance(#)"));
        assertTrue(termTable.getTermValues().contains("geneAbundance(#)"));

        //Test extracted statements
View Full Code Here

            }
        }

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

            }
        }

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

        // An initial capacity would be ideal for this set, but we don't
        // have any reasonable estimations.
        ret = new HashSet<TableEntry>();

        // Establish access to the relevant table objects
        final ParameterTable paramTbl = pn.getParameterTable();
        final TermTable termTbl = pn.getTermTable();
        final List<String> terms = termTbl.getTermValues();
        final NamespaceTable nsTbl = pn.getNamespaceTable();

        final int[][] indata = pn.getTermIndices();

        final Set<String> literalSet = constrainedHashSet(literals.length);
        for (final String s : literals) {
            literalSet.add(s);
        }

        // Search indata for elements of the term literal set
        for (int i = 0; i < indata.length; i++) {
            int tid = indata[i][TERM_INDEX];
            String string = terms.get(tid);
            if (!literalSet.contains(string)) {
                continue;
            }

            int pid = indata[i][PARAM_INDEX];
            final TableParameter tp = paramTbl.getTableParameter(pid);

            final String inval = tp.getValue();
            int nid = indata[i][NAMESPACE_INDEX];

            final TableNamespace tns = nsTbl.getTableNamespace(nid);
View Full Code Here

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

TOP

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

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.