public void onInteractionDetectionMethodUpdate(Experiment experiment, CvTerm oldCv) { if (oldCv == null){ experimentChangeLogger.log(Level.INFO, "The interaction detection method has been initialised for the experiment " + experiment.toString()); } else if (experiment.getInteractionDetectionMethod() == null){ experimentChangeLogger.log(Level.INFO, "The interaction detection method has been reset for the experiment " + experiment.toString()); } else { experimentChangeLogger.log(Level.INFO, "The interaction detection method " + oldCv + " has been updated with " + experiment.getInteractionDetectionMethod() + " in the experiment " + experiment.toString()); } }
@Override protected CvTerm extractInteractionDetectionMethodFrom(InteractionEvidence interaction) { return interaction.getExperiment() != null ? interaction.getExperiment().getInteractionDetectionMethod() : null; } }
public void writeInteractionDetectionMethod(BinaryInteractionEvidence interaction) throws IOException { Experiment experiment = interaction.getExperiment(); if (experiment != null){ writeCvTerm(experiment.getInteractionDetectionMethod()); } else{ getWriter().write(MitabUtils.EMPTY_COLUMN); } }
CvTerm detMethod1 = experiment1.getInteractionDetectionMethod(); CvTerm detMethod2 = experiment2.getInteractionDetectionMethod();
CvTerm detMethod1 = experiment1.getInteractionDetectionMethod(); CvTerm detMethod2 = experiment2.getInteractionDetectionMethod();
CvTerm detMethod1 = experiment1.getInteractionDetectionMethod(); CvTerm detMethod2 = experiment2.getInteractionDetectionMethod();
/*** * This method will copy properties of experiment source in experiment target and will override all the other properties of Target experiment. * This method will ignore interaction evidences * It will set the publication but will not add this experiment to the list of experiments of the publication reported in the source experiment * It will fully clone all the VariableParameters and set their experiment to the current experiment target * @param source * @param target */ public static void copyAndOverrideExperimentProperties(Experiment source, Experiment target){ if (source != null && target != null){ target.setHostOrganism(source.getHostOrganism()); target.setInteractionDetectionMethod(source.getInteractionDetectionMethod()); target.setPublication(source.getPublication()); // copy collections target.getAnnotations().clear(); target.getAnnotations().addAll(source.getAnnotations()); target.getXrefs().clear(); target.getXrefs().addAll(source.getXrefs()); target.getConfidences().clear(); target.getConfidences().addAll(source.getConfidences()); target.getVariableParameters().clear(); target.addAllVariableParameters(source.getVariableParameters()); } }
/** * 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; }
/*** * This method will copy properties of experiment source in experiment target and will override all the other properties of Target experiment. * This method will also move interaction evidences from source to target * It will set the publication but will not add this experiment to the list of experiments of the publication reported in the source experiment * It will fully clone all the VariableParameters and set their experiment to the current experiment target * @param source * @param target */ public static void copyAndOverrideExperimentPropertiesAndInteractionEvidences(Experiment source, Experiment target){ if (source != null && target != null){ target.setHostOrganism(source.getHostOrganism()); target.setInteractionDetectionMethod(source.getInteractionDetectionMethod()); target.setPublication(source.getPublication()); // copy collections target.getAnnotations().clear(); target.getAnnotations().addAll(source.getAnnotations()); target.getXrefs().clear(); target.getXrefs().addAll(source.getXrefs()); target.getConfidences().clear(); target.getConfidences().addAll(source.getConfidences()); target.getVariableParameters().clear(); target.addAllVariableParameters(source.getVariableParameters()); target.getInteractionEvidences().clear(); target.addAllInteractionEvidences(source.getInteractionEvidences()); } } }
hashcode = 31*hashcode + UnambiguousCuratedPublicationComparator.hashCode(pub); CvTerm detMethod = exp.getInteractionDetectionMethod(); hashcode = 31*hashcode + UnambiguousCvTermComparator.hashCode(detMethod);
hashcode = 31*hashcode + UnambiguousPublicationComparator.hashCode(pub); CvTerm detMethod = exp.getInteractionDetectionMethod(); hashcode = 31*hashcode + UnambiguousCvTermComparator.hashCode(detMethod);
checkCv(messages, experiment.getInteractionDetectionMethod(), experiment, "experiment");
/** * 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, 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 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; }
getCvWriter().write(experiment.getInteractionDetectionMethod());