Examples of Kam


Examples of org.openbel.framework.api.Kam

                || collapsing.getKam() != collapseTo.getKam())
            throw new InvalidArgument("nodes reference invalid kams");
        if (collapsing.getId() == null || collapseTo.getId() == null)
            throw new InvalidArgument("node id is null");

        Kam kam = collapsing.getKam();

        PreparedStatement esps = getPreparedStatement(UPDATE_KAM_EDGES_SOURCE);
        PreparedStatement etps = getPreparedStatement(UPDATE_KAM_EDGES_TARGET);
        remapEdges(collapsing, collapseTo, kam, esps, etps);
View Full Code Here

Examples of org.openbel.framework.api.Kam

        final int maxSearchDepth = request.getMaxDepth();

        // Get the Dialect (may be null)
        final Dialect dialect = getDialect(request.getDialect());

        Kam kam;
        try {
            // read kam from first source node
            kam =
                    lookupKam(sources.get(0), dialect,
                            "Error retreving KAM associated with node");
View Full Code Here

Examples of org.openbel.framework.api.Kam

        final int maxSearchDepth = request.getMaxDepth();

        // Get the Dialect (may be null)
        final Dialect dialect = getDialect(request.getDialect());

        Kam kam;
        try {
            // read kam from first source node
            kam =
                    lookupKam(sources.get(0), dialect,
                            "Error retreving KAM associated with node");
View Full Code Here

Examples of org.openbel.framework.api.Kam

        final int maxSearchDepth = request.getMaxDepth();

        // Get the Dialect (may be null)
        final Dialect dialect = getDialect(request.getDialect());

        Kam kam;
        try {
            // read kam from first source node
            kam =
                    lookupKam(sources.get(0), dialect,
                            "Error retreving KAM associated with node");
View Full Code Here

Examples of org.openbel.framework.api.Kam

            throw new RequestException(errorMsg, e);
        }
        if (kamInfo == null) {
            throw new InvalidIdException(kamNodeRef.getEncodedString());
        }
        final Kam kam = kamCacheService.getKam(kamInfo.getName());
        if (kam == null) {
            throw new InvalidIdException(kamNodeRef.getEncodedString());
        }
        return kam;
    }
View Full Code Here

Examples of org.openbel.framework.api.Kam

        if (request == null) {
            throw new MissingRequest(GET_DEFAULT_DIALECT_REQUEST);
        }

        Kam kam = kamCache.getKam(request.getKam().getHandle());
        if (kam == null) {
            throw new RequestException("Invalid KamHandle: "
                    + request.getKam().getHandle());
        }

        Dialect d = dialectFactory.createDefaultDialect(kam.getKamInfo());

        GetDefaultDialectResponse resp =
                OBJECT_FACTORY.createGetDefaultDialectResponse();
        DialectHandle dh = OBJECT_FACTORY.createDialectHandle();
        dh.setHandle(dialectService.cacheDialect(d));
View Full Code Here

Examples of org.openbel.framework.api.Kam

        if (request == null) {
            throw new MissingRequest(GET_CUSTOM_DIALECT_REQUEST);
        }

        Kam kam = kamCache.getKam(request.getKam().getHandle());
        if (kam == null) {
            throw new RequestException("Invalid KamHandle: "
                    + request.getKam().getHandle());
        }

        List<Namespace> geneNamespaces = convert(request.getGeneNamespaces());
        List<Namespace> bpNamespaces = convert(request.getBpNamespaces());
        List<Namespace> chemNamespaces = convert(request.getChemNamespaces());

        Dialect d;
        try {
            d =
                    dialectFactory.createCustomDialect(kam.getKamInfo(),
                            geneNamespaces, bpNamespaces, chemNamespaces,
                            Converter.convert(request.getSyntax()),
                            request.isHideNamespacePrefixes());
        } catch (KAMStoreException e) {
            throw new RequestException("Failed to construct dialect", e);
View Full Code Here

Examples of org.openbel.framework.api.Kam

                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.Kam

            String fmt = "Orthologizing kam \"%s\".";
            reportable.output(format(fmt, kamName));
        }

        // run orthologize
        Kam kam = kam(kamName);
        KamInfo info = kam.getKamInfo();
        KAMStore kamstore = kamstore();
        Orthologize ortho = new DefaultOrthologize();
        SpeciesDialect dialect = dialect(taxId, info, kamstore);
        OrthologizedKam orthokam = ortho.orthologize(kam, kamstore, dialect);

        // remap collapsing nodes
        kam = kam(kamName);
        info = kam.getKamInfo();
        Map<KamNode, KamNode> collapsed = orthokam.getCollapsedNodes();
        Set<Entry<KamNode, KamNode>> set = collapsed.entrySet();
        for (Entry<KamNode, KamNode> e : set) {
            KamNode collapsing = e.getKey();
            KamNode collapseTo = e.getValue();

            collapsing = kam.findNode(collapsing.getId());
            collapseTo = kam.findNode(collapseTo.getId());
            kamstore.collapseKamNode(info, collapsing, collapseTo);
        }

        // remove orthologous edges/statements
        kamstore.removeKamEdges(info, ORTHOLOGOUS);
View Full Code Here

Examples of org.openbel.framework.api.Kam

            final ExportFormat exportFormat,
            final boolean noPreserve) {
        if (kamName == null) {
            return;
        }
        final Kam kam;

        try {
            setUp();
            kam = kAMStore.getKam(kamName);

            // establish a default if output path is not set
            if (outputFilename == null) {
                outputFilename =
                        kam.getKamInfo().getName()
                                + defaultExtension(exportFormat);
            }

            if (!noPreserve && new File(outputFilename).exists()) {
                teardown();
                fatal("File '" + outputFilename + "' exists, specify --"
                        + LONG_OPT_NO_PRESERVE + " to override.");
            }

            final String formatString;
            if (exportFormat == ExportFormat.XGMML) {
                formatString = "XGMML";
                XGMMLExporter.exportKam(kam, kAMStore, outputFilename);
            } else if (exportFormat == ExportFormat.RDF) {
                formatString = "RDF";
                RDFExporter.exportRdf(kam, kAMStore.getKamInfo(kamName),
                        kAMStore, outputFilename);
            } else if (exportFormat == ExportFormat.PORTABLE_KAM) {
                formatString = "portable";
                pkamService.serializeKAM(kamName, outputFilename);
            } else {
                throw new UnsupportedOperationException(exportFormat.toString()
                        + " is not supported.");
            }

            if (!quiet) {
                reportable.output(format(
                        "Exported '%s' KAM to %s format in '%s'.",
                        kam.getKamInfo().getName(), formatString,
                        outputFilename));
            }
        } catch (PKAMSerializationFailure e) {
            reportable.error(e.getUserFacingMessage());
        } catch (KAMStoreException e) {
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.