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

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

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

                                        Class GenotypeData
                                         类GenotypeData

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

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

The GenotypeData class is a container for storing genotype data from a genome-wide association study together with the metadata associated with the subjects and SNPs involved in the study.
GenotypeData类是一起参与这项研究的科目和单核苷酸多态性关联的元数据存储从全基因组关联研究基因型数据的容器。


Details

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

The GenotypeData class consists of three slots: data, snp annotation, and scan annotation.  There may be multiple scans associated with a subject (e.g. duplicate scans for quality control), hence the use of "scan" as one dimension of the data. Snp and scan annotation are optional, but if included in the GenotypeData object, their unique integer ids (snpID and scanID) are checked against the ids stored in the data slot to ensure consistency.
GenotypeData类包括三个插槽:数据,SNP注解,和扫描注释。有可能是同一个主题(例如重复扫描的质量控制),因此使用“扫描”的一维数据关联的多个扫描。 SNP和扫描注释是可选的,但如果在包含的GenotypeData对象,其独特的整数ID(snpID和scanID)对存储的数据槽的ID,以确保一致性检查。


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

GenotypeData(data, snpAnnot=NULL, scanAnnot=NULL):
GenotypeData(data, snpAnnot=NULL, scanAnnot=NULL):

data must be an NcdfGenotypeReader or MatrixGenotypeReader object.
data必须是一个NcdfGenotypeReader或MatrixGenotypeReader对象。

snpAnnot, if not NULL, must be a SnpAnnotationDataFrame or SnpAnnotationSQLite object.
snpAnnot如果没有NULL,必须是一个SnpAnnotationDataFrame或SnpAnnotationSQLite对象。

scanAnnot, if not NULL, must be a ScanAnnotationDataFrame or ScanAnnotationSQLite object.
scanAnnot如果没有NULL,必须是一个ScanAnnotationDataFrame或ScanAnnotationSQLite对象。

The GenotypeData constructor creates and returns a GenotypeData instance, ensuring that data, snpAnnot, and scanAnnot are internally consistent.
GenotypeData构造函数创建并返回一个实例GenotypeData,确保数据,snpAnnot,scanAnnot内部是一致的。


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

In the code snippets below, object is a GenotypeData object. snp and scan indicate which elements to return along the snp and scan dimensions.  They must be integer vectors of the form (start, count), where start is the index of the first data element to read and count is the number of elements to read.  A value of '-1' for count indicates that the entire dimension should be read.  If snp and/or is scan omitted, the entire variable is read.
在下面的代码片段,object是GenotypeData的对象。 snp和scan表明该元素返回沿SNP和扫描尺寸。他们必须是整数的形式向量(启动,计数),在那里开始的第一个数据元素的索引,阅读和计算元素的数量,阅读。 “-1”为计数的值表明整个维度应读。如果SNP和/或扫描省略,整个变量被读取。

nsnp(object): The number of SNPs in the data.
nsnp(object):单核苷酸多态性数据。

nscan(object): The number of scans in the data.
nscan(object):扫描数据的数量。

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

getChromosome(object, index, char=FALSE): A vector of chromosomes.  The optional index is a logical or integer vector specifying elements to extract. If char=FALSE (default), returns an integer vector. If char=TRUE, returns a character vector with elements in (1:22,X,XY,Y,M,U).
getChromosome(object, index, char=FALSE):一个染色体的向量。可选的index是一个逻辑或整数向量,指定要提取的元素。如果char=FALSE(默认),返回一个整数向量。如果char=TRUE,返回一个字符向量中的元素(1:22,X,XY,Y,男,ü)。

getPosition(object, index): An integer vector of base pair positions.  The optional index is a logical or integer vector specifying elements to extract.  
getPosition(object, index):一个碱基对位置的整数向量。可选的index是一个逻辑或整数向量,指定要提取的元素。

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。

getGenotype(object, snp, scan): Extracts genotype values (number of A alleles).   The result is a vector or matrix, depending on the number of dimensions in the returned values.  Missing values are represented as NA.
getGenotype(object, snp, scan):提取基因型值(A等位基因数)。其结果是一个向量或矩阵,根据返回值的尺寸。遗漏值表示为NA。

getSnpVariable(object, varname, index): Returns the snp annotation variable varname. The optional index is a logical or integer vector specifying elements to extract.  
getSnpVariable(object, varname, index):返回SNP注释变量varname。可选的index是一个逻辑或整数向量,指定要提取的元素。

getSnpVariableNames(object): Returns a character vector with the names of the columns in the snp annotation.
getSnpVariableNames(object):返回字符向量与SNP注解列的名称。

hasSnpVariable(object, varname): Returns TRUE if the variable varname is present in the snp annotation.
hasSnpVariable(object, varname):返回TRUE如果变量varname是目前在SNP注解。

getScanVariable(object, varname, index): Returns the scan annotation variable varname. The optional index is a logical or integer vector specifying elements to extract.  
getScanVariable(object, varname, index):返回扫描注释变量varname。可选的index是一个逻辑或整数向量,指定要提取的元素。

getScanVariableNames(object): Returns a character vector with the names of the columns in the scan annotation.
getScanVariableNames(object):返回一个字符向量在扫描注释列的名称。

hasScanVariable(object, varname): Returns TRUE if the variable varname is present in the scan annotation.
hasScanVariable(object, varname):返回TRUE如果变量varname是在扫描注释。

getVariable(object, varname, snp, scan): Extracts the contents of the variable varname from the data.   The result is a vector or matrix, depending on the number of dimensions in the returned values.  Missing values are represented as NA.  If the variable is not found, returns NULL.
getVariable(object, varname, snp, scan):变量varname从数据中提取的内容。其结果是一个向量或矩阵,根据返回值的尺寸。遗漏值表示为NA。如果该变量没有被发现,返回NULL。

hasVariable(object, varname): Returns TRUE if the data contains contains varname, FALSE if not.
hasVariable(object, varname):返回TRUE如果数据中包含包含varname,FALSE如果不是。

hasSnpAnnotation(object): Returns TRUE if the snp annotation slot is not NULL.
hasSnpAnnotation(object):返回TRUESNP注释插槽的,如果不是NULL。

hasScanAnnotation(object): Returns TRUE if the scan annotation slot is not NULL.
hasScanAnnotation(object):返回TRUE如果不扫描注释槽NULL。

open(object): Opens a connection to the data.
open(object):打开数据连接。

close(object): Closes the data connection.
close(object):关闭数据连接。

XchromCode(object): Returns the integer code for the X chromosome.
XchromCode(object):返回整数代码为X染色体。

XYchromCode(object): Returns the integer code for the pseudoautosomal region.
XYchromCode(object):返回整数代码为拟常区域。

YchromCode(object): Returns the integer code for the Y chromosome.
YchromCode(object):返回的整数代码为Y染色体。

MchromCode(object): Returns the integer code for  mitochondrial SNPs.
MchromCode(object):返回线粒体单核苷酸多态性的整数代码。


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


Stephanie Gogarten



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

SnpAnnotationDataFrame, SnpAnnotationSQLite, ScanAnnotationDataFrame, ScanAnnotationSQLite, NcdfReader, NcdfGenotypeReader, MatrixGenotypeReader, IntensityData
SnpAnnotationDataFrame,SnpAnnotationSQLite,ScanAnnotationDataFrame,ScanAnnotationSQLite,NcdfReader,NcdfGenotypeReader,MatrixGenotypeReader,IntensityData


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


library(GWASdata)
file <- system.file("extdata", "affy_geno.nc", package="GWASdata")
nc <- NcdfGenotypeReader(file)

# object without annotation[对象不标注]
genoData <- GenotypeData(nc)

# object with annotation[对象与注解]
data(affy_snp_annot)
snpAnnot <- SnpAnnotationDataFrame(affy_snp_annot)
data(affy_scan_annot)
scanAnnot <- ScanAnnotationDataFrame(affy_scan_annot)
genoData <-  GenotypeData(nc, snpAnnot=snpAnnot, scanAnnot=scanAnnot)

# dimensions[尺寸]
nsnp(genoData)
nscan(genoData)

# get snpID and chromosome[获取snpID和染色体]
snpID <- getSnpID(genoData)
chrom <- getChromosome(genoData)

# get positions only for chromosome 22[只得到22号染色体的位置]
pos22 <- getPosition(genoData, index=(chrom == 22))

# get other annotations[获得其他注解]
if (hasSex(genoData)) sex <- getSex(genoData)
plate <- getScanVariable(genoData, "plate")
rsID <- getSnpVariable(genoData, "rsID")

# get all snps for first scan[第一次扫描得到所有的SNPs]
geno <- getGenotype(genoData, snp=c(1,-1), scan=c(1,1))

# starting at snp 100, get 10 snps for the first 5 scans[SNP 100起,获得第5扫描10个SNPs]
geno <- getGenotype(genoData, snp=c(100,10), scan=c(1,5))

close(genoData)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-6 09:51 , Processed in 0.023223 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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