Class MatchFilter
java.lang.Object
com.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.experiment.identification.filtering.MatchFilter
- All Implemented Interfaces:
Filter,Serializable
- Direct Known Subclasses:
AssumptionFilter,PeptideFilter,ProteinFilter,PsmFilter
Abstract representing a filter.
- Author:
- Marc Vaudel
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum for the type of possible filter. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HashMap<String, FilterItemComparator> Map of the comparators to use.protected StringDescription of the condition to meet to pass the filter.protected StringDescription of the filter.The exceptions to the rule.protected MatchFilter.FilterTypeThe type of filter.static final StringName of the manual selection filter.The key of the manually validated matches.protected StringName of the filter.protected StringReport when the filter is not passed.protected StringReport when the filter is passed.Map of the values to filter on.Fields inherited from class com.compomics.util.experiment.personalization.ExperimentObject
NO_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddException(long matchKey) Adds an exception.voidaddManualValidation(long matchKey) Adds a manually validated Match.voidclear()Clears the filter items.clone()Clones the filter.getComparatorForItem(String itemName) Returns the comparator set for a given filtering item.Returns a description of the condition to match for the filter to validate.Returns a description for the filter.Returns the exceptions to the rule.abstract FilterItemgetFilterItem(String itemName) Returns the filter item corresponding to the given name.Returns the name of the items used to filter.Returns the manually validated items.getName()Returns the name of the filter.protected abstract MatchFiltergetNew()Returns a new empty filter.abstract FilterItem[]Returns the filter items accepted by this filter.String[]Returns the filter items accepted by this filter.getReport(boolean filterPassed) Returns a filter report depending on whether the condition was met.getType()Return the type of the filter.Returns the value used for comparison for a given filtering item.booleanisActive()Indicates whether the filter is active.booleanIndicates whether another filter is the same as the current filter.booleanisValidated(long matchKey, Identification identification, GeneMaps geneMaps, IdentificationFeaturesGenerator identificationFeaturesGenerator, IdentificationParameters identificationParameters, SequenceProvider sequenceProvider, ProteinDetailsProvider proteinDetailsProvider, SpectrumProvider spectrumProvider) Tests whether a match is validated by this filter.abstract booleanisValidated(String itemName, FilterItemComparator filterItemComparator, Object value, long matchKey, Identification identification, GeneMaps geneMaps, IdentificationFeaturesGenerator identificationFeaturesGenerator, IdentificationParameters identificationParameters, SequenceProvider sequenceProvider, ProteinDetailsProvider proteinDetailsProvider, SpectrumProvider spectrumProvider) Indicates whether the match designated by the match key validates the given item using the given comparator and value threshold.voidremoveException(long matchKey) Removes an exception.voidremoveFilterItem(String itemName) Removes an item from the filter.voidremoveManualValidation(long matchKey) Removes a manually validated Match.voidsetActive(boolean active) Sets whether the filter is active.voidsetComparatorForItem(String itemName, FilterItemComparator filterItemComparator) Sets the comparator for a given item.voidsetCondition(String condition) Sets the description of the condition to meet.voidsetDescription(String description) Sets the description of the filter.voidsetExceptions(HashSet<Long> exceptions) Sets the excepted matches.voidsetFilterItem(String itemName, FilterItemComparator filterItemComparator, Object value) Sets an item to the filter.voidsetManualValidation(HashSet<Long> manualValidation) Sets the list of manually validated keys.voidSets the name of the filter.voidsetReportFailed(String reportFailed) Sets the report when the filter is not passed.voidsetReportPassed(String reportPassed) Sets the report when the filter is passed.voidsetType(MatchFilter.FilterType filterType) Sets the type of the filter.voidsetValueForItem(String itemName, Object value) Sets the value for a given item.Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject
addUrParam, asLong, clearParametersMap, getId, getUrParam, getUrParams, removeUrParam, setId, setUrParams
-
Field Details
-
name
Name of the filter. -
description
Description of the filter. -
condition
Description of the condition to meet to pass the filter. -
reportPassed
Report when the filter is passed. -
reportFailed
Report when the filter is not passed. -
manualValidation
The key of the manually validated matches. -
exceptions
The exceptions to the rule. -
MANUAL_SELECTION
Name of the manual selection filter.- See Also:
-
comparatorsMap
Map of the comparators to use. -
valuesMap
Map of the values to filter on. -
filterType
The type of filter.
-
-
Constructor Details
-
MatchFilter
public MatchFilter()Empty default constructor
-
-
Method Details
-
getName
Description copied from interface:FilterReturns the name of the filter. -
getDescription
Description copied from interface:FilterReturns a description for the filter.- Specified by:
getDescriptionin interfaceFilter- Returns:
- a description for the filter
-
getCondition
Description copied from interface:FilterReturns a description of the condition to match for the filter to validate.- Specified by:
getConditionin interfaceFilter- Returns:
- the condition to match for the filter to validate
-
getReport
Description copied from interface:FilterReturns a filter report depending on whether the condition was met. -
setName
Sets the name of the filter.- Parameters:
newName- the name to be given to the filter
-
setDescription
Sets the description of the filter.- Parameters:
description- the description of the filter
-
setCondition
Sets the description of the condition to meet.- Parameters:
condition- the description of the condition to meet
-
setReportPassed
Sets the report when the filter is passed.- Parameters:
reportPassed- the report when the filter is passed
-
setReportFailed
Sets the report when the filter is not passed.- Parameters:
reportFailed- the report when the filter is not passed
-
getType
Return the type of the filter.- Returns:
- the type of the filter
-
setType
Sets the type of the filter.- Parameters:
filterType- the type of the filter
-
isActive
public boolean isActive()Indicates whether the filter is active.- Returns:
- a boolean indicating whether the filter is active
-
setActive
public void setActive(boolean active) Sets whether the filter is active.- Parameters:
active- a boolean indicating whether the filter is active
-
getExceptions
Returns the exceptions to the rule.- Returns:
- the exceptions to the rule
-
getManualValidation
Returns the manually validated items.- Returns:
- the manually validated items
-
addManualValidation
public void addManualValidation(long matchKey) Adds a manually validated Match.- Parameters:
matchKey- the key of the match to add
-
setManualValidation
Sets the list of manually validated keys.- Parameters:
manualValidation- list of manually validated keys
-
addException
public void addException(long matchKey) Adds an exception.- Parameters:
matchKey- the key of the exception to add
-
setExceptions
Sets the excepted matches.- Parameters:
exceptions- the excepted matches
-
removeManualValidation
public void removeManualValidation(long matchKey) Removes a manually validated Match.- Parameters:
matchKey- the key of the match to remove
-
removeException
public void removeException(long matchKey) Removes an exception.- Parameters:
matchKey- the key of the exception to remove
-
getNew
Returns a new empty filter.- Returns:
- a new empty filter
-
clone
Description copied from interface:FilterClones the filter. -
removeFilterItem
Removes an item from the filter.- Parameters:
itemName- the name of the item to remove
-
setFilterItem
Sets an item to the filter.- Parameters:
itemName- the name of the item to filter onfilterItemComparator- the comparatorvalue- the value to filter
-
setComparatorForItem
Sets the comparator for a given item.- Parameters:
itemName- the name of the item to filter onfilterItemComparator- the comparator
-
setValueForItem
Sets the value for a given item.- Parameters:
itemName- the name of the item to filter onvalue- the comparator
-
getItemsNames
Returns the name of the items used to filter.- Returns:
- the name of the items used to filter
-
getComparatorForItem
Returns the comparator set for a given filtering item.- Parameters:
itemName- the name of the item- Returns:
- the comparator set for a given filtering item
-
getValue
Returns the value used for comparison for a given filtering item.- Parameters:
itemName- the name of the item- Returns:
- the value used for comparison for a given filtering item
-
clear
public void clear()Clears the filter items. -
isValidated
public boolean isValidated(long matchKey, Identification identification, GeneMaps geneMaps, IdentificationFeaturesGenerator identificationFeaturesGenerator, IdentificationParameters identificationParameters, SequenceProvider sequenceProvider, ProteinDetailsProvider proteinDetailsProvider, SpectrumProvider spectrumProvider) Tests whether a match is validated by this filter.- Parameters:
matchKey- the key of the matchidentification- the identification where to get the information fromgeneMaps- the gene mapsidentificationFeaturesGenerator- the identification features generator providing identification featuresidentificationParameters- the identification parameterssequenceProvider- the protein sequence providerproteinDetailsProvider- a provider for protein detailsspectrumProvider- the spectrum provider- Returns:
- a boolean indicating whether a match is validated by a given filter
-
isValidated
public abstract boolean isValidated(String itemName, FilterItemComparator filterItemComparator, Object value, long matchKey, Identification identification, GeneMaps geneMaps, IdentificationFeaturesGenerator identificationFeaturesGenerator, IdentificationParameters identificationParameters, SequenceProvider sequenceProvider, ProteinDetailsProvider proteinDetailsProvider, SpectrumProvider spectrumProvider) Indicates whether the match designated by the match key validates the given item using the given comparator and value threshold.- Parameters:
itemName- the name of the item to filter onfilterItemComparator- the comparator to usevalue- the value to use as a thresholdmatchKey- the key of the match of interestidentification- the identification objects where to get identification matches fromgeneMaps- the gene mapsidentificationFeaturesGenerator- the identification feature generator where to get identification featuresidentificationParameters- the identification parameters usedsequenceProvider- the protein sequence providerproteinDetailsProvider- the protein details providerspectrumProvider- the spectrum provider- Returns:
- a boolean indicating whether the match designated by the protein key validates the given item using the given comparator and value threshold.
-
isSameAs
Description copied from interface:FilterIndicates whether another filter is the same as the current filter. -
getPossibleFilterItems
Returns the filter items accepted by this filter.- Returns:
- the filter items accepted by this filter
-
getPossibleFilterItemsNames
Returns the filter items accepted by this filter.- Returns:
- the filter items accepted by this filter
-
getFilterItem
Returns the filter item corresponding to the given name.- Parameters:
itemName- the name of the filter item- Returns:
- the filter item corresponding to the given name
-