找回密码
 注册
查看: 494|回复: 0

R语言 IRanges包 seqapply()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-25 22:32:20 | 显示全部楼层 |阅读模式
seqapply(IRanges)
seqapply()所属R语言包:IRanges

                                         Apply function and cast to Vector
                                         应用函数向量,并投

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

The seqapply family of functions behaves much like the existing lapply family, except the return value is cast to a Vector subclass. This facilitates constraining computation to the Vector framework across iteration and (for seqsplit) splitting.
就像现有seqapply家庭lapply家庭功能的行为,除了返回值被转换为一个Vector的子类。这有利于制约整个迭代(Vector)分裂计算seqsplit框架。


用法----------Usage----------


seqapply(X, FUN, ...)
mseqapply(FUN, ..., MoreArgs = NULL, USE.NAMES = TRUE)
tseqapply(X, INDEX, FUN = NULL, ...)
seqsplit(x, f, drop = FALSE)
seqby(data, INDICES, FUN, ...)



参数----------Arguments----------

参数:X
The object over which to iterate, usually a vector or Vector  
对象迭代,通常一个向量或Vector


参数:x
Like X  
像X


参数:data
Like X  
像X


参数:FUN
The function that is applied to each element of X  
适用于每个的X元素的功能


参数:MoreArgs
Additional arguments to FUN that are treated like scalars  
额外的参数FUN像对待标量


参数:USE.NAMES
Whether the return values should inherit names from one of the arguments  
返回值是否应该继承从一个参数的名称


参数:INDEX
A list of factors to split X into subsets, each of which is passed in a separate invocation of FUN  
一个list分裂的因素X成子集,其中每个通过单独调用在FUN的


参数:INDICES
Like INDEX, except a single factor need not be in a list.  
像INDEX,需要一个单一的因素除外,不能在一个list。


参数:f
A factor or list of factors  
一个factor或list因素


参数:drop
Whether to drop empty elements from the returned list  
是否删除空元素,从返回的列表


参数:...
Extra arguments to pass to FUN  
以传递FUN的额外的参数


Details

详情----------Details----------

These functions should be used just like their base equivalent:
就像他们的碱基相当于应使用这些功能:




seqapply => lapply
seqapply=>lapply




mseqapply => mapply
mseqapply=>mapply




tseqapply => tapply
tseqapply=>tapply




seqsplit => split
seqsplit=>split




seqby => by
seqby=>by

The only difference is that the result is cast to a Vector object. The casting logic simply looks for a common class from which all returned values inherit. It then checks for the existence of a function of the form ClassList where Class is the name of the class. If such a function is not found, the search proceeds up the hierarchy of classes. An error is thrown when hierarchy is exhausted. If ClassList is found, it is called with the list of return values as its only argument, under the assumption that a Vector-derived instance will be constructed.
唯一不同的是,结果被转换为Vector对象。铸件的逻辑,只是寻找一个共同的类的所有返回值继承。然后检查存在形式的功能ClassListClass是类的名称。如果没有找到这样的功能,搜索收益类的层次结构。层次耗尽时,会抛出错误。如果ClassList被发现,它被称为与作为其唯一的参数,返回值的列表,假设下,将兴建一个Vector的派生实例。


值----------Value----------

A Vector object
一个Vector对象


作者(S)----------Author(s)----------



Michael Lawrence




举例----------Examples----------


starts <- IntegerList(c(1, 5), c(2, 8))
ends <- IntegerList(c(3, 8), c(5, 9))
rangesList <- mseqapply(IRanges, starts, ends)
rangeDataFrame <- stack(rangesList, "space", "ranges")
dataFrameList <- seqsplit(rangeDataFrame, rangeDataFrame$space)
starts <- seqapply(dataFrameList[,"ranges"], start)

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-2-5 10:59 , Processed in 0.023024 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表