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

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

[复制链接]
发表于 2012-2-25 21:28:41 | 显示全部楼层 |阅读模式
ScanAnnotationDataFrame(GWASTools)
ScanAnnotationDataFrame()所属R语言包:GWASTools

                                        Class ScanAnotationDataFrame
                                         类ScanAnotationDataFrame

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

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

The ScanAnnotationDataFrame class stores annotation data associated with subjects in a genotyping study, where there may be multiple scans per subject, as well as metadata describing each column.  It extends the AnnotatedDataFrame class.
ScanAnnotationDataFrame类存储在基因分型研究,其中可能有多个扫描,每科,以及描述每个列的元数据对象相关的注释数据。它延伸AnnotatedDataFrame类。


延伸----------Extends----------

AnnotatedDataFrame
AnnotatedDataFrame


构造----------Constructor----------

ScanAnnotationDataFrame(data, metadata):
ScanAnnotationDataFrame(data, metadata):

data must be a data.frame containing the scan annotation. It must contain at least the following column:
data必须有一个数据框包含扫描注解。它必须至少包含以下栏:

"scanID": integer vector containing unique scan ids.
“scanID”:含有独特的扫描IDS的整数向量。

If a column representing sex is present, it must have the following format:
如果一列代表性别是存在的,它必须具有以下格式:

"sex": character vector with values 'M' or 'F'.
“性”:性格与价值观“M”或“F”的向量。

metadata is an optional data.frame containing a description for each column in data.  It should contain a column "labelDescription", with row.names(metadata) == names(data).
metadata是一个可选的数据框包含为每个列在data描述。它应该包含列“labelDescription”,用row.names(metadata) == names(data)。

The ScanAnnotationDataFrame constructor creates and returns a ScanAnnotationDataFrame instance.
ScanAnnotationDataFrame构造创建和返回ScanAnnotationDataFrame实例。


存取----------Accessors----------

In the code snippets below, object is a ScanAnnotationDataFrame object.
在下面的代码片段,object是ScanAnnotationDataFrame的对象。

getScanID(object, index): A unique integer vector of scan IDs.  The optional index is a logical or integer vector specifying elements to extract.  
getScanID(object, index):一个独特的扫描标识的整数向量。可选的index是一个逻辑或整数向量,指定要提取的元素。

getSex(object, index): A character vector of sex, with values 'M' or 'F'.    The optional index is a logical or integer vector specifying elements to extract.  
getSex(object, index):对性的特征向量,“M”或“F”值。可选的index是一个逻辑或整数向量,指定要提取的元素。

hasSex(object): Returns TRUE if the column 'sex' is present in object.
hasSex(object):返回TRUE如果列性是在object。

getVariable(object, varname, index): A vector of the column varname.  The optional index is a logical or integer vector specifying elements to extract. If varname is itself a vector, returns a data.frame. Returns NULL if varname is not found in object.
getVariable(object, varname, index):一个列varname向量。可选的index是一个逻辑或整数向量,指定要提取的元素。 varname如果本身就是一个向量,返回一个数据框。返回NULL如果varname不object发现。

hasVariable(object, varname): Returns TRUE if varname is a column in object, FALSE if not.
hasVariable(object, varname):返回TRUE如果varname是一个列在object,FALSE如果不是。

getVariableNames(object): Returns a character vector with the names of all columns in object.
getVariableNames(object):返回所有列在object的名称字符向量。

getAnnotation(object): Returns all annotation variables as a data frame.
getAnnotation(object):返回一个数据框的所有注释的变量。

getMetadata(object): Returns metadata describing the annotation variables as a data frame.
getMetadata(object):返回元数据描述的注释变量作为一个数据框。

Inherited methods from AnnotatedDataFrame:
继承的方法,从AnnotatedDataFrame:

varLabels(object): Returns a character vector with the names of all columns in object.
varLabels(object):返回所有列在object的名称字符向量。

pData(object): Returns all annotation variables as a data frame, or sets the annotation variables with pData(object) <- df.
pData(object):返回一个数据框的所有注释的变量,或设置pData(object) <- df注释变量。

varMetadata(object): Returns metadata describing the annotation variables as a data frame, or sets the metadata with varMetadata(object) <- df.
varMetadata(object):返回元数据描述一个数据框注释的变量,或设置varMetadata(object) <- df元数据。

The operators $ and [ work just as they do in standard data frames, for both retrieval and assignment.
运营商$和[工作,就像他们在做标准数据框,检索和分配。


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


Stephanie Gogarten



参见----------See Also----------

AnnotatedDataFrame, SnpAnnotationDataFrame, GenotypeData, IntensityData
AnnotatedDataFrame,SnpAnnotationDataFrame,GenotypeData,IntensityData


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


library(GWASdata)
data(affy_scan_annot)
scanAnnot <- ScanAnnotationDataFrame(affy_scan_annot)

scanID <- getScanID(scanAnnot)
sex <- getSex(scanAnnot)
if (hasVariable(scanAnnot, "plate")) plate <- getVariable(scanAnnot, "plate")
subjectID <- getVariable(scanAnnot, "subjectID", index=(sex == "M"))

# list columns[列表中的列]
varLabels(scanAnnot)

# add metadata[添加元数据]
meta <- varMetadata(scanAnnot)
meta["scanID", "labelDescription"] <- "unique integer ID"
varMetadata(scanAnnot) <- meta

# display data[显示数据]
head(pData(scanAnnot))

# standard operators[标准的运营商]
scanID <- scanAnnot$scanID
sex <- scanAnnot[["sex"]]
subset <- scanAnnot[1:10, 1:5]
scanAnnot$newVar <- rep(1, nrow(scanAnnot))

# replace data[替换数据]
df <- pData(scanAnnot)
pData(scanAnnot) <- df

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-6 07:10 , Processed in 0.020481 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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