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

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

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

                                        Class NcdfGenotypeReader
                                         类NcdfGenotypeReader

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

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

The NcdfGenotypeReader class is an extension of the NcdfReader class specific to reading genotype data stored in NetCDF files.
NcdfGenotypeReader类NetCDF文件存储的数据读基因型特定的NcdfReader类的扩展。


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

NcdfReader
NcdfReader


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

NcdfGenotypeReader(filename):
NcdfGenotypeReader(filename):

filename must be the path to a NetCDF file.  The NetCDF file must contain the following variables:
filename必须是一个netCDF文件的路径。 NetCDF文件必须包含以下变量:

'snp': a coordinate variable with a unique integer vector of snp ids
“SNP”:一个独特的SNP ID的整数向量的坐标变量

'chromosome':  integer chromosome codes of dimension 'snp'
“染色体”:整数维染色体编码“SNP”

'position': integer position values of dimension 'snp'
“位置”:“SNP”维度的整数位置值

'sampleID': a unique integer vector of scan ids with dimension 'sample'
“sampleID”:一个独特的整数向量扫描IDS尺寸的样品

'genotype': a matrix of bytes with dimensions ('snp','sample').  The byte values must be the number of A alleles : 2=AA, 1=AB, 0=BB.
“基因型”:一个字节的尺寸矩阵(单核苷酸多态性“,”样本“)。字节的值必须是A等位基因数:2 = AA = AB,0 =启用BB,1。

Default values for chromosome codes are 1-22, 23=X, 24=XY, 25=Y, 26=M.  The defaults may be changed with the arguments XchromCode, XYchromCode, YchromCode, and MchromCode.
染色体的编码的默认值是1-22,23 = X 24 = XY,25 = Y 26 = M可改变参数的默认XchromCode,XYchromCode,YchromCode,MchromCode。

The NcdfGenotypeReader constructor creates and returns a NcdfGenotypeReader instance pointing to this file.
NcdfGenotypeReader构造创建并返回一个指向该文件的NcdfGenotypeReader实例。


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

In the code snippets below, object is a NcdfGenotypeReader 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是NcdfGenotypeReader的对象。 snp和scan表明该元素返回沿SNP和扫描尺寸。他们必须是整数的形式向量(启动,计数),在那里开始的第一个数据元素的索引,阅读和计算元素的数量,阅读。 “-1”为计数的值表明整个维度应读。如果SNP和/或扫描省略,整个变量被读取。

See NcdfReader for additional methods.
看到NcdfReader的其他方法。

nsnp(object): The number of SNPs in the NetCDF file.
nsnp(object):netCDF文件中的SNPs数量。

nscan(object): The number of scans in the NetCDF file.
nscan(object):netCDF文件的扫描。

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).  "U" stands for "Unknown" and is the value given to any chromosome code not falling in the other categories.
getChromosome(object, index, char=FALSE):一个染色体的向量。可选的index是一个逻辑或整数向量,指定要提取的元素。如果char=FALSE(默认),返回一个整数向量。如果char=TRUE,返回一个字符向量中的元素(1:22,X,XY,Y,男,ü)。的“U”代表“未知”,是不能在其他类别的任何染色体代码的价值。

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是一个逻辑或整数向量,指定要提取的元素。

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。

getVariable(object, varname, snp, scan): Extracts the contents of the variable varname.   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 in the NetCDF file, returns NULL.
getVariable(object, varname, snp, scan):提取的变量varname内容。其结果是一个向量或矩阵,根据返回值的尺寸。遗漏值表示为NA。如果变量没有被发现在netCDF文件,返回NULL。

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----------

NcdfReader, NcdfIntensityReader, GenotypeData, IntensityData
NcdfReader,NcdfIntensityReader,GenotypeData,IntensityData


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


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

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

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

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

# get all snps for first scan[第一次扫描得到所有的SNPs]
geno <- getGenotype(nc, 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(nc, snp=c(100,10), scan=c(1,5))

close(nc)

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


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

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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