public class FeatureList extends ArrayList<FeatureI>
modCount
Constructor and Description |
---|
FeatureList()
Construct an empty list.
|
FeatureList(Collection<FeatureI> features)
Construct a new list containing the same features
as the specified list.
|
Modifier and Type | Method and Description |
---|---|
void |
add(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.
|
void |
addIndex(String index)
Add an attribute that will be used as index for queries
|
void |
addIndexes(List<String> indexes)
Add a list of attributes that will be used as indexes for queries
|
Collection<String> |
attributeValues(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.
|
Collection<String> |
groupValues()
Create a collection of all unique group ids in the list, as defined
by the group() method of the features.
|
boolean |
hasAttribute(String key)
Check if any feature in list has the specified attribute key.
|
boolean |
hasAttribute(String key,
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(String seqname,
Location location,
boolean useBothStrands)
Create a list of all features that do not overlap the specified location on the specified sequence.
|
FeatureList |
selectByAttribute(String key)
Create a list of all features that include the specified attribute key.
|
FeatureList |
selectByAttribute(String key,
String value)
Create a list of all features that include the specified attribute key/value pair.
|
FeatureList |
selectByGroup(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(String type)
Create a list of all features that are of the specified type, as defined by
the type() method of the features.
|
FeatureList |
selectByUserData(String key)
Create a list of all features that include the specified key in their userMap().
|
FeatureList |
selectByUserData(String key,
Object value)
Create a list of all features that include the specified key/value pair in their userMap().
|
FeatureList |
selectOverlapping(String seqname,
Location location,
boolean useBothStrands)
Create a list of all features that overlap the specified location on the specified
sequence.
|
FeatureList |
sortByStart()
Create a new list that is ordered by the starting index of the features' locations.
|
String |
splice(DNASequence sequence)
Concatenate successive portions of the specified sequence
using the feature locations in the list.
|
String |
toString()
Return a string representation of all features in this list.
|
add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
parallelStream, stream
public FeatureList()
public FeatureList(Collection<FeatureI> features)
features
- An existing list or collection of FeatureI objects.public boolean add(FeatureI feature)
public void add(Collection<FeatureI> list)
list
- The collection of FeatureI objects.public Location bounds()
public boolean hasGaps(int gapLength)
gapLength
- The minimum gap length to consider. Use a gapLength
of 0 to check if features are contiguous.public String splice(DNASequence sequence)
sequence
- The source sequence from which portions should be selected.IllegalStateException
- Out of order or overlapping FeatureI locations detected.public Collection<String> groupValues()
public Collection<String> attributeValues(String key)
public FeatureList selectByGroup(String groupid)
groupid
- The group to match.public FeatureList selectByType(String type)
type
- The type to match.public FeatureList selectByAttribute(String key, String value)
key
- The key to consider.value
- The value to consider.public FeatureList selectByAttribute(String key)
key
- The key to consider.public FeatureList selectByUserData(String key, Object value)
key
- The key to consider.value
- The value to consider.public FeatureList selectByUserData(String key)
key
- The key to consider.public FeatureList selectOverlapping(String seqname, Location location, boolean useBothStrands) throws Exception
seqname
- The sequence name. Only features with this sequence name will be checked for overlap.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.Exception
public FeatureList omitOverlapping(String seqname, Location location, boolean useBothStrands)
seqname
- The sequence name. Only features with this sequence name will be checked for overlap.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 boolean hasAttribute(String key)
key
- The attribute key to consider.public boolean hasAttribute(String key, String value)
key
- The attribute key to consider.value
- The attribute value to consider.public String toString()
toString
in class AbstractCollection<FeatureI>
public FeatureList sortByStart()
IndexOutOfBoundsException
- Cannot compare/sort features whose locations are on opposite strands, or
whose seqnames differ.public void addIndexes(List<String> indexes)
indexes
- the List containing the attribute_idCopyright © 2000–2018 BioJava. All rights reserved.