/** * Convenience method to get the experiments - delegates the logic to the interactions * * @return Experiments */ public Collection<Experiment> getExperiments() { if (experiments != null) { return experiments.keySet(); } else if (!experimentsList.isEmpty()){ return experimentsList; } experiments = new IdentityMap(); for (Interaction interaction : getInteractions()) { for (Experiment experiment : IntactCore.ensureInitializedExperiments(interaction)) { experiments.put(experiment, null); } } return experiments.keySet(); }
/** * Convenience method to get the experiments - delegates the logic to the interactions * * @return Experiments */ public Collection<Experiment> getExperiments() { if (experiments != null) { return experiments.keySet(); } else if (!experimentsList.isEmpty()){ return experimentsList; } experiments = new IdentityMap(); for (Interaction interaction : getInteractions()) { for (Experiment experiment : IntactCore.ensureInitializedExperiments(interaction)) { experiments.put(experiment, null); } } return experiments.keySet(); }
protected void failIfInconsistentConversion(Interaction intact, psidev.psi.mi.xml.model.Interaction psi, int numberOfAuthorConfAttributes) { Collection<Experiment> experiments; Collection<Component> participants; Collection<Confidence> confidences; if (isCheckInitializedCollections()){ experiments = IntactCore.ensureInitializedExperiments(intact); participants = IntactCore.ensureInitializedParticipants(intact); confidences = IntactCore.ensureInitializedConfidences(intact); } else { experiments = intact.getExperiments(); participants = intact.getComponents(); confidences = intact.getConfidences(); } failIfInconsistentCollectionSize("experiment", experiments, psi.getExperiments()); failIfInconsistentCollectionSize("participant", participants, psi.getParticipants()); Collection<Confidence> confs = confidences; if (confs.size() > 0 && psi.getConfidences().size() + numberOfAuthorConfAttributes > 0 && confs.size() != (psi.getConfidences().size() + numberOfAuthorConfAttributes)) { throw new InconsistentConversionException("Confidence", confs.size(), psi.getConfidences().size() + numberOfAuthorConfAttributes); } }
protected void failIfInconsistentPsiConversion(Interaction intact, psidev.psi.mi.xml.model.Interaction psi) { Collection<Experiment> experiments; Collection<Component> participants; Collection<Confidence> confidences; if (isCheckInitializedCollections()){ experiments = IntactCore.ensureInitializedExperiments(intact); participants = IntactCore.ensureInitializedParticipants(intact); confidences = IntactCore.ensureInitializedConfidences(intact); } else { experiments = intact.getExperiments(); participants = intact.getComponents(); confidences = intact.getConfidences(); } failIfInconsistentCollectionSize("experiment", experiments, psi.getExperiments()); failIfInconsistentCollectionSize("participant", participants, psi.getParticipants()); Collection<Confidence> confs = confidences; if (confs.size() > 0 && psi.getConfidences().size() > 0 && (confs.size()) != psi.getConfidences().size()) { throw new InconsistentConversionException("Confidence", confs.size(), psi.getConfidences().size()); } }
protected void failIfInconsistentConversion(Interaction intact, psidev.psi.mi.xml.model.Interaction psi) { Collection<Experiment> experiments; Collection<Component> participants; Collection<Confidence> confidences; if (isCheckInitializedCollections()){ experiments = IntactCore.ensureInitializedExperiments(intact); participants = IntactCore.ensureInitializedParticipants(intact); confidences = IntactCore.ensureInitializedConfidences(intact); } else { experiments = intact.getExperiments(); participants = intact.getComponents(); confidences = intact.getConfidences(); } failIfInconsistentCollectionSize("experiment", experiments, psi.getExperiments()); failIfInconsistentCollectionSize("participant", participants, psi.getParticipants()); failIfInconsistentCollectionSize( "confidence", confidences, psi.getConfidences()); }
experiments = IntactCore.ensureInitializedExperiments(intactObject); components = IntactCore.ensureInitializedParticipants(intactObject); confidences = IntactCore.ensureInitializedConfidences(intactObject);
public Publication clonePublication(Publication publication) throws IntactClonerException { if (publication == null) return null; Publication clone = new Publication(); clonerManager.addClone(publication, clone); if (isCollectionClonable(publication.getExperiments())) { Collection<Experiment> experiments = IntactCore.ensureInitializedExperiments(publication); for (Experiment e : experiments) { clone.addExperiment(clone(e)); } } if (isCollectionClonable(publication.getLifecycleEvents())) { Collection<LifecycleEvent> events = IntactCore.ensureInitializedLifecycleEvents(publication); for (LifecycleEvent event : events) { clone.addLifecycleEvent(clone(event)); } } clone.setStatus(clone(publication.getStatus())); clone.setCurrentOwner(clone(publication.getCurrentOwner())); clone.setCurrentReviewer(clone(publication.getCurrentReviewer())); return clone; }
public Publication clonePublication(Publication publication) throws IntactClonerException { if (publication == null) return null; Publication clone = new Publication(); clonerManager.addClone(publication, clone); if (isCollectionClonable(publication.getExperiments())) { Collection<Experiment> experiments = IntactCore.ensureInitializedExperiments(publication); for (Experiment e : experiments) { clone.addExperiment(clone(e)); } } if (isCollectionClonable(publication.getLifecycleEvents())) { Collection<LifecycleEvent> events = IntactCore.ensureInitializedLifecycleEvents(publication); for (LifecycleEvent event : events) { clone.addLifecycleEvent(clone(event)); } } clone.setStatus(clone(publication.getStatus())); clone.setCurrentOwner(clone(publication.getCurrentOwner())); clone.setCurrentReviewer(clone(publication.getCurrentReviewer())); return clone; }
Collection<Experiment> experiments = IntactCore.ensureInitializedExperiments(interaction);
Collection<Experiment> experiments = IntactCore.ensureInitializedExperiments(interaction);