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 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
addin interfaceCollection<Marker>
-
add
Add all intervals -
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
Intersection between 'marker' and all sub-intervals -
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
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:
removein interfaceCollection<Marker>
-
removeAll
- Specified by:
removeAllin interfaceCollection<Marker>
-
retainAll
- Specified by:
retainAllin 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:
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
Remove duplicated markers- Returns:
- this object
-