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 TypeMethodDescriptionbooleanAdd an interval to the collectionAdd all intervalsbooleanaddAll(Collection<? extends Marker> mm) Add all markers in this collectionvoidclear()booleanbooleancontainsAll(Collection<?> c) booleanAre all intervals equal?get(int i) intCalculate the median point in this set of markersgetName()Perform the intersection of all overlapping sub-intervalsIntersection between 'marker' and all sub-intervalsbooleanisEmpty()iterator()voidvoidmerge()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 MarkersreadMarkers(String fileName) Read markers from a file Supported formats: BED, BigBed, VCF, TXTbooleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) voidSave to a file using a serializervoidSave 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.voidintsize()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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Field Details
-
markers
-
name
-
-
Constructor Details
-
Markers
public Markers() -
Markers
-
Markers
-
Markers
-
-
Method Details
-
readMarkers
-
add
Add an interval to the collection- Specified by:
addin interfaceCollection<Marker>
-
add
-
addAll
Add all markers in this collection- Specified by:
addAllin interfaceCollection<Marker>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Marker>
-
contains
- Specified by:
containsin interfaceCollection<Marker>
-
containsAll
- Specified by:
containsAllin 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
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<Marker>
-
iterator
-
load
-
load
-
merge
Merge overlapping intervals This is the same as 'union()' method, but the algorithm is more efficient -
minus
-
minus
-
rand
Return a random interval within this collection -
remove
- Specified by:
removein interfaceCollection<Marker>
-
removeAll
- Specified by:
removeAllin interfaceCollection<Marker>
-
retainAll
- Specified by:
retainAllin interfaceCollection<Marker>
-
save
Save to a file using a serializer -
save
-
size
public int size()- Specified by:
sizein interfaceCollection<Marker>
-
sort
Sort intervals -
sort
Sort intervals- Parameters:
byEnd- : If true, sort by end. Otherwise sort by startreverse- : Reverse order
-
toArray
- Specified by:
toArrayin interfaceCollection<Marker>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin 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
-