Package psidev.psi.mi.jami.enricher.util
Class EnricherUtils
- java.lang.Object
-
- psidev.psi.mi.jami.enricher.util.EnricherUtils
-
public class EnricherUtils extends Object
Utilities for enrichers.- Since:
- 10/07/13
- Author:
- Gabriel Aldam (galdam@ebi.ac.uk)
-
-
Field Summary
Fields Modifier and Type Field Description static StringBLANK_SPACEConstantBLANK_SPACE="-"static StringCOLUMN_SEPARATORConstantCOLUMN_SEPARATOR="\t"static StringNEW_LINEConstantNEW_LINE="\n"
-
Constructor Summary
Constructors Constructor Description EnricherUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> voidmergeAliases(T termToEnrich, Collection<Alias> toEnrichAliases, Collection<Alias> fetchedAliases, boolean remove, AliasesChangeListener<T> aliasListener)mergeAliases.static <T> voidmergeAnnotations(T termToEnrich, Collection<Annotation> toEnrichAnnotations, Collection<Annotation> fetchedAnnotations, boolean remove, AnnotationsChangeListener<T> annotationListener)mergeAnnotations.static voidmergeCausalRelationships(Entity termToEnrich, Collection<CausalRelationship> toEnrichRelationships, Collection<CausalRelationship> fetchedRelationships, boolean remove, EntityChangeListener entityListener)mergeCausalRelationships.static <T> voidmergeChecksums(T termToEnrich, Collection<Checksum> toEnrichChecksums, Collection<Checksum> fetchedCehcksum, boolean remove, ChecksumsChangeListener<T> aliasListener)mergeChecksums.static <T,C extends Confidence>
voidmergeConfidences(T termToEnrich, Collection<C> toEnrichConfidences, Collection<C> fetchedConfidences, boolean remove, ConfidencesChangeListener<T> confListener)mergeConfidences.static <F extends Feature>
voidmergeFeatures(Entity termToEnrich, Collection<F> toEnrichFeatures, Collection<F> fetchedFeatures, boolean remove, EntityChangeListener entityListener, FeatureEnricher<F> featureEnricher)mergeFeatures.static <T,P extends Parameter>
voidmergeParameters(T termToEnrich, Collection<P> toEnrichParameters, Collection<P> fetchedParameters, boolean remove, ParametersChangeListener<T> paramListener)mergeParameters.static <P extends ParticipantCandidate>
voidmergeParticipantCandidates(ParticipantPool termToEnrich, Collection<P> toEnrichParticipants, Collection<P> fetchedParticipants, boolean remove, ParticipantPoolChangeListener poolListener, EntityEnricher participantEnricher)mergeParticipantCandidates.static <P extends Participant>
voidmergeParticipants(Interaction termToEnrich, Collection<P> toEnrichParticipants, Collection<P> fetchedParticipants, boolean remove, InteractionChangeListener interactionListener, ParticipantEnricher participantEnricher)mergeParticipants.static <T extends Feature>
voidmergeRanges(T termToEnrich, Collection<Range> toEnrichRanges, Collection<Range> fetchedRanges, boolean remove, FeatureChangeListener<T> featureListener)mergeRanges.static <T> voidmergeXrefs(T termToEnrich, Collection<Xref> toEnrichXrefs, Collection<Xref> fetchedXrefs, boolean remove, boolean isIdentifier, XrefsChangeListener<T> xrefListener, IdentifiersChangeListener<T> identifierListener)Takes two lists of Xrefs and produces a list of those to add and those to remove.
-
-
-
Field Detail
-
NEW_LINE
public static final String NEW_LINE
ConstantNEW_LINE="\n"- See Also:
- Constant Field Values
-
COLUMN_SEPARATOR
public static final String COLUMN_SEPARATOR
ConstantCOLUMN_SEPARATOR="\t"- See Also:
- Constant Field Values
-
BLANK_SPACE
public static final String BLANK_SPACE
ConstantBLANK_SPACE="-"- See Also:
- Constant Field Values
-
-
Method Detail
-
mergeXrefs
public static <T> void mergeXrefs(T termToEnrich, Collection<Xref> toEnrichXrefs, Collection<Xref> fetchedXrefs, boolean remove, boolean isIdentifier, XrefsChangeListener<T> xrefListener, IdentifiersChangeListener<T> identifierListener)Takes two lists of Xrefs and produces a list of those to add and those to remove.It will add in toEnrichXrefs all xref from fetchedXrefs that are not there. It will also remove extra identifiers from toEnrichXrefs if remove boolean is true.
- Type Parameters:
T- a T object.- Parameters:
termToEnrich- The object to enrichfetchedXrefs- The new xrefs to be added.remove- : if true, we remove xrefs that are not in enriched listisIdentifier- if true compare identifiers, otherwise xrefstoEnrichXrefs- aCollectionobject.xrefListener- aXrefsChangeListenerobject.identifierListener- aIdentifiersChangeListenerobject.
-
mergeRanges
public static <T extends Feature> void mergeRanges(T termToEnrich, Collection<Range> toEnrichRanges, Collection<Range> fetchedRanges, boolean remove, FeatureChangeListener<T> featureListener)
mergeRanges.
- Type Parameters:
T- a T object.- Parameters:
termToEnrich- a T object.toEnrichRanges- aCollectionobject.fetchedRanges- aCollectionobject.remove- a boolean.featureListener- aFeatureChangeListenerobject.
-
mergeAliases
public static <T> void mergeAliases(T termToEnrich, Collection<Alias> toEnrichAliases, Collection<Alias> fetchedAliases, boolean remove, AliasesChangeListener<T> aliasListener)mergeAliases.
- Type Parameters:
T- a T object.- Parameters:
termToEnrich- a T object.toEnrichAliases- aCollectionobject.fetchedAliases- aCollectionobject.remove- a boolean.aliasListener- aAliasesChangeListenerobject.
-
mergeChecksums
public static <T> void mergeChecksums(T termToEnrich, Collection<Checksum> toEnrichChecksums, Collection<Checksum> fetchedCehcksum, boolean remove, ChecksumsChangeListener<T> aliasListener)mergeChecksums.
- Type Parameters:
T- a T object.- Parameters:
termToEnrich- a T object.toEnrichChecksums- aCollectionobject.fetchedCehcksum- aCollectionobject.remove- a boolean.aliasListener- aChecksumsChangeListenerobject.
-
mergeAnnotations
public static <T> void mergeAnnotations(T termToEnrich, Collection<Annotation> toEnrichAnnotations, Collection<Annotation> fetchedAnnotations, boolean remove, AnnotationsChangeListener<T> annotationListener)mergeAnnotations.
- Type Parameters:
T- a T object.- Parameters:
termToEnrich- a T object.toEnrichAnnotations- aCollectionobject.fetchedAnnotations- aCollectionobject.remove- a boolean.annotationListener- aAnnotationsChangeListenerobject.
-
mergeConfidences
public static <T,C extends Confidence> void mergeConfidences(T termToEnrich, Collection<C> toEnrichConfidences, Collection<C> fetchedConfidences, boolean remove, ConfidencesChangeListener<T> confListener)
mergeConfidences.
- Type Parameters:
T- a T object.C- a C object.- Parameters:
termToEnrich- a T object.toEnrichConfidences- aCollectionobject.fetchedConfidences- aCollectionobject.remove- a boolean.confListener- aConfidencesChangeListenerobject.
-
mergeParameters
public static <T,P extends Parameter> void mergeParameters(T termToEnrich, Collection<P> toEnrichParameters, Collection<P> fetchedParameters, boolean remove, ParametersChangeListener<T> paramListener)
mergeParameters.
- Type Parameters:
T- a T object.P- a P object.- Parameters:
termToEnrich- a T object.toEnrichParameters- aCollectionobject.fetchedParameters- aCollectionobject.remove- a boolean.paramListener- aParametersChangeListenerobject.
-
mergeParticipants
public static <P extends Participant> void mergeParticipants(Interaction termToEnrich, Collection<P> toEnrichParticipants, Collection<P> fetchedParticipants, boolean remove, InteractionChangeListener interactionListener, ParticipantEnricher participantEnricher) throws EnricherException
mergeParticipants.
- Type Parameters:
P- a P object.- Parameters:
termToEnrich- aInteractionobject.toEnrichParticipants- aCollectionobject.fetchedParticipants- aCollectionobject.remove- a boolean.interactionListener- aInteractionChangeListenerobject.participantEnricher- aParticipantEnricherobject.- Throws:
EnricherException- if any.
-
mergeParticipantCandidates
public static <P extends ParticipantCandidate> void mergeParticipantCandidates(ParticipantPool termToEnrich, Collection<P> toEnrichParticipants, Collection<P> fetchedParticipants, boolean remove, ParticipantPoolChangeListener poolListener, EntityEnricher participantEnricher) throws EnricherException
mergeParticipantCandidates.
- Type Parameters:
P- a P object.- Parameters:
termToEnrich- aParticipantPoolobject.toEnrichParticipants- aCollectionobject.fetchedParticipants- aCollectionobject.remove- a boolean.poolListener- aParticipantPoolChangeListenerobject.participantEnricher- aEntityEnricherobject.- Throws:
EnricherException- if any.
-
mergeCausalRelationships
public static void mergeCausalRelationships(Entity termToEnrich, Collection<CausalRelationship> toEnrichRelationships, Collection<CausalRelationship> fetchedRelationships, boolean remove, EntityChangeListener entityListener) throws EnricherException
mergeCausalRelationships.
- Parameters:
termToEnrich- aEntityobject.toEnrichRelationships- aCollectionobject.fetchedRelationships- aCollectionobject.remove- a boolean.entityListener- aEntityChangeListenerobject.- Throws:
EnricherException- if any.
-
mergeFeatures
public static <F extends Feature> void mergeFeatures(Entity termToEnrich, Collection<F> toEnrichFeatures, Collection<F> fetchedFeatures, boolean remove, EntityChangeListener entityListener, FeatureEnricher<F> featureEnricher) throws EnricherException
mergeFeatures.
- Type Parameters:
F- a F object.- Parameters:
termToEnrich- aEntityobject.toEnrichFeatures- aCollectionobject.fetchedFeatures- aCollectionobject.remove- a boolean.entityListener- aEntityChangeListenerobject.featureEnricher- aFeatureEnricherobject.- Throws:
EnricherException- if any.
-
-