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 String
BLANK_SPACE
ConstantBLANK_SPACE="-"
static String
COLUMN_SEPARATOR
ConstantCOLUMN_SEPARATOR="\t"
static String
NEW_LINE
ConstantNEW_LINE="\n"
-
Constructor Summary
Constructors Constructor Description EnricherUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> void
mergeAliases(T termToEnrich, Collection<Alias> toEnrichAliases, Collection<Alias> fetchedAliases, boolean remove, AliasesChangeListener<T> aliasListener)
mergeAliases.static <T> void
mergeAnnotations(T termToEnrich, Collection<Annotation> toEnrichAnnotations, Collection<Annotation> fetchedAnnotations, boolean remove, AnnotationsChangeListener<T> annotationListener)
mergeAnnotations.static void
mergeCausalRelationships(Entity termToEnrich, Collection<CausalRelationship> toEnrichRelationships, Collection<CausalRelationship> fetchedRelationships, boolean remove, EntityChangeListener entityListener)
mergeCausalRelationships.static <T> void
mergeChecksums(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> 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.
-
-
-
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
- aCollection
object.xrefListener
- aXrefsChangeListener
object.identifierListener
- aIdentifiersChangeListener
object.
-
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
- aCollection
object.fetchedRanges
- aCollection
object.remove
- a boolean.featureListener
- aFeatureChangeListener
object.
-
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
- aCollection
object.fetchedAliases
- aCollection
object.remove
- a boolean.aliasListener
- aAliasesChangeListener
object.
-
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
- aCollection
object.fetchedCehcksum
- aCollection
object.remove
- a boolean.aliasListener
- aChecksumsChangeListener
object.
-
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
- aCollection
object.fetchedAnnotations
- aCollection
object.remove
- a boolean.annotationListener
- aAnnotationsChangeListener
object.
-
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
- aCollection
object.fetchedConfidences
- aCollection
object.remove
- a boolean.confListener
- aConfidencesChangeListener
object.
-
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
- aCollection
object.fetchedParameters
- aCollection
object.remove
- a boolean.paramListener
- aParametersChangeListener
object.
-
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
- aInteraction
object.toEnrichParticipants
- aCollection
object.fetchedParticipants
- aCollection
object.remove
- a boolean.interactionListener
- aInteractionChangeListener
object.participantEnricher
- aParticipantEnricher
object.- 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
- aParticipantPool
object.toEnrichParticipants
- aCollection
object.fetchedParticipants
- aCollection
object.remove
- a boolean.poolListener
- aParticipantPoolChangeListener
object.participantEnricher
- aEntityEnricher
object.- 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
- aEntity
object.toEnrichRelationships
- aCollection
object.fetchedRelationships
- aCollection
object.remove
- a boolean.entityListener
- aEntityChangeListener
object.- 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
- aEntity
object.toEnrichFeatures
- aCollection
object.fetchedFeatures
- aCollection
object.remove
- a boolean.entityListener
- aEntityChangeListener
object.featureEnricher
- aFeatureEnricher
object.- Throws:
EnricherException
- if any.
-
-