public static boolean containSameAliases(AnnotatedObject ao1, AnnotatedObject ao2) { return areCollectionEqual(IntactCore.ensureInitializedAliases(ao1), IntactCore.ensureInitializedXrefs(ao2)); }
public static boolean containSameAnnotations(AnnotatedObject ao1, AnnotatedObject ao2) { return areCollectionEqual(IntactCore.ensureInitializedAnnotations(ao1), IntactCore.ensureInitializedAnnotations(ao2)); }
Collection<Component> initializedComponents1 = IntactCore.ensureInitializedParticipants(this); Collection<Component> initializedComponents2 = IntactCore.ensureInitializedParticipants(interaction); Collection<Confidence> initializedConfidence1 = IntactCore.ensureInitializedConfidences(this); Collection<Confidence> initializedConfidence2 = IntactCore.ensureInitializedConfidences(interaction); Collection<InteractionParameter> initializedParameter1 = IntactCore.ensureInitializedInteractionParameters(this); Collection<InteractionParameter> initializedParameter2 = IntactCore.ensureInitializedInteractionParameters(interaction); if (!CollectionUtils.isEqualCollection( initializedParameter1, initializedParameter2)){ return false;
Collection<ComponentParameter> parameters = IntactCore.ensureInitializedComponentParameters(component); Collection<Feature> features = IntactCore.ensureInitializedFeatures(component); Collection<CvExperimentalPreparation> expPreps = IntactCore.ensureInitializedExperimentalPreparations(component); Collection<CvIdentification> partDet = IntactCore.ensureInitializedParticipantIdentificationMethods(component); Collection<CvExperimentalRole> roles = IntactCore.ensureInitializedExperimentalRoles(component); Collection<ComponentConfidence> confidences = IntactCore.ensureInitializedComponentConfidences(component);
experiments = IntactCore.ensureInitializedExperiments(intactObject); components = IntactCore.ensureInitializedParticipants(intactObject); confidences = IntactCore.ensureInitializedConfidences(intactObject); parameters = IntactCore.ensureInitializedInteractionParameters(intactObject); annotations = IntactCore.ensureInitializedAnnotations(intactObject); features = IntactCore.ensureInitializedFeatures(comp);
Collection<Component> components = IntactCore.ensureInitializedParticipants(interaction); Collection<Experiment> experiments = IntactCore.ensureInitializedExperiments(interaction); Collection<Confidence> confidences = IntactCore.ensureInitializedConfidences(interaction); Collection<InteractionParameter> parameters = IntactCore.ensureInitializedInteractionParameters(interaction);
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); } }
Collection<Annotation> annotations = IntactCore.ensureInitializedAnnotations(ao); Collection<? extends Alias> aliases = IntactCore.ensureInitializedAliases(ao); Collection<? extends Xref> refs = IntactCore.ensureInitializedXrefs(ao);
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; }
protected static void populateNames( AnnotatedObject<?, ?> annotatedObject, NamesContainer namesContainer ) { Names names = namesContainer.getNames(); if ( names == null ) { names = new Names(); } String shortLabel = annotatedObject.getShortLabel(); String fullName = annotatedObject.getFullName(); names.setShortLabel( shortLabel ); names.setFullName( fullName ); if ( !ConverterContext.getInstance().getInteractorConfig().isExcludeInteractorAliases() ) { AliasConverter aliasConverter = new AliasConverter( annotatedObject.getOwner(), AnnotatedObjectUtils.getAliasClassType( annotatedObject.getClass() ) ); for ( Alias alias : IntactCore.ensureInitializedAliases(annotatedObject)) { names.getAliases().add( aliasConverter.intactToPsi( alias ) ); } } namesContainer.setNames( names ); }
/** * 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(); }
Collection<ComponentParameter> parameters = IntactCore.ensureInitializedComponentParameters(component); Collection<Feature> features = IntactCore.ensureInitializedFeatures(component); Collection<CvExperimentalPreparation> expPreps = IntactCore.ensureInitializedExperimentalPreparations(component); Collection<CvIdentification> partDet = IntactCore.ensureInitializedParticipantIdentificationMethods(component); Collection<CvExperimentalRole> roles = IntactCore.ensureInitializedExperimentalRoles(component); Collection<ComponentConfidence> confidences = IntactCore.ensureInitializedComponentConfidences(component);
Collection<Component> components = IntactCore.ensureInitializedParticipants(interaction); Collection<Experiment> experiments = IntactCore.ensureInitializedExperiments(interaction); Collection<Confidence> confidences = IntactCore.ensureInitializedConfidences(interaction); Collection<InteractionParameter> parameters = IntactCore.ensureInitializedInteractionParameters(interaction);
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()); } }
Collection<Annotation> annotations = IntactCore.ensureInitializedAnnotations(ao); Collection<? extends Alias> aliases = IntactCore.ensureInitializedAliases(ao); Collection<? extends Xref> refs = IntactCore.ensureInitializedXrefs(ao);
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 static void populateNames( AnnotatedObject<?, ?> annotatedObject, NamesContainer namesContainer, AliasConverter aliasConverter ) { Names names = namesContainer.getNames(); if ( names == null ) { names = new Names(); } String shortLabel = annotatedObject.getShortLabel(); String fullName = annotatedObject.getFullName(); names.setShortLabel( shortLabel ); names.setFullName( fullName ); if ( !ConverterContext.getInstance().getInteractorConfig().isExcludeInteractorAliases() ) { Collection<? extends Alias> aliases; if (aliasConverter.isCheckInitializedCollections()){ aliases = IntactCore.ensureInitializedAliases(annotatedObject); } else { aliases = annotatedObject.getAliases(); } for ( Alias alias : aliases) { names.getAliases().add( aliasConverter.intactToPsi( alias ) ); } } namesContainer.setNames( names ); }
/** * 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(); }
experimentalRoles = IntactCore.ensureInitializedExperimentalRoles(intactObject); partIdentMethods = IntactCore.ensureInitializedParticipantIdentificationMethods(intactObject); expPreparations = IntactCore.ensureInitializedExperimentalPreparations(intactObject); features = IntactCore.ensureInitializedFeatures(intactObject); confs = IntactCore.ensureInitializedComponentConfidences(intactObject); params = IntactCore.ensureInitializedComponentParameters(intactObject);
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()); }