Package org.snpeff.interval

# Class IntervalAndSubIntervals<T extends Marker>

java.lang.Object
org.snpeff.interval.Interval
org.snpeff.interval.Marker
org.snpeff.interval.IntervalAndSubIntervals<T>

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `Comparable<Interval>`, `Iterable<T>`, `TxtSerializable`

Direct Known Subclasses:
  `Gene`, `Transcript`

public class IntervalAndSubIntervals<T extends Marker> extends Marker implements Iterable<T>
Interval that contains sub intervals.

Author:
  pcingola
See Also:
  - Serialized Form

## Field Summary

### Fields inherited from class org.snpeff.interval.Marker

`type`

### Fields inherited from class org.snpeff.interval.Interval

`chromosomeNameOri, end, id, parent, start, strandMinus`

## Constructor Summary

Constructors
Constructor
Description
`IntervalAndSubIntervals()`
`IntervalAndSubIntervals(Marker parent, int start, int end, boolean strandMinus, String id)`

## Method Summary

Modifier and Type
Method
Description
`void`
`add(T t)`
Add a subinterval
`void`
`addAll(Iterable<T> ts)`
Add all intervals
`void`
`addAll(Markers markers)`
Add all markers
`IntervalAndSubIntervals<T>`
`apply(Variant variant)`
Apply a variant.
`IntervalAndSubIntervals<T>`
`clone()`
`IntervalAndSubIntervals<T>`
`cloneShallow()`
Perform a shallow clone
`boolean`
`containsId(String id)`
Is 'id' in the subintervals?
`T`
`get(String id)`
Obtain a subinterval
`protected void`
`invalidateSorted()`
Invalidate sorted collections
`Iterator<T>`
`iterator()`
`Markers`
`markers()`
A list of all markers in this transcript
`int`
`numChilds()`
`Markers`
`query(Marker marker)`
Query all genomic regions that intersect 'marker'
`void`
`remove(T t)`
Remove a subinterval
`void`
`reset()`
Remove all intervals
`void`
`serializeParse(MarkerSerializer markerSerializer)`
Parse a line from a serialized file
`String`
`serializeSave(MarkerSerializer markerSerializer)`
Create a string to serialize to a file
`void`
`setStrandMinus(boolean strandMinus)`
`void`
`shiftCoordinates(int shift)`
`List<T>`
`sorted()`
Return a collection of sub intervals sorted by natural order
`List<T>`
`sortedStrand()`
Return a collection of sub intervals sorted by start position (if strand is >= 0) or by reverse end position (if strand invalid input: '<' 0)
`Collection<T>`
`subIntervals()`
Return a collection of sub intervals

### Methods inherited from class org.snpeff.interval.Marker

`adjust, applyDel, applyDup, applyIns, applyMixed, codonTable, compareTo, compareToPos, distance, distanceBases, getParent, getType, idChain, idChain, idChain, includes, intersect, isAdjustIfParentDoesNotInclude, isDeferredAnalysis, isShowWarningIfParentDoesNotInclude, minus, query, readTxt, shouldApply, toString, union, variantEffect, variantEffectNonRef`

### Methods inherited from class org.snpeff.interval.Interval

`equals, findParent, getChromosome, getChromosomeName, getChromosomeNameOri, getChromosomeNum, getEnd, getGenome, getGenomeName, getId, getStart, getStrand, hashCode, intersects, intersects, intersects, intersects, intersectSize, isCircular, isSameChromo, isStrandMinus, isStrandPlus, isValid, setChromosomeNameOri, setEnd, setId, setParent, setStart, size, toStr, toStringAsciiArt, toStrPos`

### Methods inherited from class java.lang.Object

`equals, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

## Constructor Details

### IntervalAndSubIntervals

public IntervalAndSubIntervals()

### IntervalAndSubIntervals

public IntervalAndSubIntervals(Marker parent, int start, int end, boolean strandMinus, String id)

## Method Details

### add

public void add(T t)
Add a subinterval

### addAll

public void addAll(Iterable<T> ts)
Add all intervals

### addAll

public void addAll(Markers markers)
Add all markers

### apply

public IntervalAndSubIntervals<T> apply(Variant variant)
Apply a variant.

Overrides:
  `apply` in class `Marker`
Returns:
  The marker result after applying variant

### clone

public IntervalAndSubIntervals<T> clone()

Overrides:
  `clone` in class `Marker`

### cloneShallow

public IntervalAndSubIntervals<T> cloneShallow()
Description copied from class: `Marker`
Perform a shallow clone

Overrides:
  `cloneShallow` in class `Marker`

### containsId

public boolean containsId(String id)
Is 'id' in the subintervals?

### get

public T get(String id)
Obtain a subinterval

### invalidateSorted

protected void invalidateSorted()
Invalidate sorted collections

### iterator

public Iterator<T> iterator()

Specified by:
  `iterator` in interface `Iterable<T extends Marker>`

### markers

public Markers markers()
A list of all markers in this transcript

### numChilds

public int numChilds()

### query

public Markers query(Marker marker)
Query all genomic regions that intersect 'marker'

Overrides:
  `query` in class `Marker`

### remove

public void remove(T t)
Remove a subinterval

### reset

public void reset()
Remove all intervals

### serializeParse

public void serializeParse(MarkerSerializer markerSerializer)
Parse a line from a serialized file

Specified by:
  `serializeParse` in interface `TxtSerializable`
Overrides:
  `serializeParse` in class `Marker`

### serializeSave

public String serializeSave(MarkerSerializer markerSerializer)
Create a string to serialize to a file

Specified by:
  `serializeSave` in interface `TxtSerializable`
Overrides:
  `serializeSave` in class `Marker`
Returns:

### setStrandMinus

public void setStrandMinus(boolean strandMinus)

Overrides:
  `setStrandMinus` in class `Interval`

### shiftCoordinates

public void shiftCoordinates(int shift)

Overrides:
  `shiftCoordinates` in class `Interval`

### sorted

public List<T> sorted()
Return a collection of sub intervals sorted by natural order

### sortedStrand

public List<T> sortedStrand()
Return a collection of sub intervals sorted by start position (if strand is >= 0) or by reverse end position (if strand invalid input: '<' 0)

### subIntervals

public Collection<T> subIntervals()
Return a collection of sub intervals