public abstract class MatchFilter extends ExperimentObject implements Filter
Modifier and Type | Class and Description |
---|---|
static class |
MatchFilter.FilterType
Enum for the type of possible filter.
|
Modifier and Type | Field and Description |
---|---|
protected HashMap<String,FilterItemComparator> |
comparatorsMap
Map of the comparators to use.
|
protected String |
condition
Description of the condition to meet to pass the filter.
|
protected String |
description
Description of the filter.
|
protected HashSet<Long> |
exceptions
The exceptions to the rule.
|
protected MatchFilter.FilterType |
filterType
The type of filter.
|
static String |
MANUAL_SELECTION
Name of the manual selection filter.
|
protected HashSet<Long> |
manualValidation
The key of the manually validated matches.
|
protected String |
name
Name of the filter.
|
protected String |
reportFailed
Report when the filter is not passed.
|
protected String |
reportPassed
Report when the filter is passed.
|
protected HashMap<String,Object> |
valuesMap
Map of the values to filter on.
|
NO_KEY
Constructor and Description |
---|
MatchFilter()
Empty default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addException(long matchKey)
Adds an exception.
|
void |
addManualValidation(long matchKey)
Adds a manually validated Match.
|
void |
clear()
Clears the filter items.
|
MatchFilter |
clone()
Clones the filter.
|
FilterItemComparator |
getComparatorForItem(String itemName)
Returns the comparator set for a given filtering item.
|
String |
getCondition()
Returns a description of the condition to match for the filter to
validate.
|
String |
getDescription()
Returns a description for the filter.
|
HashSet<Long> |
getExceptions()
Returns the exceptions to the rule.
|
abstract FilterItem |
getFilterItem(String itemName)
Returns the filter item corresponding to the given name.
|
HashSet<String> |
getItemsNames()
Returns the name of the items used to filter.
|
HashSet<Long> |
getManualValidation()
Returns the manually validated items.
|
String |
getName()
Returns the name of the filter.
|
protected abstract MatchFilter |
getNew()
Returns a new empty filter.
|
abstract FilterItem[] |
getPossibleFilterItems()
Returns the filter items accepted by this filter.
|
String[] |
getPossibleFilterItemsNames()
Returns the filter items accepted by this filter.
|
String |
getReport(boolean filterPassed)
Returns a filter report depending on whether the condition was met.
|
MatchFilter.FilterType |
getType()
Return the type of the filter.
|
Object |
getValue(String itemName)
Returns the value used for comparison for a given filtering item.
|
boolean |
isActive()
Indicates whether the filter is active.
|
boolean |
isSameAs(Filter anotherFilter)
Indicates whether another filter is the same as the current filter.
|
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.
|
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.
|
void |
removeException(long matchKey)
Removes an exception.
|
void |
removeFilterItem(String itemName)
Removes an item from the filter.
|
void |
removeManualValidation(long matchKey)
Removes a manually validated Match.
|
void |
setActive(boolean active)
Sets whether the filter is active.
|
void |
setComparatorForItem(String itemName,
FilterItemComparator filterItemComparator)
Sets the comparator for a given item.
|
void |
setCondition(String condition)
Sets the description of the condition to meet.
|
void |
setDescription(String description)
Sets the description of the filter.
|
void |
setExceptions(HashSet<Long> exceptions)
Sets the excepted matches.
|
void |
setFilterItem(String itemName,
FilterItemComparator filterItemComparator,
Object value)
Sets an item to the filter.
|
void |
setManualValidation(HashSet<Long> manualValidation)
Sets the list of manually validated keys.
|
void |
setName(String newName)
Sets the name of the filter.
|
void |
setReportFailed(String reportFailed)
Sets the report when the filter is not passed.
|
void |
setReportPassed(String reportPassed)
Sets the report when the filter is passed.
|
void |
setType(MatchFilter.FilterType filterType)
Sets the type of the filter.
|
void |
setValueForItem(String itemName,
Object value)
Sets the value for a given item.
|
addUrParam, asLong, clearParametersMap, getId, getUrParam, getUrParams, removeUrParam, setId, setUrParams
protected String name
protected String description
protected String condition
protected String reportPassed
protected String reportFailed
protected HashSet<Long> manualValidation
public static final String MANUAL_SELECTION
protected HashMap<String,FilterItemComparator> comparatorsMap
protected MatchFilter.FilterType filterType
public String getName()
Filter
public String getDescription()
Filter
getDescription
in interface Filter
public String getCondition()
Filter
getCondition
in interface Filter
public String getReport(boolean filterPassed)
Filter
public void setName(String newName)
newName
- the name to be given to the filterpublic void setDescription(String description)
description
- the description of the filterpublic void setCondition(String condition)
condition
- the description of the condition to meetpublic void setReportPassed(String reportPassed)
reportPassed
- the report when the filter is passedpublic void setReportFailed(String reportFailed)
reportFailed
- the report when the filter is not passedpublic MatchFilter.FilterType getType()
public void setType(MatchFilter.FilterType filterType)
filterType
- the type of the filterpublic boolean isActive()
public void setActive(boolean active)
active
- a boolean indicating whether the filter is activepublic HashSet<Long> getExceptions()
public HashSet<Long> getManualValidation()
public void addManualValidation(long matchKey)
matchKey
- the key of the match to addpublic void setManualValidation(HashSet<Long> manualValidation)
manualValidation
- list of manually validated keyspublic void addException(long matchKey)
matchKey
- the key of the exception to addpublic void setExceptions(HashSet<Long> exceptions)
exceptions
- the excepted matchespublic void removeManualValidation(long matchKey)
matchKey
- the key of the match to removepublic void removeException(long matchKey)
matchKey
- the key of the exception to removeprotected abstract MatchFilter getNew()
public MatchFilter clone()
Filter
public void removeFilterItem(String itemName)
itemName
- the name of the item to removepublic void setFilterItem(String itemName, FilterItemComparator filterItemComparator, Object value)
itemName
- the name of the item to filter onfilterItemComparator
- the comparatorvalue
- the value to filterpublic void setComparatorForItem(String itemName, FilterItemComparator filterItemComparator)
itemName
- the name of the item to filter onfilterItemComparator
- the comparatorpublic void setValueForItem(String itemName, Object value)
itemName
- the name of the item to filter onvalue
- the comparatorpublic HashSet<String> getItemsNames()
public FilterItemComparator getComparatorForItem(String itemName)
itemName
- the name of the itempublic Object getValue(String itemName)
itemName
- the name of the itempublic void clear()
public boolean isValidated(long matchKey, Identification identification, GeneMaps geneMaps, IdentificationFeaturesGenerator identificationFeaturesGenerator, IdentificationParameters identificationParameters, SequenceProvider sequenceProvider, ProteinDetailsProvider proteinDetailsProvider, SpectrumProvider spectrumProvider)
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 providerpublic 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)
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 providerpublic boolean isSameAs(Filter anotherFilter)
Filter
public abstract FilterItem[] getPossibleFilterItems()
public String[] getPossibleFilterItemsNames()
public abstract FilterItem getFilterItem(String itemName)
itemName
- the name of the filter itemCopyright © 2021. All rights reserved.