Bimap-toTable(AnnotationDbi)
Bimap-toTable()所属R语言包:AnnotationDbi
Methods for manipulating a Bimap object in a data-frame style
在一个数据框的风格操纵一个bimap对象的方法
译者:生物统计家园网 机器人LoveR
描述----------Description----------
These methods are part of the Bimap interface (see ?Bimap for a quick overview of the Bimap objects and their interface).
这些方法的bimap的接口的一部分(见?Bimap一个bimap的对象和它们的接口的简要概述)。
用法----------Usage----------
## Extract all the columns of the map (links + right attributes)
toTable(x)
nrow(x)
ncol(x)
#dim(x)
head(x, ...)
tail(x, ...)
## Extract only the links of the map
links(x)
count.links(x)
nhit(x)
## Col names and col metanames
colnames(x, do.NULL=TRUE, prefix="col")
colmetanames(x)
Lkeyname(x)
Rkeyname(x)
keyname(x)
tagname(x)
Rattribnames(x)
Rattribnames(x) <- value
参数----------Arguments----------
参数:x
A Bimap object (or a list or an environment for nhit).
一个bimap对象(或列表或环境为nhit)。
参数:...
Further arguments to be passed to or from other methods (see head or tail for the details).
进一步的参数被传递或其他方法(见head或tail细节)。
参数:do.NULL
Ignored.
忽略。
参数:prefix
Ignored.
忽略。
参数:value
A character vector containing the names of the new right attributes (must be a subset of the current right attribute names) or NULL.
字符向量的新的权利属性的名称(必须是当前正确的属性名称的子集)或NULL。
Details
详情----------Details----------
toTable(x) turns Bimap object x into a data frame (see section "Flat representation of a bimap" in ?Bimap for a short introduction to this concept). For simple maps (i.e. no tags and no right attributes), the resulting data frame has only 2 columns, one for the left keys and one for the right keys, and each row in the data frame represents a link (or edge) between a left and a right key. For maps with tagged links (i.e. a tag is associated to each link), toTable(x) has one additional colmun for the tags and there is still one row per link. For maps with right attributes (i.e. a set of attributes is associated to each right key), toTable(x) has one additional colmun per attribute. So for example if x has tagged links and 2 right attributes, toTable(x) will have 5 columns: one for the left keys, one for the right keys, one for the tags, and one for each right attribute (always the rightmost columns). Note that if at least one of the right attributes is multivalued then more than 1 row can be needed to represent the same link so the number of rows in toTable(x) can be strictly greater than the number of links in the map.
toTable(x)原来bimap的对象x到一个数据框(见“平表示一个bimap”?Bimap这个概念的一个简短的介绍)。对于简单的映射(即没有标签,没有正确的属性),由此产生的数据框只有2列,左侧键和键,数据框中的每一行代表之间的联系(或边缘)左,右的关键。图标记的链接(即一个标签关联到每一个环节),:toTable(x)有一个额外的标签的colmun仍然是每一个环节一行。对于权利属性的映射(即一组属性关联到每个权的关键),toTable(x)每一个额外的属性colmun。“因此,举例来说,如果x标签链接2右键属性,toTable(x)将有5列:左侧键,一个键,一个标签,并为每一个正确的属性之一(总是在最右边的列)。请注意,如果至少有一个正确的属性是多值,则需要超过1行可代表相同的链接,以便在toTable(x)可以在图的链接的数量比严格的行数。
nrow(x) is equivalent to (but more efficient than) nrow(toTable(x)).
nrow(x)相当于(但效率比)nrow(toTable(x))。
ncol(x) is equivalent to (but more efficient than) ncol(toTable(x)).
ncol(x)相当于(但效率比)ncol(toTable(x))。
colnames(x) is equivalent to (but more efficient than) colnames(toTable(x)). Columns are named accordingly to the names of the SQL columns where the data are coming from. An important consequence of this that they are not necessarily unique.
colnames(x)相当于(但效率比)colnames(toTable(x))。列被命名为相应的数据来自SQL列的名称。一个重要的后果,他们不一定是唯一的。
colmetanames(x) returns the metanames for the column of x that are not right attributes. Valid column metanames are "Lkeyname", "Rkeyname" and "tagname".
colmetanames(x)x,列返回的metanames是不正确的属性。有效的列metanames是"Lkeyname","Rkeyname"和"tagname"。
Lkeyname, Rkeyname, tagname and Rattribnames return the name of the column (or columns) containing the left keys, the right keys, the tags and the right attributes, respectively.
Lkeyname,Rkeyname,tagname和Rattribnames返回键左,右按键,标签和正确的属性列(或列)的名称,分别。
Like toTable(x), links(x) turns x into a data frame but the right attributes (if any) are dropped. Note that dropping the right attributes produces a data frame that has eventually less columns than toTable(x) and also eventually less rows because now exactly 1 row is needed to represent 1 link.
像toTable(x),links(x)变成x到一个数据框,但正确的属性(如有)将被丢弃。请注意,删除的权利属性,产生一个数据框,有比toTable(x)“最终也少行最终少列,因为现在正是1行代表1链接。
count.links(x) is equivalent to (but more efficient than) nrow(links(x)).
count.links(x)相当于(但效率比)nrow(links(x))。
nhit(x) returns a named integer vector indicating the number of "hits" for each key in x i.e. the number of links that start from each key.
nhit(x)返回一个名为整数向量表示每个键“点击”x也就是说,从每一个关键环节开始。
值----------Value----------
A data frame for toTable and links.
一个数据框toTable和links。
A single integer for nrow, ncol and count.links.
nrow,ncol和count.links一个单一的整数。
A character vector for colnames, colmetanames and Rattribnames.
colnames,colmetanames和Rattribnames的一个特征向量。
A character string for Lkeyname, Rkeyname and tagname.
Lkeyname,Rkeyname和tagname的一个字符串。
A named integer vector for nhit.
一个命名为nhit整数向量
作者(S)----------Author(s)----------
H. Pages
参见----------See Also----------
Bimap, BimapFormatting, AnnDbBimap-envirAPI
bimap的,BimapFormatting,AnnDbBimap-envirAPI
举例----------Examples----------
library(GO.db)
x <- GOSYNONYM
x
toTable(x)[1:4, ]
toTable(x["GO:0007322"])
links(x)[1:4, ]
links(x["GO:0007322"])
nrow(x)
ncol(x)
dim(x)
colnames(x)
colmetanames(x)
Lkeyname(x)
Rkeyname(x)
tagname(x)
Rattribnames(x)
links(x)[1:4, ]
count.links(x)
y <- GOBPCHILDREN
nhy <- nhit(y) # 'nhy' is a named integer vector[NHY“是一个命名的整数向量]
identical(names(nhy), keys(y)) # TRUE[真]
table(nhy)
sum(nhy == 0) # number of GO IDs with no children[无子女的GO的身份证号码]
names(nhy)[nhy == max(nhy)] # the GO ID(s) with the most direct children[最直接的儿童好编号(S)]
## Some sanity check[#一些完整性检查]
sum(nhy) == count.links(y) # TRUE[真]
## Changing the right attributes of the GOSYNONYM map (advanced[#更改的GOSYNONYM图(先进右边的属性]
## users only)[#用户只)]
class(x) # GOTermsAnnDbBimap[GOTermsAnnDbBimap]
as.list(x)[1:3]
colnames(x)
colmetanames(x)
tagname(x) # untagged map[无标记的图]
Rattribnames(x)
Rattribnames(x) <- Rattribnames(x)[3:1]
colnames(x)
class(x) # AnnDbBimap[AnnDbBimap]
as.list(x)[1:3]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|