Package org.openbel.framework.common.model

Examples of org.openbel.framework.common.model.AnnotationGroup


            throws IOException {
        // 1: comment, may be null
        String comment = stmt.getComment();
        writeObject(out, comment);
        // 2: annotation group, may be null
        AnnotationGroup ag = stmt.getAnnotationGroup();
        writeObject(out, ag);
        // 3: subject term, never null
        Term subject = stmt.getSubject();
        writeTerm(out, subject);
View Full Code Here


    static Statement readStatement(ObjectInput in) throws IOException,
            ClassNotFoundException {
        // 1: comment
        String comment = (String) readObject(in);
        // 2: annotation group
        AnnotationGroup ag = (AnnotationGroup) readObject(in);
        // 3: subject term
        Term subject = readTerm(in);

        // 4: statement object
        Statement.Object object;
View Full Code Here

     * Attach citation for expansion rule
     *
     * @param statement {@link Statement}
     */
    protected void attachExpansionRuleCitation(Statement statement) {
        AnnotationGroup ag = new AnnotationGroup();
        Citation citation = getInstance().createCitation(getName());
        citation.setType(CitationType.OTHER);
        citation.setReference(getName());
        ag.setCitation(citation);
        statement.setAnnotationGroup(ag);
    }
View Full Code Here

                        asList("9606"));
        AnnotationDefinition tissueDefinition =
                new AnnotationDefinition("tissue", "Description", "Usage",
                        asList("TH1", "TH2", "AB3"));

        AnnotationGroup annotationGroup = new AnnotationGroup();
        annotationGroup.setAnnotations(asList(
                CommonModelFactory.getInstance().createAnnotation("9606",
                        speciesDefinition),
                CommonModelFactory.getInstance().createAnnotation("9606",
                        tissueDefinition)));
        annotationGroup
                .setEvidence(CommonModelFactory
                        .getInstance()
                        .createEvidence(
                                "the elevation of intracellular cAMP concentration that results from increased glucagon production also plays a role in the down-regulation process"));
View Full Code Here

        }

        BELCitation bc = bs.getCitation();
        BELEvidence be = bs.getEvidence();

        AnnotationGroup ag = new AnnotationGroup();
        boolean hasAnnotation = false;
        if (hasItems(alist)) {
            ag.setAnnotations(alist);
            hasAnnotation = true;
        }

        if (bc != null) {
            ag.setCitation(bcc.convert(bc));
            hasAnnotation = true;
        }

        if (be != null) {
            ag.setEvidence(bec.convert(be));
            hasAnnotation = true;
        }

        if (hasAnnotation) {
            s.setAnnotationGroup(ag);
View Full Code Here

        if (source == null) return null;

        List<Object> list = source.getAnnotationOrEvidenceOrCitation();

        // Destination type
        AnnotationGroup dest = new AnnotationGroup();

        // Capture XBELCitation elements of list as a new list
        List<XBELCitation> l1 = listCapture(list, XBELCitation.class);
        List<Citation> l2 = new ArrayList<Citation>();

        CitationConverter cConverter = new CitationConverter();
        for (final XBELCitation xc : l1) {
            // Defer to CitationConverter
            l2.add(cConverter.convert(xc));
        }
        if (!l2.isEmpty()) {
            dest.setCitation(l2.get(0));
        }

        // Capture XBELAnnotation elements of list as a new list
        List<XBELAnnotation> l3 = listCapture(list, XBELAnnotation.class);
        List<Annotation> l4 = new ArrayList<Annotation>();

        AnnotationConverter aConverter = new AnnotationConverter();
        for (final XBELAnnotation xa : l3) {
            // Defer to AnnotationConverter
            l4.add(aConverter.convert(xa));
        }
        dest.setAnnotations(l4);

        // Capture evidence strings of list as a new list
        List<String> l5 = listCapture(list, String.class);
        List<Evidence> l6 = new ArrayList<Evidence>();

        for (final String str : l5) {
            l6.add(CommonModelFactory.getInstance().createEvidence(str));
        }
        if (!l6.isEmpty()) {
            dest.setEvidence(l6.get(0));
        }

        return dest;
    }
View Full Code Here

        XBELSubject xs = new XBELSubject();
        // Defer to TermConverter
        xs.setTerm(tConverter.convert(subject));
        xstmt.setSubject(xs);

        AnnotationGroup ag = source.getAnnotationGroup();
        AnnotationGroupConverter agConverter = new AnnotationGroupConverter();
        // Defer to AnnotationGroupConverter
        xstmt.setAnnotationGroup(agConverter.convert(ag));

        String comment = source.getComment();
View Full Code Here

        StatementGroup dest = new StatementGroup();

        XBELAnnotationGroup annotationGroup = source.getAnnotationGroup();
        AnnotationGroupConverter agConverter = new AnnotationGroupConverter();
        // Defer to AnnotationGroupConverter
        AnnotationGroup ag = agConverter.convert(annotationGroup);
        dest.setAnnotationGroup(ag);

        String name = source.getName();
        dest.setName(name);
View Full Code Here

    public XBELStatementGroup convert(StatementGroup source) {
        if (source == null) return null;

        XBELStatementGroup xsg = new XBELStatementGroup();

        AnnotationGroup ag = source.getAnnotationGroup();
        AnnotationGroupConverter agConverter = new AnnotationGroupConverter();
        // Defer to AnnotationGroupConverter
        XBELAnnotationGroup xag = agConverter.convert(ag);
        xsg.setAnnotationGroup(xag);
View Full Code Here

TOP

Related Classes of org.openbel.framework.common.model.AnnotationGroup

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.