public static Participant createParticipant(Interactor interactor, BiologicalRole biologicalRole, ExperimentalRole experimentalRole) { Participant participant = new Participant(); assignNextId(participant); participant.setInteractor(interactor); participant.setBiologicalRole(biologicalRole); participant.getExperimentalRoles().add(experimentalRole); return participant; }
psidev.psi.mi.xml.model.Interactor interactor = interactorConverter.intactToPsi(intactObject.getInteractor()); if( ConverterContext.getInstance().isGenerateExpandedXml() ) { participant.setInteractor(interactor); } else { participant.setInteractorRef(new InteractorRef(interactor.getId()));
mParticipant.setInteractorRef( new InteractorRef( jParticipant.getInteractorRef() ) ); } else { mParticipant.setInteractor( mInteractor ); mParticipant.setInteractor( mInteractor );
private void removeInteractorRedundancy( EntrySet mEntrySet ) { if( ConverterContext.getInstance().getConverterConfig().getXmlForm() == PsimiXmlForm.FORM_COMPACT ) { for ( Entry entry : mEntrySet.getEntries() ) { Map<Interactor, Interactor> uniqueInteractors = new HashMap<Interactor, Interactor>(); for ( Interaction interaction : entry.getInteractions() ) { for ( Participant participant : interaction.getParticipants() ) { if( participant.getInteractor() != null ) { final Interactor myInteractor = participant.getInteractor(); if( uniqueInteractors.containsKey( myInteractor ) ) { final Interactor uniq = uniqueInteractors.get( myInteractor ); participant.setInteractor( uniq ); } else { uniqueInteractors.put( myInteractor, myInteractor ); } } } // participants } // interactions // if we had a compact format, we cannot remove interactor redundancy without changing the interactions // and update the interactor xref if (!uniqueInteractors.isEmpty()){ entry.getInteractors().clear(); entry.getInteractors().addAll( uniqueInteractors.keySet() ); } } // entries } // model is compact }
mParticipant.setInteractorRef( new InteractorRef( jParticipant.getInteractorRef() ) ); } else { mParticipant.setInteractor( mInteractor ); mParticipant.setInteractor( mInteractor );
participant.setInteractor(interactor);
participant.setInteractor( interactor );