org.biojavax.bio.db.biosql
Interface BioSQLFeatureFilter

All Superinterfaces:
FeatureFilter, java.io.Serializable
All Known Implementing Classes:
BioSQLAcceptAllFilter, BioSQLAcceptNoneFilter, BioSQLFeatureFilter.And, BioSQLFeatureFilter.ByName, BioSQLFeatureFilter.ByNote, BioSQLFeatureFilter.ByNoteTermOnly, BioSQLFeatureFilter.ByRank, BioSQLFeatureFilter.BySequenceName, BioSQLFeatureFilter.BySourceTerm, BioSQLFeatureFilter.BySourceTermName, BioSQLFeatureFilter.ByStrand, BioSQLFeatureFilter.ByTypeTerm, BioSQLFeatureFilter.ByTypeTermName, BioSQLFeatureFilter.ContainedByRichLocation, BioSQLFeatureFilter.HibernateFeatureFilter, BioSQLFeatureFilter.Not, BioSQLFeatureFilter.Or, BioSQLFeatureFilter.OverlapsRichLocation

public interface BioSQLFeatureFilter
extends FeatureFilter

A filter for accepting or rejecting a feature.

It is possible to write custom FeatureFilters by implementing this interface. There are also a wide range of built-in features, and it is possible to build complex queries using FeatureFilter.And, FeatureFilter.Or, and FeatureFilter.Not. Where possible, use of the built-in filters is preferable to writing new filters, since the methods in the FilterUtils class have access to special knowledge about the built-in filter types and how they relate to one another.

If the filter is to be used in a remote process, it is recognized that it may be serialized and sent over to run remotely, rather than each feature being retrieved locally.

This class requires the Hibernate JAR files to be on your classpath at runtime. It is designed ONLY for use with BioSQLRichSequenceDB and BioSQLBioEntryDB.

Since:
1.5, 1.5
Author:
Matthew Pocock, Thomas Down, Richard Holland

Nested Class Summary
static class BioSQLFeatureFilter.And
          A filter that returns all features accepted by both child filter.
static class BioSQLFeatureFilter.ByName
          Construct one of these to filter features by display name.
static class BioSQLFeatureFilter.ByNote
          A filter that returns all features that have the given note, and the value and rank is checked as well.
static class BioSQLFeatureFilter.ByNoteTermOnly
          A filter that returns all features that have a note with the given term.
static class BioSQLFeatureFilter.ByRank
          Construct one of these to filter features by rank.
static class BioSQLFeatureFilter.BySequenceName
          Accept features that reside on a sequence with a particular name.
static class BioSQLFeatureFilter.BySourceTerm
          Construct one of these to filter features by source.
static class BioSQLFeatureFilter.BySourceTermName
          Construct one of these to filter features by source (name only - parent ontology is ignored).
static class BioSQLFeatureFilter.ByStrand
          A filter that returns all features having locations on a given strand.
static class BioSQLFeatureFilter.ByTypeTerm
          Construct one of these to filter features by type.
static class BioSQLFeatureFilter.ByTypeTermName
          Construct one of these to filter features by type (name only - parent ontology is ignored).
static class BioSQLFeatureFilter.ContainedByRichLocation
          A filter that returns all features contained within a location.
static class BioSQLFeatureFilter.HibernateFeatureFilter
          A filter for Hibernate-BioSQL filters to extend.
static class BioSQLFeatureFilter.Not
          A filter that returns all features not accepted by a child filter.
static class BioSQLFeatureFilter.Or
          A filter that returns all features accepted by at least one child filter.
static class BioSQLFeatureFilter.OverlapsRichLocation
          A filter that returns all features overlapping a location.
static class BioSQLFeatureFilter.Tools
          A class representing some useful stuff you can do with BioSQLFeatureFilters, for instance converting plain FeatureFilters into a their BioSQLFeatureFilter equivalents (where possible).
 
Nested classes/interfaces inherited from interface org.biojava.bio.seq.FeatureFilter
FeatureFilter.AnnotationContains, FeatureFilter.ByAncestor, FeatureFilter.ByAnnotation, FeatureFilter.ByAnnotationType, FeatureFilter.ByChild, FeatureFilter.ByClass, FeatureFilter.ByComponentName, FeatureFilter.ByDescendant, FeatureFilter.ByFeature, FeatureFilter.ByPairwiseScore, FeatureFilter.ByParent, FeatureFilter.BySource, FeatureFilter.ByType, FeatureFilter.ContainedByLocation, FeatureFilter.FrameFilter, FeatureFilter.HasAnnotation, FeatureFilter.OnlyChildren, FeatureFilter.OnlyDescendants, FeatureFilter.OverlapsLocation, FeatureFilter.ShadowContainedByLocation, FeatureFilter.ShadowOverlapsLocation, FeatureFilter.StrandFilter
 
Field Summary
static BioSQLFeatureFilter all
          All features are selected by this filter.
static BioSQLFeatureFilter none
          No features are selected by this filter.
 
Fields inherited from interface org.biojava.bio.seq.FeatureFilter
leaf, top_level
 
Method Summary
 java.lang.Object asCriterion()
          This method returns a Hibernate Criterion object that can be used to query the database.
 java.util.Map criterionAliasMap()
          Returns a map of property names (keys) to aliases (values), if the criterion returned by asCriterion() uses aliases at all.
 
Methods inherited from interface org.biojava.bio.seq.FeatureFilter
accept
 

Field Detail

all

static final BioSQLFeatureFilter all
All features are selected by this filter.


none

static final BioSQLFeatureFilter none
No features are selected by this filter.

Method Detail

asCriterion

java.lang.Object asCriterion()
This method returns a Hibernate Criterion object that can be used to query the database.

Returns:
a Hibernate Criterion object representing this filter.

criterionAliasMap

java.util.Map criterionAliasMap()
Returns a map of property names (keys) to aliases (values), if the criterion returned by asCriterion() uses aliases at all. If not, then it must at least return the empty map else you'll get NullPointerExceptions thrown elsewhere.

Returns:
Map a map of property names to aliases used in the criterion.