public InteractionCategory findInteractionCategory(Interaction interaction) { if (interaction.getParticipants().size() == 1) { Participant c = interaction.getParticipants().iterator().next(); // we have a self interaction but inter molecular if (interaction.isIntraMolecular()){ return InteractionCategory.self_intra_molecular; } else { return InteractionCategory.self_inter_molecular; } } else if (interaction.getParticipants().size() == 2) { return InteractionCategory.binary; } else if (interaction.getParticipants().size() > 2) { return InteractionCategory.n_ary; } return null; }
Interactor interactorB = null; if (interaction.getParticipants().size() == 1 && interaction.isIntraMolecular()) { Iterator<Participant> pi = interaction.getParticipants().iterator(); pA = pi.next(); interactorA = getInteractorConverter().toMitab(pA); } else if (interaction.getParticipants().size() == 1 && !interaction.isIntraMolecular()) {
/** * Build a new Interaction with no participants but holding a copy of all other attributes of the given interaction. * <br/> WARNING: all attributes of the newly created interaction are the same as the source's (that is same object * instance). This is not an object clone. * * @param source the source interaction. * @return a target interaction which is a copy of the source interaction but the participants or * inferredInteractions. */ protected Interaction copyInteraction(Interaction source) { Interaction target = new Interaction(); // clone inner attributes target.setId(source.getId()); target.setImexId(source.getImexId()); // objects target.setNames(source.getNames()); target.setXref(source.getXref()); // collections target.getConfidences().addAll(source.getConfidences()); target.getExperiments().addAll(source.getExperiments()); target.getInteractionTypes().addAll(source.getInteractionTypes()); // added with mitab 27 target.setModelled(source.isModelled()); target.setIntraMolecular(source.isIntraMolecular()); target.setNegative(source.isNegative()); target.getParameters().addAll(source.getParameters()); target.getAttributes().addAll(source.getAttributes()); target.setAvailability(source.getAvailability()); return target; }
jInteraction.setIntraMolecular( mInteraction.isIntraMolecular() );
jInteraction.setIntraMolecular( mInteraction.isIntraMolecular() );
if( psiObject.isIntraMolecular() ) { interaction.addAnnotation( new Annotation( getInstitution(), new CvTopic( getInstitution(), INTRA_MOLECULAR ),