Package org.biojava.bio.seq.distributed
Class SequenceDBDataSource
java.lang.Object
org.biojava.bio.seq.distributed.SequenceDBDataSource
- All Implemented Interfaces:
DistDataSource
Turn an entire SequenceDB instance into a DistDataSource.
This is very usefull for providing the 'reference' sequence and feature set
upon which you can layer any other features you have.
- Author:
- Thomas Down
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFeatures(String id, FeatureFilter ff, boolean recurse) Get all features matching a FeatureFilter on a Sequence with an ID and recurse flats.Get all features matching a FeatureFilter provided by this DistDataSource.getSequence(String id) Get a Sequence object for an ID.booleanhasFeatures(String id) Find out if this DistDataSource can provide features on a sequence with a particular ID.booleanhasSequence(String id) Find out if this DistDataSource provides the sequence information for a sequence ID.ids(boolean topLevel) Get the complete set of sequence IDs provided by this DistDataSource.
-
Constructor Details
-
SequenceDBDataSource
-
-
Method Details
-
hasSequence
Description copied from interface:DistDataSourceFind out if this DistDataSource provides the sequence information for a sequence ID.- Specified by:
hasSequencein interfaceDistDataSource- Parameters:
id- the String id of a sequence- Returns:
- true if this DistDataSource provides the primary sequence, false otherwise
- Throws:
BioException
-
hasFeatures
Description copied from interface:DistDataSourceFind out if this DistDataSource can provide features on a sequence with a particular ID.- Specified by:
hasFeaturesin interfaceDistDataSource- Parameters:
id- the String id of a sequence- Returns:
- true if this DistDataSource provides features for the sequence, false otherwise
- Throws:
BioException
-
getFeatures
Description copied from interface:DistDataSourceGet all features matching a FeatureFilter provided by this DistDataSource. You can simulate getFeatures(id, ff, recurse) by using the advanced FeatureFilter implementations.- Specified by:
getFeaturesin interfaceDistDataSource- Parameters:
ff- the FeatureFilter to search with- Returns:
- a FeatureHolder with all matching filters
- Throws:
BioException
-
getFeatures
Description copied from interface:DistDataSourceGet all features matching a FeatureFilter on a Sequence with an ID and recurse flats. You can simulate getFeatures(ff) by adding the apropreate FeatureFilter implementations.- Specified by:
getFeaturesin interfaceDistDataSource- Parameters:
id- the ID of the Sequenceff- the FeatureFilter to search withrecurse- true if we are to recurse the feature hierachy, false otherwise- Returns:
- a FeatureHolder containing all feature matching
- Throws:
BioException- if the features could not be fetched
-
getSequence
Description copied from interface:DistDataSourceGet a Sequence object for an ID.- Specified by:
getSequencein interfaceDistDataSource- Parameters:
id- the ID of the Sequence to fetch- Returns:
- a Seqeunce if hasSequence(id) would return true
- Throws:
BioException- if either the ID could not be resolved or if the sequence could not be fetched
-
ids
Description copied from interface:DistDataSourceGet the complete set of sequence IDs provided by this DistDataSource.
If the recurse flat is true, the IDs associated with the top level will be returned. However, if it is false, then IDs should be returned for all levels of an assembly hierachy including the top level IDs.
- Specified by:
idsin interfaceDistDataSource- Parameters:
topLevel- if true, return top level IDs, otherwise all IDs- Returns:
- a Set of String IDs
- Throws:
BioException- if the IDs could not be fetched
-