@Override public Collection<ValidatorMessage> check(InteractionEvidence interaction) throws ValidatorException { Collection<ValidatorMessage> messages = Collections.EMPTY_LIST; if (!interaction.getAnnotations().isEmpty()){ Collection<Annotation> attributes = interaction.getAnnotations(); if (AnnotationUtils.collectAllAnnotationsHavingTopic(attributes, Annotation.FIGURE_LEGEND_MI, Annotation.FIGURE_LEGEND).isEmpty()){ MiContext context = RuleUtils.buildContext(interaction, "interaction"); messages=Collections.singleton( new ValidatorMessage( "Interaction with "+attributes.size()+" annotations but without a figure legend. A figure legend is recommended by IMEx.'", MessageLevel.WARN, context, this ) ); } } else { MiContext context = RuleUtils.buildContext(interaction, "interaction"); messages=Collections.singleton(new ValidatorMessage("Interaction without a figure legend. A figure legend is recommended by IMEx.'", MessageLevel.WARN, context, this)); } return messages; }
protected void initialiseInteractionAnnotations(Collection<MitabAnnotation> annots, T interaction){ Iterator<MitabAnnotation> annotsIterator = annots.iterator(); while (annotsIterator.hasNext()){ MitabAnnotation annot = annotsIterator.next(); // add curation depth if (AnnotationUtils.doesAnnotationHaveTopic(annot, Annotation.IMEX_CURATION_MI, Annotation.IMEX_CURATION)){ interaction.getExperiment().getPublication().setCurationDepth(CurationDepth.IMEx); } else if (AnnotationUtils.doesAnnotationHaveTopic(annot, Annotation.MIMIX_CURATION_MI, Annotation.MIMIX_CURATION)){ interaction.getExperiment().getPublication().setCurationDepth(CurationDepth.MIMIx); } else if (AnnotationUtils.doesAnnotationHaveTopic(annot, Annotation.RAPID_CURATION_MI, Annotation.RAPID_CURATION)){ interaction.getExperiment().getPublication().setCurationDepth(CurationDepth.rapid_curation); } else{ interaction.getAnnotations().add(annot); } } }
final Collection<Annotation> atts = AnnotationUtils.collectAllAnnotationsHavingTopic(interaction.getAnnotations(), AUTHOR_CONFIDENCE_MI_REF, AUTHOR_CONFIDENCE);
target.getAnnotations().clear(); target.getAnnotations().addAll(source.getAnnotations()); target.getChecksums().clear(); target.getChecksums().addAll(source.getChecksums());
for (Annotation a : interaction.getAnnotations()){ checkAnnotation(messages, a, interaction, "interaction");
public void write(InteractionEvidence object) throws IOException { Collection<Annotation> figures = AnnotationUtils.collectAllAnnotationsHavingTopic(object.getAnnotations(), Annotation.FIGURE_LEGEND_MI, Annotation.FIGURE_LEGEND); Experiment experiment = object.getExperiment();