/** * Creates a valid Experiment instance. A valid Experiment must contain at least a shortLabel that refers to it, an * owner of the Experiment and also the biological source of the experiment data (ie organism). A side-effect of * this constructor is to set the <code>created</code> and <code>updated</code> fields of the instance to the * current time. * * @param owner The <code>Institution</code> which owns this Experiment (non-null) * @param shortLabel A String which can be used to refer to the Experiment (non-null) * @param source The biological source of the experimental data (non-null) * * @throws NullPointerException thrown if any of the parameters are not set */ public Experiment( Institution owner, String shortLabel, BioSource source ) { //TODO Q: does it make sense to create an Experiment without interactions? If not then all the Cv stuff (eg ident method etc) needs to be set also... super( shortLabel, owner ); setBioSource( source ); }
/** * Creates a valid Experiment instance. A valid Experiment must contain at least a shortLabel that refers to it, an * owner of the Experiment and also the biological source of the experiment data (ie organism). A side-effect of * this constructor is to set the <code>created</code> and <code>updated</code> fields of the instance to the * current time. * * @param owner The <code>Institution</code> which owns this Experiment (non-null) * @param shortLabel A String which can be used to refer to the Experiment (non-null) * @param source The biological source of the experimental data (non-null) * * @throws NullPointerException thrown if any of the parameters are not set */ public Experiment( Institution owner, String shortLabel, BioSource source ) { //TODO Q: does it make sense to create an Experiment without interactions? If not then all the Cv stuff (eg ident method etc) needs to be set also... super( shortLabel, owner ); setBioSource( source ); }
/** * Creates a valid Experiment instance. A valid Experiment must contain at least a shortLabel that refers to it, an * owner of the Experiment and also the biological source of the experiment data (ie organism). A side-effect of * this constructor is to set the <code>created</code> and <code>updated</code> fields of the instance to the * current time. * * @param owner The <code>Institution</code> which owns this Experiment (non-null) * @param shortLabel A String which can be used to refer to the Experiment (non-null) * @param source The biological source of the experimental data (non-null) * * @throws NullPointerException thrown if any of the parameters are not set */ public Experiment( Institution owner, String shortLabel, BioSource source ) { //TODO Q: does it make sense to create an Experiment without interactions? If not then all the Cv stuff (eg ident method etc) needs to be set also... super( shortLabel, owner ); setBioSource( source ); }
/** * This creates a stable (non-random) experiment */ public Experiment createDeterministicExperiment() { Experiment experiment = createExperimentEmpty("foobar-2006-1","12345"); experiment.setBioSource(createBioSource(5, "lalaorg")); return experiment; }
/** * This creates a stable (non-random) experiment */ public Experiment createDeterministicExperiment() { Experiment experiment = createExperimentEmpty("foobar-2006-1","12345"); experiment.setBioSource(createBioSource(5, "lalaorg")); 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 ); } }
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 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.setBioSource(bioSource);