private void updateExperimentParticipantDetectionMethod(Interaction interaction) { for (Experiment experiment : interaction.getExperiments()) { if (experiment.getCvIdentification() == null) { String partDetMethod = calculateParticipantDetMethod(interaction.getComponents()); if (partDetMethod != null) { final String message = "Experiment ("+ experiment.getShortLabel() +") without participant detection method. One was calculated from the components: " + partDetMethod; addMessageToContext(MessageLevel.INFO, message, true); if (log.isWarnEnabled()) { log.warn(message); } CvIdentification detMethod = CvObjectUtils.createCvObject(experiment.getOwner(), CvIdentification.class, partDetMethod, "undefined"); experiment.setCvIdentification(detMethod); } else { final String message = "Neither the Experiment nor its participants have CvIdentification (participant detection method). Using the term \"experimental particp\" (MI:0661)."; if (log.isWarnEnabled()) log.warn(": Experiment '"+experiment.getShortLabel()+ "', Interaction '"+interaction.getShortLabel()+"' - Location: "+ConverterContext.getInstance().getLocation().getCurrentLocation().pathFromRootAsString()); addMessageToContext(MessageLevel.WARN, message, true); CvIdentification detMethod = CvObjectUtils.createCvObject(experiment.getOwner(), CvIdentification.class, "MI:0661", "experimental particp"); experiment.setCvIdentification(detMethod); } } } }
public Experiment createExperimentEmpty(String shortLabel, String pubId) { Experiment experiment = new Experiment(getInstitution(), shortLabel, createBioSourceRandom()); experiment.setCvInteraction(createCvObject(CvInteraction.class, CvInteraction.COSEDIMENTATION_MI_REF, CvInteraction.COSEDIMENTATION)); experiment.setCvIdentification(createCvObject(CvIdentification.class, CvIdentification.PREDETERMINED_MI_REF, CvIdentification.PREDETERMINED)); Publication publication = createPublication(pubId); publication.addExperiment(experiment); experiment.addXref(createPrimaryReferenceXref(experiment, pubId)); return experiment; }
private void synchronizeExperiment( Experiment experiment, boolean synchronizeAnnotatedAttributes ) { experiment.setPublication( synchronize( experiment.getPublication() ) ); if (IntactCore.isInitializedAndDirty(experiment.getInteractions())){ Collection<Interaction> interactions = synchronizeCollection(experiment.getInteractions()); experiment.getInteractions().clear(); experiment.getInteractions().addAll(interactions); } experiment.setCvIdentification(synchronize(experiment.getCvIdentification())); experiment.setCvInteraction( synchronize( experiment.getCvInteraction() ) ); experiment.setBioSource( synchronize( experiment.getBioSource() ) ); if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( experiment ); } }
public Experiment createExperimentEmpty(String shortLabel, String pubId) { Experiment experiment = new Experiment(getInstitution(), shortLabel, createBioSourceRandom()); experiment.setCvInteraction(createCvObject(CvInteraction.class, CvInteraction.COSEDIMENTATION_MI_REF, CvInteraction.COSEDIMENTATION)); experiment.setCvIdentification(createCvObject(CvIdentification.class, CvIdentification.PREDETERMINED_MI_REF, CvIdentification.PREDETERMINED)); Publication publication = createPublication(pubId); publication.addExperiment(experiment); experiment.addXref(createPrimaryReferenceXref(experiment, pubId)); return experiment; }
private void synchronizeExperiment( Experiment experiment, boolean synchronizeAnnotatedAttributes ) { experiment.setPublication( synchronize( experiment.getPublication() ) ); if (IntactCore.isInitializedAndDirty(experiment.getInteractions())){ Collection<Interaction> interactions = synchronizeCollection(experiment.getInteractions()); experiment.getInteractions().clear(); experiment.getInteractions().addAll(interactions); } experiment.setCvIdentification(synchronize(experiment.getCvIdentification())); experiment.setCvInteraction( synchronize( experiment.getCvInteraction() ) ); experiment.setBioSource( synchronize( experiment.getBioSource() ) ); if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( experiment ); } }
public Experiment createExperimentEmpty(String shortLabel) { Experiment experiment = new Experiment(getInstitution(), shortLabel, createBioSourceRandom()); experiment.setCvInteraction(createCvObject(CvInteraction.class, CvInteraction.COSEDIMENTATION_MI_REF, CvInteraction.COSEDIMENTATION)); experiment.setCvIdentification(createCvObject(CvIdentification.class, CvIdentification.PREDETERMINED_MI_REF, CvIdentification.PREDETERMINED)); experiment.setPublication(createPublicationRandom()); experiment.addXref(createPrimaryReferenceXref(experiment, experiment.getPublication().getShortLabel())); return experiment; }
public Experiment createExperimentEmpty(String shortLabel) { Experiment experiment = new Experiment(getInstitution(), shortLabel, createBioSourceRandom()); experiment.setCvInteraction(createCvObject(CvInteraction.class, CvInteraction.COSEDIMENTATION_MI_REF, CvInteraction.COSEDIMENTATION)); experiment.setCvIdentification(createCvObject(CvIdentification.class, CvIdentification.PREDETERMINED_MI_REF, CvIdentification.PREDETERMINED)); final Publication publication = createPublicationRandom(); experiment.setPublication(publication); publication.addExperiment(experiment); experiment.addXref(createPrimaryReferenceXref(experiment, experiment.getPublication().getShortLabel())); return experiment; }
public Experiment createExperimentEmpty(String shortLabel) { Experiment experiment = new Experiment(getInstitution(), shortLabel, createBioSourceRandom()); experiment.setCvInteraction(createCvObject(CvInteraction.class, CvInteraction.COSEDIMENTATION_MI_REF, CvInteraction.COSEDIMENTATION)); experiment.setCvIdentification(createCvObject(CvIdentification.class, CvIdentification.PREDETERMINED_MI_REF, CvIdentification.PREDETERMINED)); final Publication publication = createPublicationRandom(); experiment.setPublication(publication); publication.addExperiment(experiment); experiment.addXref(createPrimaryReferenceXref(experiment, experiment.getPublication().getShortLabel())); return experiment; }
public Experiment cloneExperiment(Experiment experiment) throws IntactClonerException { if (experiment == null) return null; Experiment clone = new Experiment(); clonerManager.addClone(experiment, clone); clone.setCvIdentification(clone(experiment.getCvIdentification())); clone.setCvInteraction(clone(experiment.getCvInteraction())); clone.setBioSource(clone(experiment.getBioSource())); clone.setPublication(clone(experiment.getPublication())); if (isCollectionClonable(experiment.getInteractions())) { Collection<Interaction> interactions = IntactCore.ensureInitializedInteractions(experiment); for (Interaction i : interactions) { clone.addInteraction(clone(i)); } } return clone; }
public Experiment cloneExperiment(Experiment experiment) throws IntactClonerException { if (experiment == null) return null; Experiment clone = new Experiment(); clonerManager.addClone(experiment, clone); clone.setCvIdentification(clone(experiment.getCvIdentification())); clone.setCvInteraction(clone(experiment.getCvInteraction())); clone.setBioSource(clone(experiment.getBioSource())); clone.setPublication(clone(experiment.getPublication())); if (isCollectionClonable(experiment.getInteractions())) { Collection<Interaction> interactions = IntactCore.ensureInitializedInteractions(experiment); for (Interaction i : interactions) { clone.addInteraction(clone(i)); } } return clone; }
@Override protected Experiment syncAttributes(Experiment intactObject) { if (intactObject.getBioSource() != null) { BioSource bioSource = BioSourcePersister.getInstance().syncIfTransient(intactObject.getBioSource()); intactObject.setBioSource(bioSource); } intactObject.setCvInteraction((CvInteraction) CvObjectPersister.getInstance().syncIfTransient(intactObject.getCvInteraction())); if (intactObject.getCvIdentification() != null) { CvIdentification cvIdentification = ( CvIdentification ) CvObjectPersister.getInstance().syncIfTransient( intactObject.getCvIdentification() ); intactObject.setCvIdentification( cvIdentification ); } if (intactObject.getPublication() != null) { Publication publication = PublicationPersister.getInstance().syncIfTransient( intactObject.getPublication() ); intactObject.setPublication( publication ); } return super.syncAttributes(intactObject); }
experiment.setCvIdentification( cvIdentification );
experiment.setCvIdentification( cvIdentification );
experiment.setCvIdentification( cvIdentification );
/** * Builds a SHALLOW copy of the Experiment parameter. This means that a new Experiment instance is returned, but you * should be aware that the object references it contains <b>point to the objects referenced in the original object * </b>. * * @param experiment The Experiment you want a shallow copy of * * @return Experiment a new Experiment instance containing new references to the parameter object's attributes. * * @throws NullPointerException thrown if required items are not present in the parameter Experiment instance. */ public static Experiment getShallowCopy( Experiment experiment ) { Experiment ex = new Experiment( experiment.getOwner(), experiment.getShortLabel(), experiment.getBioSource() ); ex.ac = ( experiment.getAc() ); ex.setAnnotations( experiment.getAnnotations() ); ex.setCvInteraction( experiment.getCvInteraction() ); ex.setCvIdentification( experiment.getCvIdentification() ); ex.setFullName( experiment.getFullName() ); ex.setRelatedExperiment( experiment.getRelatedExperiment() ); ex.setXrefs( experiment.getXrefs() ); ex.setPublication( experiment.getPublication() ); return ex; }
/** * Builds a SHALLOW copy of the Experiment parameter. This means that a new Experiment instance is returned, but you * should be aware that the object references it contains <b>point to the objects referenced in the original object * </b>. * * @param experiment The Experiment you want a shallow copy of * * @return Experiment a new Experiment instance containing new references to the parameter object's attributes. * * @throws NullPointerException thrown if required items are not present in the parameter Experiment instance. */ public static Experiment getShallowCopy( Experiment experiment ) { Experiment ex = new Experiment( experiment.getOwner(), experiment.getShortLabel(), experiment.getBioSource() ); ex.ac = ( experiment.getAc() ); ex.setAnnotations( experiment.getAnnotations() ); ex.setCvInteraction( experiment.getCvInteraction() ); ex.setCvIdentification( experiment.getCvIdentification() ); ex.setFullName( experiment.getFullName() ); ex.setRelatedExperiment( experiment.getRelatedExperiment() ); ex.setXrefs( experiment.getXrefs() ); ex.setPublication( experiment.getPublication() ); return ex; }
/** * Builds a SHALLOW copy of the Experiment parameter. This means that a new Experiment instance is returned, but you * should be aware that the object references it contains <b>point to the objects referenced in the original object * </b>. * * @param experiment The Experiment you want a shallow copy of * * @return Experiment a new Experiment instance containing new references to the parameter object's attributes. * * @throws NullPointerException thrown if required items are not present in the parameter Experiment instance. */ public static Experiment getShallowCopy( Experiment experiment ) { Experiment ex = new Experiment( experiment.getOwner(), experiment.getShortLabel(), experiment.getBioSource() ); ex.ac = ( experiment.getAc() ); ex.setAnnotations( experiment.getAnnotations() ); ex.setCvInteraction( experiment.getCvInteraction() ); ex.setCvIdentification( experiment.getCvIdentification() ); ex.setFullName( experiment.getFullName() ); ex.setRelatedExperiment( experiment.getRelatedExperiment() ); ex.setXrefs( experiment.getXrefs() ); ex.setPublication( experiment.getPublication() ); return ex; }
if (pim != null) { CvIdentification cvParticipantIdentification = this.participantIdentificationMethodConverter.psiToIntact(pim); experiment.setCvIdentification(cvParticipantIdentification);