Package org.snpeff.interval
Class Markers
java.lang.Object
org.snpeff.interval.Markers
- All Implemented Interfaces:
Serializable
,Iterable<Marker>
,Collection<Marker>
A collection of markers
- Author:
- pcingola
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Add an interval to the collectionAdd all intervalsboolean
addAll
(Collection<? extends Marker> mm) Add all markers in this collectionvoid
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
Are all intervals equal?get
(int i) int
Calculate the median point in this set of markersgetName()
Perform the intersection of all overlapping sub-intervalsIntersection between 'marker' and all sub-intervalsboolean
isEmpty()
iterator()
void
void
merge()
Merge overlapping intervals This is the same as 'union()' method, but the algorithm is more efficientCalculate 'set minus' using one intervalReturns the result of this set minus 'intervals'rand()
Return a random interval within this collectionstatic Markers
readMarkers
(String fileName) Read markers from a file Supported formats: BED, BigBed, VCF, TXTboolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) void
Save to a file using a serializervoid
Save to a file using a serializer Only save one chromosome ('chr') Note: This is used to save only markers related to one chromosome (e.g.void
int
size()
sort()
Sort intervalssort
(boolean byEnd, boolean reverse) Sort intervalsMarker[]
toArray()
<T> T[]
toArray
(T[] a) toString()
toStringAsciiArt
(int maxLen) Show all intervals as an ASCII artunion()
Perform the union of all overlapping intervalsunique()
Remove duplicated markersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Field Details
-
markers
-
name
-
-
Constructor Details
-
Markers
public Markers() -
Markers
-
Markers
-
Markers
-
-
Method Details
-
readMarkers
Read markers from a file Supported formats: BED, BigBed, VCF, TXT -
add
Add an interval to the collection- Specified by:
add
in interfaceCollection<Marker>
-
add
Add all intervals -
addAll
Add all markers in this collection- Specified by:
addAll
in interfaceCollection<Marker>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<Marker>
-
contains
- Specified by:
contains
in interfaceCollection<Marker>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<Marker>
-
equals
Are all intervals equal? -
get
-
getMarkers
-
getMedian
public int getMedian()Calculate the median point in this set of markers -
getName
-
setName
-
intersect
Perform the intersection of all overlapping sub-intervalsFor each marker, calculate all overlapping markers and create a new marker that contains them all. Return a set of those new markers.
-
intersect
Intersection between 'marker' and all sub-intervals -
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<Marker>
-
iterator
-
load
-
load
-
merge
Merge overlapping intervals This is the same as 'union()' method, but the algorithm is more efficient -
minus
Calculate 'set minus' using one interval- Parameters:
interval
-- Returns:
-
minus
Returns the result of this set minus 'intervals'WARNING: This method should only be used for debugging (or in very small collections) since it is extremely inefficient.
-
rand
Return a random interval within this collection -
remove
- Specified by:
remove
in interfaceCollection<Marker>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<Marker>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<Marker>
-
save
Save to a file using a serializer -
save
Save to a file using a serializer Only save one chromosome ('chr') Note: This is used to save only markers related to one chromosome (e.g. when saving GenomicSequences) -
size
public int size()- Specified by:
size
in interfaceCollection<Marker>
-
sort
Sort intervals -
sort
Sort intervals- Parameters:
byEnd
- : If true, sort by end. Otherwise sort by startreverse
- : Reverse order
-
toArray
- Specified by:
toArray
in interfaceCollection<Marker>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArray
in interfaceCollection<Marker>
-
toString
-
toStringAsciiArt
Show all intervals as an ASCII art -
toStringTxt
-
union
Perform the union of all overlapping intervalsFor each marker, calculate all overlapping markers and create a new marker that contains them all. Return a set of those new markers.
-
unique
Remove duplicated markers- Returns:
- this object
-