@Override protected ParticipantEvidence[] createParticipantsArray(InteractionEvidence interaction) { return interaction.getParticipants().toArray(new DefaultParticipantEvidence[]{}); } }
@Override protected ParticipantEvidence collectBestBaitForSpokeExpansion(InteractionEvidence interaction) { return ParticipantUtils.collectBestParticipantEvidenceAsBaitForSpokeExpansion(interaction.getParticipants()); } }
@Override protected Collection<BinaryInteractionEvidence> collectBinaryInteractionsFromNary(InteractionEvidence interaction){ ParticipantEvidence externalEntity = createParticipantForComplexEntity(createComplexEntity(interaction)); Collection<BinaryInteractionEvidence> binaryInteractions = new ArrayList<BinaryInteractionEvidence>(interaction.getParticipants().size()); for ( ParticipantEvidence p : interaction.getParticipants() ) { // build a new interaction BinaryInteractionEvidence binary = createBinaryInteraction(interaction, externalEntity, p); binaryInteractions.add(binary); } return binaryInteractions; }
if (exp != null && !exp.getInteractionEvidences().isEmpty()){ for (InteractionEvidence interaction : exp.getInteractionEvidences()){ for (ParticipantEvidence p : interaction.getParticipants()){ for (CvTerm identification : p.getIdentificationMethods()){ if (frequencyMap.containsKey(identification)){
if (interaction.getParticipants().size() == 1) { ParticipantEvidence p = interaction.getParticipants().iterator().next(); else if (interaction.getParticipants().size() == 2){ return ComplexType.binary; else if (interaction.getParticipants().size() > 2){ return ComplexType.n_ary;
Collection<ParticipantEvidence> participants1 = experimentalInteraction1.getParticipants(); Collection<ParticipantEvidence> participants2 = experimentalInteraction2.getParticipants(); if (!compareParticipants(participants1, participants2)){ return false;
Collection<ParticipantEvidence> participants1 = experimentalInteraction1.getParticipants(); Collection<ParticipantEvidence> participants2 = experimentalInteraction2.getParticipants();
Collection<ParticipantEvidence> participants1 = experimentalInteraction1.getParticipants(); Collection<ParticipantEvidence> participants2 = experimentalInteraction2.getParticipants();
Collection<ParticipantEvidence> participants1 = experimentalInteraction1.getParticipants(); Collection<ParticipantEvidence> participants2 = experimentalInteraction2.getParticipants();
if (source.getParticipants().size() > 2){ throw new IllegalArgumentException("We cannot copy the participants from the source because it contains more than 2 participants : " +source.getParticipants().size()); else if (source.getParticipants().size() != 1 && self){ throw new IllegalArgumentException("We cannot copy the participants from the source because it is a self interaction containing more than one participant"); if (source.getParticipants().isEmpty()){ target.setParticipantA(null); target.setParticipantB(null); Iterator<ParticipantEvidence> iterator = source.getParticipants().iterator();
target.getParticipants().clear(); target.getParticipants().addAll(source.getParticipants()); for (ParticipantEvidence p : source.getParticipants()){ ParticipantEvidence clone = new DefaultParticipantEvidence(p.getInteractor()); ParticipantCloner.copyAndOverrideParticipantEvidenceProperties(p, clone, true);
/** * 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; }
Collection<ParticipantEvidence> participants1 = experimentalInteraction1.getParticipants(); Collection<ParticipantEvidence> participants2 = experimentalInteraction2.getParticipants();
for (ParticipantEvidence p : interaction.getParticipants()){ checkParticipant(messages, p, interaction);