class Region extends groovy.util.Expando
Region of a genome
Among all the different region-based objects this is the highest level and most heavy weight representation of a region. The Region is a Groovy groovy.util.Expando object, so arbitrary properties can be set on it dynamically.
Regions can be created from common string representations of regions:
Region r = new Region("chr1:20000-300000")
Alternatively they can be created directly:
Region r = new Region("chr1", 20000, 300000)
| Modifiers | Name | Description |
|---|---|---|
static long |
serialVersionUID |
| Type | Name and description |
|---|---|
static Region |
EMPTY_REGION |
java.lang.String |
chr |
groovy.lang.IntRange |
range |
| Constructor and description |
|---|
Region
() |
Region
(IRegion other) |
Region
(Map props = null, java.lang.String region) |
Region
(Map props = null, java.lang.String chr, groovy.lang.Range range) |
Region
(Map props = null, java.lang.String chr, int from, int to) |
Region
(htsjdk.samtools.SAMRecord read) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
java.lang.Object |
asType(java.lang.Class clazz) |
|
Region |
copy() |
|
java.lang.String |
endString() |
|
java.lang.Object |
getExtra() |
|
java.lang.Integer |
getFrom() |
|
int |
getMidpoint() |
|
java.lang.Integer |
getTo() |
|
java.lang.String |
igv() |
|
Region |
intersect(IRegion other) |
|
boolean |
isCase(IRegion other)Return true of this region overlaps the other. |
|
boolean |
isEmpty()There is a design flaw in that because the range is inclusive of both start and end, we cannot represent an empty region. |
|
boolean |
isMinorContig() |
|
static boolean |
isMinorContig(java.lang.String chr)A hueristic that returns true if this the given contig represents a non-primary assembly contig or alternate haplotype in commonly used human genome assemblies. |
|
double |
mutualOverlap(IRegion other)Compute the fraction of mutual overlap of this region with the other. |
|
boolean |
overlaps(java.lang.String chr, int from, int to)@return true iff the specified region partially or fully overlaps this one |
|
boolean |
overlaps(Regions regions)@return true if any region within the given Regions partially or fully overlaps this one |
|
boolean |
overlaps(IRegion other)@return true iff the specified region partially or fully overlaps this one |
|
static boolean |
overlaps(IRegion r1, IRegion r2)@return true iff the specified region partially or fully overlaps this one |
|
void |
parseRegion(java.lang.String region) |
|
void |
setProps(Map props) |
|
long |
size()@return the number of positions spanned by this region |
|
boolean |
spans(IRegion r)@return true iff this region fully encompasses the given region |
|
java.lang.String |
startString() |
|
Region |
stripContigPrefix() |
|
java.lang.String |
toString() |
|
Region |
union(IRegion other) |
|
static Region |
union(IRegion r1, IRegion r2) |
|
Region |
widen(int bp) |
|
Region |
widen(int leftBp, int rightBp)@param bp number of base pairs to widen by |
| Methods inherited from class | Name |
|---|---|
class groovy.util.Expando |
groovy.util.Expando#setProperty(java.lang.String, java.lang.Object), groovy.util.Expando#getProperty(java.lang.String), groovy.util.Expando#equals(java.lang.Object), groovy.util.Expando#toString(), groovy.util.Expando#hashCode(), groovy.util.Expando#getProperties(), groovy.util.Expando#getMetaPropertyValues(), groovy.util.Expando#invokeMethod(java.lang.String, java.lang.Object), groovy.util.Expando#getMetaClass(), groovy.util.Expando#setMetaClass(groovy.lang.MetaClass), groovy.util.Expando#wait(long, int), groovy.util.Expando#wait(long), groovy.util.Expando#wait(), groovy.util.Expando#getClass(), groovy.util.Expando#notify(), groovy.util.Expando#notifyAll() |
class groovy.lang.GroovyObjectSupport |
groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll() |
Return true of this region overlaps the other.
Supports the groovy syntax:
Region r1 = new Region("chr1:1-10")
Region r2 = new Region("chr1:5-10")
assert r1 in r2
Note however that any overlap will return true, the region does not
have to be contained entirely.
There is a design flaw in that because the range is inclusive of both start and end, we cannot represent an empty region. Some functions therefore return a special designated reigon that signifies "empty".
A hueristic that returns true if this the given contig represents a non-primary assembly contig or alternate haplotype in commonly used human genome assemblies.
Compute the fraction of mutual overlap of this region with the other.
This is defined as, the minimum fraction of either region's overlap with the other. | 20 | |----------------------| 60 |------------------------------| 80 mutual overlap = min(20/60, 20/80) = 0.25
bp - number of base pairs to widen byGroovy Documentation