@Override protected CvTerm extractInteractionDetectionMethodFrom(InteractionEvidence interaction) { return interaction.getExperiment() != null ? interaction.getExperiment().getInteractionDetectionMethod() : null; } }
public void onExperimentUpdate(InteractionEvidence interaction, Experiment oldExperiment) { if (oldExperiment == null){ interactionEvidenceChangeLogger.log(Level.INFO, "The experiment has been initialised for the interaction " + interaction.toString()); } else if (interaction.getExperiment() == null){ interactionEvidenceChangeLogger.log(Level.INFO, "The experiment has been reset for the interaction " + interaction.toString()); } else { interactionEvidenceChangeLogger.log(Level.INFO, "The experiment " + oldExperiment + " has been updated with " + interaction.getExperiment() + " in the interaction " + interaction.toString()); } }
public Experiment getExperiment() { return getWrappedInteraction().getExperiment(); }
@Override public Collection<ValidatorMessage> check(InteractionEvidence interactionEvidence) throws ValidatorException { if (interactionEvidence.getExperiment() == null){ // list of messages to return MiContext interactionContext = RuleUtils.buildContext(interactionEvidence, "interaction"); return Collections.singletonList(new ValidatorMessage("Interaction evidences must have an experiment.'", MessageLevel.ERROR, interactionContext, this)); } return Collections.EMPTY_LIST; }
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); } } }
if (interaction.getExperiment() != null) { final Collection<Annotation> expAtts = AnnotationUtils.collectAllAnnotationsHavingTopic( interaction.getExperiment().getAnnotations(), CONFIDENCE_MAPPING_MI_REF, CONFIDENCE_MAPPING); if( interaction.getExperiment() != null) { final Collection<Annotation> expAtts = AnnotationUtils.collectAllAnnotationsHavingTopic( interaction.getExperiment().getAnnotations(), CONFIDENCE_MAPPING_MI_REF, CONFIDENCE_MAPPING);
Experiment exp1 = experimentalInteraction1.getExperiment(); Experiment exp2 = experimentalInteraction2.getExperiment();
/** * For each experiment associated with this interaction, collect all respective participants and their identification method and * check if the dependencies are correct. * * @param participant a participant to check on. * @return a collection of validator messages. * if we fail to retreive the MI Ontology. */ public Collection<ValidatorMessage> check( ParticipantEvidence participant ) throws ValidatorException { Collection<ValidatorMessage> messages = Collections.EMPTY_LIST; if (participant.getInteraction() != null){ InteractionEvidence interaction = participant.getInteraction(); Experiment exp = interaction.getExperiment(); if (exp != null){ CvTerm detMethod = exp.getInteractionDetectionMethod(); if (detMethod != null){ if (!participant.getIdentificationMethods().isEmpty()){ messages = new ArrayList<ValidatorMessage>(participant.getIdentificationMethods().size()); for (CvTerm method : participant.getIdentificationMethods()){ // build a context in case of error MiContext context = RuleUtils.buildContext(participant, "participant"); context.addAssociatedContext(RuleUtils.buildContext(exp, "experiment")); messages.addAll( mapping.check( detMethod, method, context, this ) ); } } } } } return messages; }
Experiment exp1 = experimentalInteraction1.getExperiment(); Experiment exp2 = experimentalInteraction2.getExperiment();
Experiment exp1 = experimentalInteraction1.getExperiment(); Experiment exp2 = experimentalInteraction2.getExperiment();
Experiment exp1 = experimentalInteraction1.getExperiment(); Experiment exp2 = experimentalInteraction2.getExperiment();
if (interaction.getExperiment() != null){ Experiment exp = interaction.getExperiment(); if (exp.getPublication() != null){ Publication pub = exp.getPublication();
if (source != null && target != null){ target.setAvailability(source.getAvailability()); target.setExperiment(source.getExperiment()); target.setInferred(source.isInferred()); target.setCreatedDate(source.getCreatedDate());
/** * For each experiment associated with this interaction, collect all respective participants, host organisms and * check if the dependencies are correct. * * @param interaction an interaction to check on. * @return a collection of validator messages. * if we fail to retreive the MI Ontology. */ public Collection<ValidatorMessage> check( InteractionEvidence interaction ) throws ValidatorException { Collection<ValidatorMessage> messages = Collections.EMPTY_LIST; // experiments for detecting the interaction final Experiment experiment = interaction.getExperiment(); // participants of the interaction final Collection<ParticipantEvidence> participants = interaction.getParticipants(); // number of participants final int numberParticipants = participants.size(); final CvTerm interactionType = interaction.getInteractionType(); if (experiment != null){ // build a context in case of error MiContext context = RuleUtils.buildContext(interaction, "interaction"); context.addAssociatedContext(RuleUtils.buildContext(experiment, "experiment")); final CvTerm method = experiment.getInteractionDetectionMethod(); final Organism hostOrganism = experiment.getHostOrganism(); int numberOfBaits = getNumberOfParticipantWithExperimentalRole(participants, RuleUtils.BAIT_MI_REF, "bait"); int numberOfPreys = getNumberOfParticipantWithExperimentalRole(participants, RuleUtils.PREY_MI_REF, "prey"); messages = mapping.check( method, interactionType, hostOrganism, numberParticipants, numberOfBaits, numberOfPreys, context, this ); } return messages; }
/** * For each experiment associated with this interaction, collect all respective participants and their biological roles and * check if the dependencies are correct. * * @param participant a participant to check on. * @return a collection of validator messages. * if we fail to retreive the MI Ontology. */ public Collection<ValidatorMessage> check( ParticipantEvidence participant ) throws ValidatorException { Collection<ValidatorMessage> messages = Collections.EMPTY_LIST; CvTerm biolRole = participant.getBiologicalRole(); if (participant.getInteraction() != null){ InteractionEvidence interaction = participant.getInteraction(); Experiment exp = interaction.getExperiment(); if (exp != null){ CvTerm method = exp.getInteractionDetectionMethod(); // build a context in case of error MiContext context = RuleUtils.buildContext(participant, "participant"); context.addAssociatedContext(RuleUtils.buildContext(exp, "experiment")); messages=mapping.check( method, biolRole, context, this ); } } return messages; }
/** * For each experiment associated with this interaction, collect all respective participants and their experimental roles and * check if the dependencies are correct. * * @param participant a participant to check on. * @return a collection of validator messages. * if we fail to retreive the MI Ontology. */ public Collection<ValidatorMessage> check( ParticipantEvidence participant ) throws ValidatorException { Collection<ValidatorMessage> messages = Collections.EMPTY_LIST; CvTerm role = participant.getExperimentalRole(); if (participant.getInteraction() != null){ InteractionEvidence interaction = participant.getInteraction(); Experiment exp = interaction.getExperiment(); if (exp != null){ // build a context in case of error MiContext context = RuleUtils.buildContext(participant, "participant"); context.addAssociatedContext(RuleUtils.buildContext(exp, "experiment")); final CvTerm method = exp.getInteractionDetectionMethod(); messages=mapping.check( method, role, context, this ); } } return messages; }
Experiment exp1 = experimentalInteraction1.getExperiment(); Experiment exp2 = experimentalInteraction2.getExperiment();
Experiment exp = interaction.getExperiment(); if (exp != null && this.processObjects.add(exp)){ checkExperiment(messages, exp);
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(); if (experiment != null){ MIJsonUtils.writeSeparator(this.writer);