Package org.snpeff.interval
Class Interval
java.lang.Object
org.snpeff.interval.Interval
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<Interval>
- Direct Known Subclasses:
Marker
A genomic interval.
Note: Intervals are assumed to be zero-based and "closed" i.e. an interval includes the first and the last base. e.g.: an interval including the first base, up to base (and including) X would be [0,X]
- Author:
- pcingola
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()intCompare by start and endbooleanfindParent(Class clazz) Go up (parent) until we find an instance of 'clazz'Find chromosome namedoubleFind chromosome and return it's numberintgetEnd()Find genomeFind genome namegetId()intgetStart()inthashCode()booleanintersects(int iStart, int iEnd) Return true if this intersects '[iStart, iEnd]'booleanintersects(long point) booleanintersects(Interval interval) Return true if this intersects 'interval'booleanintersects(Marker interval) Do the intervals intersect?intintersectSize(Marker interval) How much do intervals intersect?booleanIs this interval part of a circular chromosome and it spans the 'chromosome zero / chromosome end' line?booleanisSameChromo(Marker interval) booleanbooleanbooleanisValid()voidsetChromosomeNameOri(String chromosomeNameOri) voidsetEnd(int end) voidvoidvoidsetStart(int start) voidsetStrandMinus(boolean strand) voidshiftCoordinates(int shift) intsize()toStr()To string as a simple "chr:start-end" formattoString()toStringAsciiArt(int maxLen) Show it as an ASCII arttoStrPos()To string as a simple "chr:start-end" format
-
Field Details
-
start
protected int start -
end
protected int end -
strandMinus
protected boolean strandMinus -
id
-
chromosomeNameOri
-
parent
-
-
Constructor Details
-
Interval
protected Interval() -
Interval
-
-
Method Details
-
clone
-
compareTo
Compare by start and end- Specified by:
compareToin interfaceComparable<Interval>
-
equals
-
findParent
Go up (parent) until we find an instance of 'clazz' -
getChromosome
-
getChromosomeName
Find chromosome name -
getChromosomeNameOri
-
setChromosomeNameOri
-
getChromosomeNum
public double getChromosomeNum()Find chromosome and return it's number- Returns:
- Chromosome number if found, -1 otherwise
-
getEnd
public int getEnd() -
setEnd
public void setEnd(int end) -
getGenome
Find genome -
getGenomeName
Find genome name -
getId
-
setId
-
getParent
-
setParent
-
getStart
public int getStart() -
setStart
public void setStart(int start) -
getStrand
-
hashCode
public int hashCode() -
intersects
public boolean intersects(int iStart, int iEnd) Return true if this intersects '[iStart, iEnd]' -
intersects
Return true if this intersects 'interval' -
intersects
public boolean intersects(long point) - Returns:
- true if this interval contains point (inclusive)
-
intersects
Do the intervals intersect?- Returns:
- return true if this intersects 'interval'
-
intersectSize
How much do intervals intersect?- Returns:
- number of bases these intervals intersect
-
isCircular
public boolean isCircular()Is this interval part of a circular chromosome and it spans the 'chromosome zero / chromosome end' line? -
isSameChromo
-
isStrandMinus
public boolean isStrandMinus() -
setStrandMinus
public void setStrandMinus(boolean strand) -
isStrandPlus
public boolean isStrandPlus() -
isValid
public boolean isValid() -
shiftCoordinates
public void shiftCoordinates(int shift) -
size
public int size() -
toStr
To string as a simple "chr:start-end" format -
toString
-
toStringAsciiArt
Show it as an ASCII art -
toStrPos
To string as a simple "chr:start-end" format
-