|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<E> java.util.ArrayList<FeatureI> javagene.seq.FeatureList
public class FeatureList
A list of FeatureI objects implemented using a Java ArrayList; corresponds to a GFF file. This class is implemented entirely using FeatureI objects, so everything here will work correctly if you choose to implement your own feature class -- there are no dependencies on JavaGene's native Feature class.
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
FeatureList()
Construct an empty list. |
|
FeatureList(java.util.Collection<FeatureI> features)
Construct a new list containing the same features as the specified list. |
Method Summary | |
---|---|
void |
add(java.util.Collection<FeatureI> list)
Add all features in the specified list or collection to this list. |
boolean |
add(FeatureI feature)
Add specified feature to the end of the list. |
java.util.Collection<java.lang.String> |
attributeValues(java.lang.String key)
Create a collection of the unique values for the specified key. |
Location |
bounds()
The union of all locations of all features in this list, mapped to the positive strand. |
java.util.Collection<java.lang.String> |
groupValues()
Create a collection of all unique group ids in the list, as defined by the group() method of the features. |
boolean |
hasAttribute(java.lang.String key)
Check if any feature in list has the specified attribute key. |
boolean |
hasAttribute(java.lang.String key,
java.lang.String value)
Check if any feature in list has the specified attribute key/value pair. |
boolean |
hasGaps(int gapLength)
Check size of gaps between successive features in list. |
FeatureList |
omitOverlapping(Location location,
boolean useBothStrands)
Create a list of all features that do not overlap the specified location. |
FeatureList |
selectByAttribute(java.lang.String key)
Create a list of all features that include the specified attribute key. |
FeatureList |
selectByAttribute(java.lang.String key,
java.lang.String value)
Create a list of all features that include the specified attribute key/value pair. |
FeatureList |
selectByGroup(java.lang.String groupid)
Create a list of all features that have the specified group id, as defined by the group() method of the features. |
FeatureList |
selectByType(java.lang.String type)
Create a list of all features that are of the specified type, as defined by the type() method of the features. |
FeatureList |
selectOverlapping(Location location,
boolean useBothStrands)
Create a list of all features that overlap the specified location. |
FeatureList |
sortByStart()
Create a new list that is ordered by the starting index of the features' locations. |
java.lang.String |
splice(SeqI sequence)
Concatenate successive portions of the specified sequence using the feature locations in the list. |
java.lang.String |
toString()
Return a string representation of all features in this list. |
Methods inherited from class java.util.ArrayList |
---|
add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, removeAll, retainAll |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
Constructor Detail |
---|
public FeatureList()
public FeatureList(java.util.Collection<FeatureI> features)
features
- An existing list or collection of FeatureI objects.Method Detail |
---|
public void add(java.util.Collection<FeatureI> list)
list
- The collection of FeatureI objects.public boolean add(FeatureI feature)
add
in interface java.util.Collection<FeatureI>
add
in interface java.util.List<FeatureI>
add
in class java.util.ArrayList<FeatureI>
feature
- The FeatureI object to add.
public java.util.Collection<java.lang.String> attributeValues(java.lang.String key)
public Location bounds()
public java.util.Collection<java.lang.String> groupValues()
public boolean hasAttribute(java.lang.String key)
key
- The attribute key to consider.
public boolean hasAttribute(java.lang.String key, java.lang.String value)
key
- The attribute key to consider.value
- The attribute value to consider.
public boolean hasGaps(int gapLength)
gapLength
- The minimum gap length to consider. Use a gapLength
of 0 to check if features are contiguous.
public FeatureList omitOverlapping(Location location, boolean useBothStrands)
location
- The location to check.useBothStrands
- If true, locations are mapped to their positive strand image
before being checked for overlap. If false, all features whose locations are
on the opposite strand from the specified location will be considered non-overlapping.public FeatureList selectByAttribute(java.lang.String key)
key
- The key to consider.
public FeatureList selectByAttribute(java.lang.String key, java.lang.String value)
key
- The key to consider.value
- The value to consider.
public FeatureList selectByGroup(java.lang.String groupid)
groupid
- The group to match.
public FeatureList selectByType(java.lang.String type)
type
- The type to match.
public FeatureList selectOverlapping(Location location, boolean useBothStrands) throws java.lang.Exception
location
- The location to check.useBothStrands
- If true, locations are mapped to their positive strand image
before being checked for overlap. If false, only features whose locations are
on the same strand as the specified location will be considered for inclusion.
java.lang.Exception
public FeatureList sortByStart()
java.lang.IndexOutOfBoundsException
- Cannot compare/sort features whose locations are on opposite strands.public java.lang.String splice(SeqI sequence)
sequence
- The source sequence from which portions should be selected.
java.lang.IllegalStateException
- Out of order or overlapping FeatureI locations detected.public java.lang.String toString()
toString
in class java.util.AbstractCollection<FeatureI>
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |