Class MinimalFeatureEnricher<F extends Feature>
- java.lang.Object
-
- psidev.psi.mi.jami.enricher.impl.minimal.MinimalFeatureEnricher<F>
-
- All Implemented Interfaces:
EventListener,FeatureEnricher<F>,EnricherListener<Protein>,InteractorEnricherListener<Protein>,ProteinEnricherListener,MIEnricher<F>,ProteinListeningFeatureEnricher<F>,AliasesChangeListener<Protein>,AnnotationsChangeListener<Protein>,ChecksumsChangeListener<Protein>,IdentifiersChangeListener<Protein>,InteractorChangeListener<Protein>,PolymerChangeListener<Protein>,ProteinChangeListener,XrefsChangeListener<Protein>
- Direct Known Subclasses:
FullFeatureEnricher,MinimalFeatureEvidenceEnricher,MinimalFeatureUpdater
public class MinimalFeatureEnricher<F extends Feature> extends Object implements ProteinListeningFeatureEnricher<F>
Provides minimal enrichment of feature. - enrich shortName if not set - enrich fullName if not set - enrich feature type with CvTerm enricher if not null. It will not override any existing feature type - enrich identifiers. Only add missing identifiers (using DefaultXrefComparator) - Ignore all other properties of a feature- Since:
- 13/08/13
- Author:
- Gabriel Aldam (galdam@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description MinimalFeatureEnricher()Constructor for MinimalFeatureEnricher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenrich(F featureToEnrich)Enrichment of a single feature.voidenrich(F objectToEnrich, F objectSource)enrich.voidenrich(Collection<F> objects)enrich.CvTermEnrichergetCvTermEnricher()Gets the subEnricher for CvTerms.FeatureEnricherListener<F>getFeatureEnricherListener()Retrieves the listener of feature changes.voidonAddedAlias(Protein o, Alias added)Listen to the event where an alias has been added to the object aliases.voidonAddedAnnotation(Protein o, Annotation added)Listen to the event where an annotation has been added to the object annotations.voidonAddedChecksum(Protein interactor, Checksum added)Listen to the event where a checksum has been added to the interactor checksums.voidonAddedIdentifier(Protein o, Xref added)Listen to the event where an identifier has been added to the protein identifiers.voidonAddedXref(Protein o, Xref added)Listen to the event where a xref has been added to the protein xrefs.voidonEnrichmentComplete(Protein object, EnrichmentStatus status, String message)onEnrichmentComplete.voidonEnrichmentError(Protein object, String message, Exception e)onEnrichmentError.voidonFullNameUpdate(Protein interactor, String oldFullName)Listens for the event where the fullName has been changed.voidonInteractorTypeUpdate(Protein interactor, CvTerm old)Listen to the event where the interactor type has been initialised.protected voidonInvalidRange(F feature, Range range, Collection<String> errorMessages)onInvalidRange.voidonOrganismUpdate(Protein interactor, Organism o)Listen to the event where the organism of a interactor has been initialised.protected voidonOutOfDateRange(F feature, Range range, Collection<String> errorMessages, String oldSequence)onOutOfDateRange.voidonRemovedAlias(Protein o, Alias removed)Listen to the event where an alias has been removed from the object aliases.voidonRemovedAnnotation(Protein o, Annotation removed)Listen to the event where an annotation has been removed from the object annotations.voidonRemovedChecksum(Protein interactor, Checksum removed)Listen to the event where a checksum has been removed from the interactor checksums.voidonRemovedIdentifier(Protein o, Xref removed)Listen to the event where an identifier has been removed from the protein identifiers.voidonRemovedXref(Protein o, Xref removed)Listen to the event where a xref has been removed from the interactor xrefs.voidonSequenceUpdate(Protein protein, String oldSequence)Listen to the event where the sequence of a protein has been changed.voidonShortNameUpdate(Protein interactor, String oldShortName)Listens for the event where the shortName has been changed.protected voidprocessFeatureType(F featureToEnrich)processFeatureType.protected voidprocessFeatureType(F featureToEnrich, F objectSource)processFeatureType.protected voidprocessFullName(F objectToEnrich, F objectSource)processFullName.protected voidprocessIdentifiers(F objectToEnrich, F objectSource)processIdentifiers.voidprocessMinimalUpdates(F featureToEnrich)processMinimalUpdates.voidprocessMinimalUpdates(F objectToEnrich, F objectSource)processMinimalUpdates.protected voidprocessOtherProperties(F featureToEnrich)processOtherProperties.protected voidprocessOtherProperties(F featureToEnrich, F objectSource)processOtherProperties.protected voidprocessRanges(F featureToEnrich)processRanges.protected voidprocessRanges(F objectToEnrich, F objectSource)processRanges.protected voidprocessRangeStatus(CvTerm status)processRangeStatus.protected voidprocessShortLabel(F objectToEnrich, F objectSource)processShortLabel.voidsetCvTermEnricher(CvTermEnricher cvTermEnricher)setCvTermEnricher.voidsetFeatureEnricherListener(FeatureEnricherListener<F> featureEnricherListener)setFeatureEnricherListener.voidsetFeaturesWithRangesToUpdate(Collection<F> features)setFeaturesWithRangesToUpdate.protected booleanupdateRangePositions()updateRangePositions.
-
-
-
Method Detail
-
enrich
public void enrich(F featureToEnrich) throws EnricherException
Enrichment of a single feature.- Specified by:
enrichin interfaceMIEnricher<F extends Feature>- Parameters:
featureToEnrich- The feature which is to be enriched.- Throws:
EnricherException- Thrown if problems are encountered in the fetcher
-
processMinimalUpdates
public void processMinimalUpdates(F featureToEnrich) throws EnricherException
processMinimalUpdates.
- Parameters:
featureToEnrich- a F object.- Throws:
EnricherException- if any.
-
processRanges
protected void processRanges(F featureToEnrich) throws EnricherException
processRanges.
- Parameters:
featureToEnrich- a F object.- Throws:
EnricherException- if any.
-
processRangeStatus
protected void processRangeStatus(CvTerm status) throws EnricherException
processRangeStatus.
- Parameters:
status- aCvTermobject.- Throws:
EnricherException- if any.
-
enrich
public void enrich(Collection<F> objects) throws EnricherException
enrich.
- Specified by:
enrichin interfaceMIEnricher<F extends Feature>- Parameters:
objects- aCollectionobject.- Throws:
EnricherException- if any.
-
enrich
public void enrich(F objectToEnrich, F objectSource) throws EnricherException
enrich.
- Specified by:
enrichin interfaceMIEnricher<F extends Feature>- Parameters:
objectToEnrich- a F object.objectSource- a F object.- Throws:
EnricherException- if any.
-
processMinimalUpdates
public void processMinimalUpdates(F objectToEnrich, F objectSource) throws EnricherException
processMinimalUpdates.
- Parameters:
objectToEnrich- a F object.objectSource- a F object.- Throws:
EnricherException- if any.
-
processRanges
protected void processRanges(F objectToEnrich, F objectSource) throws EnricherException
processRanges.
- Parameters:
objectToEnrich- a F object.objectSource- a F object.- Throws:
EnricherException- if any.
-
processIdentifiers
protected void processIdentifiers(F objectToEnrich, F objectSource) throws EnricherException
processIdentifiers.
- Parameters:
objectToEnrich- a F object.objectSource- a F object.- Throws:
EnricherException- if any.
-
processFullName
protected void processFullName(F objectToEnrich, F objectSource) throws EnricherException
processFullName.
- Parameters:
objectToEnrich- a F object.objectSource- a F object.- Throws:
EnricherException- if any.
-
processShortLabel
protected void processShortLabel(F objectToEnrich, F objectSource) throws EnricherException
processShortLabel.
- Parameters:
objectToEnrich- a F object.objectSource- a F object.- Throws:
EnricherException- if any.
-
processOtherProperties
protected void processOtherProperties(F featureToEnrich) throws EnricherException
processOtherProperties.
- Parameters:
featureToEnrich- a F object.- Throws:
EnricherException- if any.
-
processOtherProperties
protected void processOtherProperties(F featureToEnrich, F objectSource) throws EnricherException
processOtherProperties.
- Parameters:
featureToEnrich- a F object.objectSource- a F object.- Throws:
EnricherException- if any.
-
setFeaturesWithRangesToUpdate
public void setFeaturesWithRangesToUpdate(Collection<F> features)
setFeaturesWithRangesToUpdate.
- Specified by:
setFeaturesWithRangesToUpdatein interfaceFeatureEnricher<F extends Feature>- Parameters:
features- aCollectionobject.
-
setFeatureEnricherListener
public void setFeatureEnricherListener(FeatureEnricherListener<F> featureEnricherListener)
setFeatureEnricherListener.
Sets the listener of feature changes. Can be null.- Specified by:
setFeatureEnricherListenerin interfaceFeatureEnricher<F extends Feature>- Parameters:
featureEnricherListener- aFeatureEnricherListenerobject.
-
getFeatureEnricherListener
public FeatureEnricherListener<F> getFeatureEnricherListener()
Retrieves the listener of feature changes. May be null if changes are not being listened to.- Specified by:
getFeatureEnricherListenerin interfaceFeatureEnricher<F extends Feature>- Returns:
- The current listener of feature changes.
-
setCvTermEnricher
public void setCvTermEnricher(CvTermEnricher cvTermEnricher)
setCvTermEnricher.
Sets the subEnricher for CvTerms. Can be null.- Specified by:
setCvTermEnricherin interfaceFeatureEnricher<F extends Feature>- Parameters:
cvTermEnricher- aCvTermEnricherobject.
-
getCvTermEnricher
public CvTermEnricher getCvTermEnricher()
Gets the subEnricher for CvTerms. Can be null.- Specified by:
getCvTermEnricherin interfaceFeatureEnricher<F extends Feature>- Returns:
- The CvTerm enricher which is being used.
-
onSequenceUpdate
public void onSequenceUpdate(Protein protein, String oldSequence)
Listen to the event where the sequence of a protein has been changed. If oldSequence is null, it means that the sequence has been initialised. If the sequence of the protein is null, it means that the sequence of the protein has been reset- Specified by:
onSequenceUpdatein interfacePolymerChangeListener<F extends Feature>- Parameters:
protein- : updated polymeroldSequence- : old sequence
-
onShortNameUpdate
public void onShortNameUpdate(Protein interactor, String oldShortName)
Listens for the event where the shortName has been changed.- Specified by:
onShortNameUpdatein interfaceInteractorChangeListener<F extends Feature>- Parameters:
interactor- The interactor which has changed.oldShortName- The old shortName.
-
onFullNameUpdate
public void onFullNameUpdate(Protein interactor, String oldFullName)
Listens for the event where the fullName has been changed.- Specified by:
onFullNameUpdatein interfaceInteractorChangeListener<F extends Feature>- Parameters:
interactor- The interactor which has changed.oldFullName- The old fullName.
-
onOrganismUpdate
public void onOrganismUpdate(Protein interactor, Organism o)
Listen to the event where the organism of a interactor has been initialised. This event happens when a interactor does not have any organisms- Specified by:
onOrganismUpdatein interfaceInteractorChangeListener<F extends Feature>- Parameters:
interactor- The interactor which has changed.o- aOrganismobject.
-
onInteractorTypeUpdate
public void onInteractorTypeUpdate(Protein interactor, CvTerm old)
Listen to the event where the interactor type has been initialised. This event happens when a interactor does not have any interactor types- Specified by:
onInteractorTypeUpdatein interfaceInteractorChangeListener<F extends Feature>- Parameters:
interactor- The interactor which has changed.old- aCvTermobject.
-
onAddedAlias
public void onAddedAlias(Protein o, Alias added)
Listen to the event where an alias has been added to the object aliases.- Specified by:
onAddedAliasin interfaceAliasesChangeListener<F extends Feature>- Parameters:
o- The object which has changed.added- The added alias.
-
onRemovedAlias
public void onRemovedAlias(Protein o, Alias removed)
Listen to the event where an alias has been removed from the object aliases.- Specified by:
onRemovedAliasin interfaceAliasesChangeListener<F extends Feature>- Parameters:
o- The object which has changed.removed- The removed alias.
-
onAddedAnnotation
public void onAddedAnnotation(Protein o, Annotation added)
Listen to the event where an annotation has been added to the object annotations.- Specified by:
onAddedAnnotationin interfaceAnnotationsChangeListener<F extends Feature>- Parameters:
o- : the parent of this annotationadded- : the added annotation
-
onRemovedAnnotation
public void onRemovedAnnotation(Protein o, Annotation removed)
Listen to the event where an annotation has been removed from the object annotations.- Specified by:
onRemovedAnnotationin interfaceAnnotationsChangeListener<F extends Feature>- Parameters:
o- : the parent of this annotationremoved- : the removed annotation
-
onAddedChecksum
public void onAddedChecksum(Protein interactor, Checksum added)
Listen to the event where a checksum has been added to the interactor checksums.- Specified by:
onAddedChecksumin interfaceChecksumsChangeListener<F extends Feature>- Parameters:
interactor- The interactor which has changed.added- The added checksum.
-
onRemovedChecksum
public void onRemovedChecksum(Protein interactor, Checksum removed)
Listen to the event where a checksum has been removed from the interactor checksums.- Specified by:
onRemovedChecksumin interfaceChecksumsChangeListener<F extends Feature>- Parameters:
interactor- The interactor which has changed.removed- The removed checksum.
-
onAddedIdentifier
public void onAddedIdentifier(Protein o, Xref added)
Listen to the event where an identifier has been added to the protein identifiers.- Specified by:
onAddedIdentifierin interfaceIdentifiersChangeListener<F extends Feature>- Parameters:
o- The object which has changed.added- The added identifier
-
onRemovedIdentifier
public void onRemovedIdentifier(Protein o, Xref removed)
Listen to the event where an identifier has been removed from the protein identifiers.- Specified by:
onRemovedIdentifierin interfaceIdentifiersChangeListener<F extends Feature>- Parameters:
o- The object which has changed.removed- The removed identifier.
-
onAddedXref
public void onAddedXref(Protein o, Xref added)
Listen to the event where a xref has been added to the protein xrefs.- Specified by:
onAddedXrefin interfaceXrefsChangeListener<F extends Feature>- Parameters:
o- The object which has changed.added- The added Xref.
-
onRemovedXref
public void onRemovedXref(Protein o, Xref removed)
Listen to the event where a xref has been removed from the interactor xrefs.- Specified by:
onRemovedXrefin interfaceXrefsChangeListener<F extends Feature>- Parameters:
o- The object which has changed.removed- The removed Xref.
-
processFeatureType
protected void processFeatureType(F featureToEnrich) throws EnricherException
processFeatureType.
- Parameters:
featureToEnrich- a F object.- Throws:
EnricherException- if any.
-
processFeatureType
protected void processFeatureType(F featureToEnrich, F objectSource) throws EnricherException
processFeatureType.
- Parameters:
featureToEnrich- a F object.objectSource- a F object.- Throws:
EnricherException- if any.
-
onInvalidRange
protected void onInvalidRange(F feature, Range range, Collection<String> errorMessages)
onInvalidRange.
- Parameters:
feature- a F object.range- aRangeobject.errorMessages- aCollectionobject.
-
onOutOfDateRange
protected void onOutOfDateRange(F feature, Range range, Collection<String> errorMessages, String oldSequence)
onOutOfDateRange.
- Parameters:
feature- a F object.range- aRangeobject.errorMessages- aCollectionobject.oldSequence- aStringobject.
-
updateRangePositions
protected boolean updateRangePositions()
updateRangePositions.
- Returns:
- a boolean.
-
onEnrichmentComplete
public void onEnrichmentComplete(Protein object, EnrichmentStatus status, String message)
onEnrichmentComplete.
- Specified by:
onEnrichmentCompletein interfaceEnricherListener<F extends Feature>- Parameters:
object- a T object.status- aEnrichmentStatusobject.message- aStringobject.
-
onEnrichmentError
public void onEnrichmentError(Protein object, String message, Exception e)
onEnrichmentError.
- Specified by:
onEnrichmentErrorin interfaceEnricherListener<F extends Feature>- Parameters:
object- a T object.message- aStringobject.e- aExceptionobject.
-
-