/** * Setter for property 'particiantIdentification'. * * @param particiantIdentification Value to set for property 'particiantIdentification'. */ @Deprecated public void setParticipantIdentification( CvIdentification particiantIdentification ) { getParticipantDetectionMethods().add(particiantIdentification); }
private String calculateParticipantDetMethod(Collection<Component> components) { Set<String> detMethodMis = new HashSet<String>(); for (Component component : components) { for (CvIdentification partDetMethod : component.getParticipantDetectionMethods()) { if (partDetMethod.getIdentifier() != null) { detMethodMis.add(partDetMethod.getIdentifier()); } } } if (detMethodMis.size() == 1) { return detMethodMis.iterator().next(); } else if (detMethodMis.size() > 1) { return CvUtils.findLowestCommonAncestor(getCurrentOntology(), detMethodMis.toArray(new String[detMethodMis.size()])); } log.error("No participant detection methods found for components in experiment"); return null; }
public Component createComponent(Interaction interaction, Interactor interactor, CvExperimentalRole expRole, CvBiologicalRole bioRole) { Component component = new Component(getInstitution(), interaction, interactor, expRole, bioRole); CvIdentification cvParticipantDetMethod = createCvObject(CvIdentification.class, CvIdentification.PREDETERMINED_MI_REF, CvIdentification.PREDETERMINED); component.getParticipantDetectionMethods().add(cvParticipantDetMethod); CvExperimentalPreparation cvExperimentalPreparation = createCvObject(CvExperimentalPreparation.class, CvExperimentalPreparation.PURIFIED_REF, CvExperimentalPreparation.PURIFIED); component.getExperimentalPreparations().add(cvExperimentalPreparation); return component; }
/** * Retrieves the participant detection methods from a participant, initializing them if necessary. * Do not set the initialized collection of participant detection methods because cannot be orphan * @param component the component * @return The returned participant detection methods are ensured to be initialized * @since 2.4.0 */ public static Collection<CvIdentification> ensureInitializedParticipantIdentificationMethods(Component component) { Collection<CvIdentification> partDet; if (IntactCore.isInitialized(component.getParticipantDetectionMethods())) { partDet = component.getParticipantDetectionMethods(); } else { partDet = IntactContext.getCurrentInstance().getDaoFactory().getComponentDao().getParticipantIdentificationMethodsForComponentAc(component.getAc()); } return partDet; }
/** * Retrieves the participant detection methods from a participant, initializing them if necessary. * Do not set the initialized collection of participant detection methods because cannot be orphan * @param component the component * @return The returned participant detection methods are ensured to be initialized * @since 2.4.0 */ public static Collection<CvIdentification> ensureInitializedParticipantIdentificationMethods(Component component) { Collection<CvIdentification> partDet; if (IntactCore.isInitialized(component.getParticipantDetectionMethods())) { partDet = component.getParticipantDetectionMethods(); } else { partDet = IntactContext.getCurrentInstance().getDaoFactory().getComponentDao().getParticipantIdentificationMethodsForComponentAc(component.getAc()); } return partDet; }
public Component createComponent(Interaction interaction, Interactor interactor, CvExperimentalRole expRole, CvBiologicalRole bioRole) { Component component = new Component(getInstitution(), interaction, interactor, expRole, bioRole); CvIdentification cvParticipantDetMethod = createCvObject(CvIdentification.class, CvIdentification.PREDETERMINED_MI_REF, CvIdentification.PREDETERMINED); component.getParticipantDetectionMethods().add(cvParticipantDetMethod); CvExperimentalPreparation cvExperimentalPreparation = createCvObject(CvExperimentalPreparation.class, CvExperimentalPreparation.PURIFIED_REF, CvExperimentalPreparation.PURIFIED); component.getExperimentalPreparations().add(cvExperimentalPreparation); ComponentParameter componentParameter = createDeterministicComponentParameter(); component.addParameter(componentParameter); interactor.addActiveInstance( component ); interaction.addComponent( component ); return component; }
public Component createComponent(Interaction interaction, Interactor interactor, CvExperimentalRole expRole, CvBiologicalRole bioRole) { Component component = new Component(getInstitution(), interaction, interactor, expRole, bioRole); CvIdentification cvParticipantDetMethod = createCvObject(CvIdentification.class, CvIdentification.PREDETERMINED_MI_REF, CvIdentification.PREDETERMINED); component.getParticipantDetectionMethods().add(cvParticipantDetMethod); CvExperimentalPreparation cvExperimentalPreparation = createCvObject(CvExperimentalPreparation.class, CvExperimentalPreparation.PURIFIED_REF, CvExperimentalPreparation.PURIFIED); component.getExperimentalPreparations().add(cvExperimentalPreparation); ComponentParameter componentParameter = createDeterministicComponentParameter(); component.addParameter(componentParameter); interactor.addActiveInstance( component ); interaction.addComponent( component ); return component; }
intactObject.setCvExperimentalRole((CvExperimentalRole) cvPersister.syncIfTransient(intactObject.getCvExperimentalRole())); Collection<CvIdentification> syncedParticipantDetectionMethods = new ArrayList<CvIdentification>(intactObject.getParticipantDetectionMethods().size()); for (CvIdentification participantDetection : intactObject.getParticipantDetectionMethods()) { CvIdentification detMethod = (CvIdentification) cvPersister.syncIfTransient(participantDetection); syncedParticipantDetectionMethods.add(detMethod);
component.setInteractor( synchronize( component.getInteractor() ) ); if (IntactCore.isInitializedAndDirty(component.getParticipantDetectionMethods())) { Collection<CvIdentification> partDet = synchronizeCollection( component.getParticipantDetectionMethods()); component.getParticipantDetectionMethods().clear(); component.getParticipantDetectionMethods().addAll(partDet);
component.setInteractor( synchronize( component.getInteractor() ) ); if (IntactCore.isInitializedAndDirty(component.getParticipantDetectionMethods())) { Collection<CvIdentification> partDet = synchronizeCollection( component.getParticipantDetectionMethods()); component.getParticipantDetectionMethods().clear(); component.getParticipantDetectionMethods().addAll(partDet);
protected void copyComponent( Component source, Component target ) { copyProperty(source, "stoichiometry", target); copyProperty(source, "interaction", target); copyProperty(source, "interactor", target); copyProperty(source, "cvBiologicalRole", target); copyProperty(source, "cvExperimentalRole", target); copyProperty(source, "expressedIn", target); copyCollection( source.getBindingDomains(), target.getBindingDomains() ); for (Feature bindingDomain : target.getBindingDomains()) { bindingDomain.setComponent(target); } copyCollection( source.getExperimentalPreparations(), target.getExperimentalPreparations() ); copyCollection( source.getParticipantDetectionMethods(), target.getParticipantDetectionMethods() ); copyCollection( source.getParameters(), target.getParameters() ); }
List<CvIdentification> participantDetMethods = new ArrayList<CvIdentification>(component.getParticipantDetectionMethods()); Collections.sort(participantDetMethods, new CvObjectComparator());
protected void copyComponent( Component source, Component target ) { copyProperty(source, "stoichiometry", target); copyProperty(source, "interaction", target); copyProperty(source, "interactor", target); copyProperty(source, "cvBiologicalRole", target); copyProperty(source, "cvExperimentalRole", target); copyProperty(source, "expressedIn", target); copyCollection( source.getBindingDomains(), target.getBindingDomains() ); for (Feature bindingDomain : target.getBindingDomains()) { bindingDomain.setComponent(target); } copyCollection( source.getExperimentalPreparations(), target.getExperimentalPreparations() ); copyCollection( source.getParticipantDetectionMethods(), target.getParticipantDetectionMethods() ); copyCollection( source.getParameters(), target.getParameters() ); }
List<CvIdentification> participantDetMethods = new ArrayList<CvIdentification>(component.getParticipantDetectionMethods()); Collections.sort(participantDetMethods, new CvObjectComparator());
if (isCollectionClonable(component.getParticipantDetectionMethods())) { Collection<CvIdentification> partDet = IntactCore.ensureInitializedParticipantIdentificationMethods(component); clone.getParticipantDetectionMethods().add(clone(method));
if (isCollectionClonable(component.getParticipantDetectionMethods())) { Collection<CvIdentification> partDet = IntactCore.ensureInitializedParticipantIdentificationMethods(component); clone.getParticipantDetectionMethods().add(clone(method));
protected void traverseComponent(Component component, IntactVisitor ... visitors) { if (component == null) return; for (IntactVisitor visitor : visitors) { visitor.visitComponent(component); } // check if this element has been traversed already, to avoid cyclic recursion if (recursionChecker.isAlreadyTraversed(component)) { return; } traverse(component.getInteraction(), visitors); traverse(component.getInteractor(), visitors); traverse(component.getCvBiologicalRole(), visitors); traverse(component.getExpressedIn(), visitors); traverse(component.getParameters(), visitors); traverse(component.getParticipantDetectionMethods(), visitors); traverse(component.getExperimentalPreparations(), visitors); traverse(component.getBindingDomains(), visitors); traverse(component.getExperimentalRoles(), visitors); }
protected void traverseComponent(Component component, IntactVisitor ... visitors) { if (component == null) return; for (IntactVisitor visitor : visitors) { visitor.visitComponent(component); } // check if this element has been traversed already, to avoid cyclic recursion if (recursionChecker.isAlreadyTraversed(component)) { return; } traverse(component.getInteraction(), visitors); traverse(component.getInteractor(), visitors); traverse(component.getCvBiologicalRole(), visitors); traverse(component.getExpressedIn(), visitors); traverse(component.getParameters(), visitors); traverse(component.getParticipantDetectionMethods(), visitors); traverse(component.getExperimentalPreparations(), visitors); traverse(component.getBindingDomains(), visitors); traverse(component.getExperimentalRoles(), visitors); }
@Override protected void saveOrUpdateAttributes(Component intactObject) throws PersisterException { super.saveOrUpdateAttributes(intactObject); if (intactObject.getExpressedIn() != null) { BioSourcePersister bioSourcePersister = BioSourcePersister.getInstance(); bioSourcePersister.saveOrUpdate(intactObject.getExpressedIn()); } CvObjectPersister cvPersister = CvObjectPersister.getInstance(); cvPersister.saveOrUpdate(intactObject.getCvBiologicalRole()); cvPersister.saveOrUpdate(intactObject.getCvExperimentalRole()); for (CvIdentification participantDetection : intactObject.getParticipantDetectionMethods()) { cvPersister.saveOrUpdate(participantDetection); } for (CvExperimentalPreparation experimentalPreparation : intactObject.getExperimentalPreparations()) { cvPersister.saveOrUpdate(experimentalPreparation); } InteractionPersister.getInstance().saveOrUpdate(intactObject.getInteraction()); InteractorPersister.getInstance().saveOrUpdate(intactObject.getInteractor()); for (Feature feature : intactObject.getBindingDomains()) { FeaturePersister.getInstance().saveOrUpdate(feature); } }
return false; if ( !CollectionUtils.isEqualCollection(getParticipantDetectionMethods(), component.getParticipantDetectionMethods()) ) { return false;