/** * * @param participants * @param roleMi * @param roleName * @return the number of participants with a specific experimental role */ private int getNumberOfParticipantWithExperimentalRole(Collection<? extends ParticipantEvidence> participants, String roleMi, String roleName){ int num = 0; for (ParticipantEvidence p : participants){ CvTerm experimentRole = p.getExperimentalRole(); if (checkParticipantRole(experimentRole, roleMi, roleName)){ num++; } } return num; }
public void writeExperimentalRole(ParticipantEvidence participant) throws IOException { if (participant != null){ writeCvTerm(participant.getExperimentalRole()); } else { getWriter().write(MitabUtils.EMPTY_COLUMN); } }
@Override protected boolean isParticipantBait(Participant component) { return getBaitMi().contains(((ParticipantEvidence) component) .getExperimentalRole().getMIIdentifier()); }
@Override protected boolean isParticipantPrey(Participant component) { return getPreyMi().contains(((ParticipantEvidence) component) .getExperimentalRole().getMIIdentifier()); }
/** * To know if the participant evidence does have a specific experimental role * @param participant * @param roleId * @param roleName * @return true if the participant has the experimental role with given name/identifier */ public static boolean doesParticipantHaveExperimentalRole(ParticipantEvidence participant, String roleId, String roleName){ if (participant == null || (roleName == null && roleId == null)){ return false; } CvTerm role = participant.getExperimentalRole(); // we can compare identifiers if (roleId != null && role.getMIIdentifier() != null){ // we have the same topic id return role.getMIIdentifier().equals(roleId); } // we need to compare topic names else if (roleName != null) { return roleName.equalsIgnoreCase(role.getShortName()); } return false; }
/** * Method to know if a participant evidence has a self experimental or biological role * @param p * @return */ public static boolean isSelfParticipantEvidence(ParticipantEvidence p){ if (p == null){ return false; } CvTerm experimentalRole = p.getExperimentalRole(); CvTerm biologicalRole = p.getBiologicalRole(); return DefaultCvTermComparator.areEquals(CvTermUtils.getSelf(), experimentalRole) || DefaultCvTermComparator.areEquals(CvTermUtils.getSelf(), biologicalRole) ; }
/** * Method to know if a participant evidence has a putative self experimental or biological role * @param p * @return */ public static boolean isPutativeSelfParticipantEvidence(ParticipantEvidence p){ if (p == null){ return false; } CvTerm experimentalRole = p.getExperimentalRole(); CvTerm biologicalRole = p.getBiologicalRole(); return DefaultCvTermComparator.areEquals(CvTermUtils.getPutativeSelf(), experimentalRole) || DefaultCvTermComparator.areEquals(CvTermUtils.getPutativeSelf(), biologicalRole) ; }
/** * Method to know if a participant has a putative self biological role. * If checkParticipantEvidence is set to true, it will check if the given p is a ParticipantEvidence and look at the experimental role * @param p * @param checkParticipantEvidence * @return */ public static boolean isPutativeSelfParticipant(Participant p, boolean checkParticipantEvidence){ if (p == null){ return false; } CvTerm biologicalRole = p.getBiologicalRole(); if (DefaultCvTermComparator.areEquals(CvTermUtils.getPutativeSelf(), biologicalRole)){ return true; } if (checkParticipantEvidence){ if (p instanceof ParticipantEvidence){ CvTerm expRole = ((ParticipantEvidence)p).getExperimentalRole(); return DefaultCvTermComparator.areEquals(CvTermUtils.getPutativeSelf(), expRole) ; } } return false; }
/** * Method to know if a participant has a self biological role * If checkParticipantEvidence is set to true, it will check if the given p is a ParticipantEvidence and look at the experimental role * @param p * @param checkParticipantEvidence * @return */ public static boolean isSelfParticipant(Participant p, boolean checkParticipantEvidence){ if (p == null){ return false; } CvTerm biologicalRole = p.getBiologicalRole(); if (DefaultCvTermComparator.areEquals(CvTermUtils.getSelf(), biologicalRole)){ return true; } if (checkParticipantEvidence){ if (p instanceof ParticipantEvidence){ CvTerm expRole = ((ParticipantEvidence)p).getExperimentalRole(); return DefaultCvTermComparator.areEquals(CvTermUtils.getSelf(), expRole) ; } } return false; }
target.setExperimentalRole(source.getExperimentalRole()); target.setExpressedInOrganism(source.getExpressedInOrganism()); target.setBiologicalRole(source.getBiologicalRole());
/** * 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(object.getExperimentalRole());
if (p.getExperimentalRole() != null){ checkCv(messages, p.getExperimentalRole(), p, "participant");
CvTerm expRoles1 = experimentalParticipant1.getExperimentalRole(); CvTerm expRoles2 = experimentalParticipant2.getExperimentalRole();
CvTerm expRoles1 = experimentalParticipant1.getExperimentalRole(); CvTerm expRoles2 = experimentalParticipant2.getExperimentalRole();
CvTerm expRoles1 = experimentalParticipant1.getExperimentalRole(); CvTerm expRoles2 = experimentalParticipant2.getExperimentalRole();