Examples of KamFilter


Examples of org.openbel.framework.api.internal.KAMCatalogDao.KamFilter

    }

    private Collection<KamEdge> filterEdges(final KAMStore kAMStore,
            final Kam kam, final String annotationName)
            throws KAMStoreException {
        KamFilter filter = kam.getKamInfo().createKamFilter();
        AnnotationFilterCriteria criteria =
                new AnnotationFilterCriteria(getAnnotationType(kAMStore, kam,
                        annotationName));
        criteria.add(RANDOM_VALUE);
        criteria.setInclude(false);
        filter.add(criteria);
        Kam filteredKam = kAMStore.getKam(kam.getKamInfo(), filter);
        return filteredKam.getEdges();
    }
View Full Code Here

Examples of org.openbel.framework.api.internal.KAMCatalogDao.KamFilter

    @Test
    public void testGetKamWithAnnotationFilter() throws SQLException,
            InstantiationException, IllegalAccessException,
            IllegalArgumentException, InvocationTargetException {
        KamInfo kamInfo = testKam.getKamInfo();
        KamFilter filter = kamInfo.createKamFilter();

        AnnotationType[] types = new AnnotationType[] {
                annotationType.newInstance(
                        14, "HemicAndImmuneSystem", null, null, AnnotationDefinitionType.URL,
                        "http://resource.belframework.org/belframework/1.0/annotation/mesh-hemic-and-immune-system.belanno"),
                annotationType.newInstance(
                        9, "UrogenitalSystem", null, null, AnnotationDefinitionType.URL,
                        "http://resource.belframework.org/belframework/1.0/annotation/mesh-urogenital-system.belanno")
        };

        AnnotationFilterCriteria ac1 = new AnnotationFilterCriteria(types[0]),
                ac2 = new AnnotationFilterCriteria(types[1]);

        ac1.add("Hematopoietic Stem Cells");
        ac1.add("Blood");
        ac1.add("Macrophages");
        ac1.add("Monocytes");

        ac2.add("Urinary Bladder");

        ac1.setInclude(true);
        ac2.setInclude(false);

        filter.add(ac1);
        filter.add(ac2);

        testSameResultAsPreviousImplementation(filter);
    }
View Full Code Here

Examples of org.openbel.framework.api.internal.KAMCatalogDao.KamFilter

    @Test
    public void testGetKamWithOppositeFiltersReturnsNothing()
            throws SQLException {
        KamInfo kamInfo = testKam.getKamInfo();
        KamFilter kamFilter = kamInfo.createKamFilter();

        RelationshipTypeFilterCriteria c1 = new RelationshipTypeFilterCriteria(),
                c2 = new RelationshipTypeFilterCriteria();
        c1.add(RelationshipType.INCREASES);
        c2.add(RelationshipType.DECREASES);
        kamFilter.add(c1);
        kamFilter.add(c2);

        KamProtoNodesAndEdges all = dao.getKamProtoNodesAndEdges(kamInfo, kamFilter);
        Map<Integer, KamProtoNode> nodes = all.getKamProtoNodes();
        Map<Integer, KamProtoEdge> edges = all.getKamProtoEdges();
View Full Code Here

Examples of org.openbel.framework.api.internal.KAMCatalogDao.KamFilter

    @Test
    public void testGetKamIsCorrect() throws IllegalAccessException,
            IllegalArgumentException, InvocationTargetException,
            InstantiationException, SQLException, ParseException {
        KamFilter f = testKam.getKamInfo().createKamFilter();

        RelationshipTypeFilterCriteria r = new RelationshipTypeFilterCriteria();
        r.add(RelationshipType.ANALOGOUS);
        r.add(RelationshipType.INCLUDES);
        r.add(RelationshipType.INCREASES);
        r.setInclude(false);

        CitationFilterCriteria c = new CitationFilterCriteria();
        Citation[] citations = new Citation[] {
                citation.newInstance(
                        "Trends in molecular medicine", "12928037", "", null,
                        Arrays.asList(StringUtils.split("de Nigris F|Lerman A|Ignarro LJ|Williams-Ignarro S|Sica V|Baker AH|Lerman LO|Geng YJ|Napoli C", '|')),
                        CitationType.PUBMED),
                citation.newInstance(
                        "Cell", "16962653", "", dateFormat.parse("2006-10-07"),
                        Arrays.asList(StringUtils.split("Jacinto E|Facchinetti V|Liu D|Soto N|Wei S|Jung SY|Huang Q|Qin J|Su B", '|')),
                        CitationType.PUBMED),
                citation.newInstance(
                        "Trends in molecular medicine", "15350900", "", null,
                        Arrays.asList(StringUtils.split("Barry RE|Krek W", '|')),
                        CitationType.PUBMED),
                citation.newInstance(
                        "Journal of clinical oncology : official journal of the American Society of Clinical Oncology",
                        "16170185", "", null,
                        Arrays.asList(StringUtils.split("Beeram M|Patnaik A|Rowinsky EK", '|')),
                        CitationType.PUBMED),
                citation.newInstance(
                        "The Biochemical journal", "12444918", "", null,
                        Arrays.asList(StringUtils.split("Houslay MD|Adams DR", '|')),
                        CitationType.PUBMED)
        };
        for (Citation cit : citations) {
            c.add(cit);
        }

        f.add(r);
        f.add(c);
        testSameResultAsPreviousImplementation(f);
    }
View Full Code Here

Examples of org.openbel.framework.api.internal.KAMCatalogDao.KamFilter

        }
    }

    private void testIdempotency(FilterCriteria c) throws SQLException {
        KamInfo kamInfo = testKam.getKamInfo();
        KamFilter f = kamInfo.createKamFilter(),
                f2 = kamInfo.createKamFilter();

        addFilterCriteria(f, c);
        addFilterCriteria(f2, c);
        addFilterCriteria(f2, c);
View Full Code Here

Examples of org.openbel.framework.api.internal.KAMCatalogDao.KamFilter

    }

    private void testCommutativity(FilterCriteria a, FilterCriteria b)
            throws SQLException {
        KamInfo kamInfo = testKam.getKamInfo();
        KamFilter ab = kamInfo.createKamFilter(),
                ba = kamInfo.createKamFilter();

        addFilterCriteria(ab, a);
        addFilterCriteria(ab, b);
        addFilterCriteria(ba, b);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.