public void writeParticipantIdentificationMethod(ParticipantEvidence participant) throws IOException { if (participant != null){ if (!participant.getIdentificationMethods().isEmpty()){ Iterator<CvTerm> methodIterator = participant.getIdentificationMethods().iterator(); while(methodIterator.hasNext()){ writeCvTerm(methodIterator.next()); if (methodIterator.hasNext()){ getWriter().write(MitabUtils.FIELD_SEPARATOR); } } } else{ getWriter().write(MitabUtils.EMPTY_COLUMN); } } else { getWriter().write(MitabUtils.EMPTY_COLUMN); } }
/** * Make sure that a participant evidence has a valid Participant Identification Method that all the participant identification methods are valid. * * @param participant an interaction to check on. * @return a collection of validator messages. */ public Collection<ValidatorMessage> check( ParticipantEvidence participant ) throws ValidatorException { // list of messages to return Collection<ValidatorMessage> messages = Collections.EMPTY_LIST; if (participant.getIdentificationMethods().isEmpty()){ MiContext context = RuleUtils.buildContext(participant, "participant"); messages=Collections.singleton(new ValidatorMessage(" The participant does not have a participant identification method and it is required for MIMIx", MessageLevel.ERROR, context, this)); } return messages; }
for (InteractionEvidence interaction : exp.getInteractionEvidences()){ for (ParticipantEvidence p : interaction.getParticipants()){ for (CvTerm identification : p.getIdentificationMethods()){ if (frequencyMap.containsKey(identification)){ int frequency = frequencyMap.get(identification)+1;
/** * 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; }
target.getParameters().clear(); target.getParameters().addAll(source.getParameters()); target.getIdentificationMethods().clear(); target.getIdentificationMethods().addAll(source.getIdentificationMethods());
if (!object.getIdentificationMethods().isEmpty()){ MIJsonUtils.writeSeparator(getWriter()); MIJsonUtils.writePropertyKey("identificationMethods", getWriter()); MIJsonUtils.writeOpenArray(getWriter()); Iterator<CvTerm> methodIterator = object.getIdentificationMethods().iterator(); while (methodIterator.hasNext()){ getCvWriter().write(methodIterator.next());
Collection<CvTerm> method1 = experimentalParticipant1.getIdentificationMethods(); Collection<CvTerm> method2 = experimentalParticipant2.getIdentificationMethods();
Collection<CvTerm> method1 = experimentalParticipant1.getIdentificationMethods(); Collection<CvTerm> method2 = experimentalParticipant2.getIdentificationMethods();
Collection<CvTerm> method1 = experimentalParticipant1.getIdentificationMethods(); Collection<CvTerm> method2 = experimentalParticipant2.getIdentificationMethods();
for (CvTerm term : p.getIdentificationMethods()){ checkCv(messages, term, p, "participant");