Ranges-utils(IRanges)
Ranges-utils()所属R语言包:IRanges
Ranges utility functions
不等实用功能
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Utility functions for modifying Ranges objects.
修改范围对象的实用功能。
用法----------Usage----------
flank(x, width, start=TRUE, both=FALSE, use.names=TRUE,...)
narrow(x, start=NA, end=NA, width=NA, use.names=TRUE)
reflect(x, bounds, use.names=TRUE)
resize(x, width, fix="start", use.names=TRUE,...)
restrict(x, start=NA, end=NA, keep.all.ranges=FALSE, use.names=TRUE)
shift(x, shift=0L, use.names=TRUE)
## S4 method for signature 'Ranges'
range(x, ..., na.rm = FALSE)
## S4 method for signature 'Ranges'
reduce(x, drop.empty.ranges=FALSE, min.gapwidth=1L,
with.inframe.attrib=FALSE)
## S4 method for signature 'Ranges,Ranges'
distance(x, y)
threebands(x, start=NA, end=NA, width=NA)
参数----------Arguments----------
参数:x
A Ranges object.
一个范围对象。
参数:y
A Ranges object.
一个范围对象。
参数:width
For narrow and threebands, a vector of integers, eventually with NAs. See the SEW (Start/End/Width) interface for the details (?solveUserSEW). For resize and flank, the width of the resized or flanking regions. Note that if both is TRUE, this is effectively doubled. Recycled as necessary so that each element corresponds to a range in x.
narrow和threebands,一个整数向量,最终与NAS。看到,SEW(开始/结束/宽)接口的细节(?solveUserSEW)。 resize和flank,宽度的大小或侧翼区域。请注意,如果bothTRUE,这是有效地增加一倍。回收作为必要使每个元素对应一个x的范围。
参数:start, end
A vector of integers for all functions except for flank. For restrict, the supplied start and end arguments must be vectors of integers, eventually with NAs, that specify the restriction interval(s). Recycled as necessary so that each element corresponds to a range in x. Same thing for narrow and threebands, except that here start and end must contain coordinates relative to the ranges in x. See the Details section below. For flank, start is a logical indicating whether x should be flanked at the start (TRUE) or the end (FALSE). Recycled as necessary so that each element corresponds to a range in x.
一个对所有功能的向量整数除了flank。 restrict,所提供的start和end参数必须是整数向量,最终与NAS,即指定的限制时间间隔(S)。回收作为必要使每个元素对应一个x的范围。同样的事情,除了在这里narrow和threebands必须包含相对范围的坐标startend和x。见下面的详细信息部分。 flank,start是一个逻辑指示是否x应在开始两侧(TRUE)或结束(FALSE)。回收作为必要使每个元素对应一个x的范围。
参数:both
If TRUE, extends the flanking region width positions into the range. The resulting range thus straddles the end point, with width positions on either side.
如果TRUE“的范围延伸到侧翼区width阵地。由此产生的范围跨越了终点,用width两边的位置。
参数:use.names
TRUE or FALSE. Should names be preserved?
TRUE或FALSE。应名被保留吗?
参数:bounds
An IRanges object to serve as the reference bounds for the reflection, see below.
一个IRanges反对作为反射的参考范围,见下文。
参数:fix
For resize, a character vector or character Rle of length 1 or length(x) containing the values "start", "end", and "center" denoting what to use as an anchor for each element in x.
resize,长度为1或length(x)值"start","end","center"表示使用什么作为一个锚字符向量或字符RLE每个在x元素。
参数:keep.all.ranges
TRUE or FALSE. Should ranges that don't overlap with the restriction interval(s) be kept? Note that "don't overlap" means that they end strictly before start - 1 or start strictly after end + 1. Ranges that end at start - 1 or start at end + 1 are always kept and their width is set to zero in the returned IRanges object.
TRUE或FALSE。应保持不重叠的范围与限制时间间隔(S)?注意,“不重叠”的意思,他们结束前start - 1严格,或启动后end + 1严格。范围年底start - 1启动end + 1始终保持其宽度设置为零返回IRanges对象。
参数:shift
An integer vector containing the shift information. Recycled as necessary so that each element corresponds to a range in x.
整数移位信息向量。回收作为必要使每个元素对应一个x的范围。
参数:drop.empty.ranges
TRUE or FALSE. Should empty ranges be dropped?
TRUE或FALSE。应该被丢弃空范围?
参数:min.gapwidth
Ranges separated by a gap of at least min.gapwidth positions won't be merged in the Ranges object returned by reduce. Otherwise, they will.
由间隙分隔的范围至少min.gapwidth职位将不会被合并在reduce返回的范围,对象。否则,他们会。
参数:with.inframe.attrib
TRUE or FALSE. For internal use.
TRUE或FALSE。供内部使用。
参数:...
For range, additional Ranges to consider.
range,额外的Ranges考虑。
参数:na.rm
Ignored
忽视
Details
详情----------Details----------
flank generates flanking ranges for each range in x. If start is TRUE for a given range, the flanking occurs at the start, otherwise the end. The widths of the flanks are given by the width parameter. The widths can be negative, in which case the flanking region is reversed so that it represents a prefix or suffix of the range in x. The flank operation is illustrated below for a call of the form flank(x, 3, TRUE), where x indicates a range in x and - indicates the resulting flanking region:
flank每个范围生成x侧翼范围。如果start是TRUE对于一个给定的范围内,侧翼开始出现,否则结束。 width参数两翼的宽度。宽度可以是负面的,在这种情况下,侧翼区逆转,因此,它代表的范围前缀或后缀x。 flank操作说明以下形式的呼叫flank(x, 3, TRUE),其中x表示在范围x和-表示由此产生的侧翼区域:
作者(S)----------Author(s)----------
H. Pages, M. Lawrence, P. Aboyoun
参见----------See Also----------
threebands could be described as a parallel variant of disjoin.
threebands可以被描述为一个disjoin平行变种。
Ranges-class, IRanges-setops, solveUserSEW
范围级,IRanges-setops,solveUserSEW
举例----------Examples----------
vec <- as.integer(c(19, 5, 0, 8, 5))
x <- successiveIRanges(vec)
x
shift(x, -3)
restrict(x, start=12, end=34)
restrict(x, start=20)
restrict(x, start=21)
restrict(x, start=21, keep.all.ranges=TRUE)
y <- x[width(x) != 0]
narrow(y, start=4, end=-2)
narrow(y, start=-4, end=-2)
narrow(y, end=5, width=3)
narrow(y, start = c(3, 4, 2, 3), end = c(12, 5, 7, 4))
resize(y, width = 200)
resize(y, width = 2, fix = "end")
z <- threebands(y, start=4, end=-2)
y0 <- punion(z$left, z$right, fill.gap=TRUE)
identical(y, y0) # TRUE[真]
threebands(y, start=-5)
x <- IRanges(start=c(-2, 6, 9, -4, 1, 0, -6, 3, 10),
width=c( 5, 0, 6, 1, 4, 3, 2, 0, 3))
range(x)
reduce(x)
reduce(x, drop.empty.ranges=TRUE)
ir1 <- IRanges(c(2,5,1), c(3,7,3))
bounds <- IRanges(c(0, 5, 3), c(10, 6, 9))
reflect(ir1, bounds)
flank(ir1, 2)
flank(ir1, 2, FALSE)
flank(ir1, 2, c(FALSE, TRUE, FALSE))
flank(ir1, c(2, -2, 2))
flank(ir1, 2, both = TRUE)
flank(ir1, 2, FALSE, TRUE)
flank(ir1, -2, FALSE, TRUE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|