|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.bio.seq.FilterUtils
A set of FeatureFilter algebraic operations.
Nested Class Summary | |
class |
FilterUtils.DelegatingTransformer
An implementation of FilterTransformer that attempts to transform by one transformer, and if that fails, by another. |
static interface |
FilterUtils.FilterTransformer
An object able to transform some FeatureFilter instances sytematically into others. |
Constructor Summary | |
FilterUtils()
|
Method Summary | |
static FeatureFilter |
all()
|
static FeatureFilter |
and(FeatureFilter[] filters)
|
static FeatureFilter |
and(FeatureFilter c1,
FeatureFilter c2)
|
static boolean |
areDisjoint(FeatureFilter a,
FeatureFilter b)
Determines is two queries can be proven to be disjoint. |
static boolean |
areEqual(FeatureFilter f1,
FeatureFilter f2)
|
static boolean |
areProperSubset(FeatureFilter sub,
FeatureFilter sup)
Determines if the set of features matched by sub can be proven to be a
proper subset of the features matched by sup. |
static FeatureFilter |
byAncestor(FeatureFilter ancestorFilter)
|
static FeatureFilter |
byAnnotation(java.lang.Object key,
java.lang.Object value)
|
static FeatureFilter |
byAnnotationType(AnnotationType type)
|
static FeatureFilter |
byAnnotationType(java.lang.Object key,
java.lang.Class valClass)
|
static FeatureFilter |
byChild(FeatureFilter childFilter)
|
static FeatureFilter |
byClass(java.lang.Class clazz)
|
static FeatureFilter |
byComponentName(java.lang.String compName)
|
static FeatureFilter |
byDescendant(FeatureFilter descFilter)
|
static FeatureFilter |
byFrame(FramedFeature.ReadingFrame frame)
|
static FeatureFilter |
byPairwiseScore(double minScore,
double maxScore)
|
static FeatureFilter |
byParent(FeatureFilter parentFilter)
|
static FeatureFilter |
bySequenceName(java.lang.String name)
|
static FeatureFilter |
bySource(java.lang.String source)
|
static FeatureFilter |
byStrand(StrandedFeature.Strand strand)
|
static FeatureFilter |
byType(java.lang.String type)
|
static FeatureFilter |
containedByLocation(Location loc)
|
static Location |
extractOverlappingLocation(FeatureFilter ff)
Try to determine the minimal location which all features matching a given filter must overlap. |
static FeatureFilter |
hasAnnotation(java.lang.Object key)
|
static FeatureFilter |
leaf()
|
static FeatureFilter |
none()
|
static FeatureFilter |
not(FeatureFilter filter)
|
static FeatureFilter |
optimize(FeatureFilter filter)
|
static FeatureFilter |
or(FeatureFilter[] filters)
|
static FeatureFilter |
or(FeatureFilter c1,
FeatureFilter c2)
|
static FeatureFilter |
overlapsLocation(Location loc)
|
static FeatureFilter |
topLevel()
|
static FeatureFilter |
transformFilter(FeatureFilter ff,
FilterUtils.FilterTransformer trans)
This is a general framework method for transforming one filter into another. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FilterUtils()
Method Detail |
public static boolean areProperSubset(FeatureFilter sub, FeatureFilter sup)
proven
to be a
proper subset of the features matched by sup.
If the filter sub matches only features that are matched by sup, then it is a proper subset. It is still a proper subset if it does not match every feature in sup, as long as no feature matches sub that is rejected by sup.
sub
- the subset filtersup
- the superset filter
true
if sub
is a proper subset of sup
public static boolean areDisjoint(FeatureFilter a, FeatureFilter b)
They are disjoint if there is no element that is matched by both filters - that is, they have an empty intersection. Order of arguments to this method is not significant.
a
- the first FeatureFilterb
- the second FeatureFilter
true
if they are proved to be disjoint, false
otherwisepublic static Location extractOverlappingLocation(FeatureFilter ff)
ff
- A feature filter
ff
must overlap, or null
if no proof is possible
(normally indicates that the filter has nothing to do with
location).public static final boolean areEqual(FeatureFilter f1, FeatureFilter f2)
public static final FeatureFilter byType(java.lang.String type)
public static final FeatureFilter bySource(java.lang.String source)
public static final FeatureFilter byClass(java.lang.Class clazz) throws java.lang.ClassCastException
java.lang.ClassCastException
public static final FeatureFilter containedByLocation(Location loc)
public static final FeatureFilter overlapsLocation(Location loc)
public static final FeatureFilter bySequenceName(java.lang.String name)
public static final FeatureFilter not(FeatureFilter filter)
public static final FeatureFilter and(FeatureFilter c1, FeatureFilter c2)
public static final FeatureFilter and(FeatureFilter[] filters)
public static final FeatureFilter or(FeatureFilter c1, FeatureFilter c2)
public static final FeatureFilter or(FeatureFilter[] filters)
public static final FeatureFilter byAnnotationType(AnnotationType type)
public static final FeatureFilter byAnnotation(java.lang.Object key, java.lang.Object value)
public static final FeatureFilter byAnnotationType(java.lang.Object key, java.lang.Class valClass)
public static final FeatureFilter hasAnnotation(java.lang.Object key)
public static final FeatureFilter byStrand(StrandedFeature.Strand strand)
public static final FeatureFilter byParent(FeatureFilter parentFilter)
public static final FeatureFilter byAncestor(FeatureFilter ancestorFilter)
public static final FeatureFilter byChild(FeatureFilter childFilter)
public static final FeatureFilter byDescendant(FeatureFilter descFilter)
public static final FeatureFilter byFrame(FramedFeature.ReadingFrame frame)
public static final FeatureFilter byPairwiseScore(double minScore, double maxScore)
public static final FeatureFilter byComponentName(java.lang.String compName)
public static final FeatureFilter topLevel()
public static final FeatureFilter leaf()
public static final FeatureFilter all()
public static final FeatureFilter none()
public static final FeatureFilter optimize(FeatureFilter filter)
public static FeatureFilter transformFilter(FeatureFilter ff, FilterUtils.FilterTransformer trans)
This is a general framework method for transforming one filter into another. This method will handle the logical elements of a query (and, or, not) and delegate all the domain-specific munging to a FilterTransformer object.
The transformer could flip strands and locations of elements of a filter, add or remove attributes required in annotations, or systematically alter feature types or sources.
ff
- the FeatureFilter to transformtrans
- a FilterTransformer encapsulating rules about how to transform filters
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |