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

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

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

                                        Class SnpAnotationSQLite
                                         类SnpAnotationSQLite

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

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

The SnpAnnotationSQLite class stores annotation data associated with SNPs, as well as metadata describing each column, in an SQLite database.
SnpAnnotationSQLite类存储注释与单核苷酸多态性相关的数据,以及描述每个列的元数据,在一个SQLite数据库。


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

SnpAnnotationSQLite(dbpath):
SnpAnnotationSQLite(dbpath):

dbpath is the path to a SQLite database with tables "Annotation" and "Metadata."  "Annotation" must contain at least the following columns:
dbpath是SQLite数据库的路径表的“注释”和“注释”必须至少包含以下几列“元数据”。

"snpID": integer vector containing unique SNP ids.
“snpID”:含有独特的SNP ID的整数向量。

"chromosome": integer vector containing chromosome codes.
“染色体”:整数向量染色体代码。

"position": integer vector containing position (in base pairs) on the chromosome.
“位置”:整数向量(碱基对)染色体上的位置。

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。

"Metadata" must contain at least the following columns:
“元数据”必须至少包含以下几列:

"varname": name of variable in annotation
“varname的”:在注释的变量的名称

"description": description of column in annotation
“说明”:在注释列描述

If the database does not yet exist, a database is created with tables "Annotation" and "Metadata."
如果数据库不存在,创建一个数据库表的“注释”和“元数据”。

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


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

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

open(object): Opens a connection to the database.
open(object):打开一个到数据库的连接。

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

nsnp(object): The number of SNPs in the database.
nsnp(object):在数据库中的SNPs数量。

getSnpID(object, index, condition): A unique integer vector of snp IDs.  The optional index is a logical or integer vector specifying elements to extract.    The optional condition is a character string with an SQL clause used to select data (e.g., "LIMIT 10", "WHERE chromosome=1").
getSnpID(object, index, condition):一个独特的SNP ID的整数向量。可选的index是一个逻辑或整数向量,指定要提取的元素。可选的condition是一个用于选择数据的SQL子句的字符串(例如,“极限”10“,”染色体= 1“)。

getChromosome(object, index, condition, char=FALSE): A vector of chromosomes.  The optional index is a logical or integer vector specifying elements to extract.  The optional condition is a character string with an SQL clause used to select data (e.g., "LIMIT 10", "WHERE chromosome=1"). 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, condition, char=FALSE):一个染色体的向量。可选的index是一个逻辑或整数向量,指定要提取的元素。可选的condition是一个用于选择数据的SQL子句的字符串(例如,“极限”10“,”染色体= 1“)。如果char=FALSE(默认),返回一个整数向量。如果char=TRUE,返回一个字符向量中的元素(1:22,X,XY,Y,男,ü)。的“U”代表“未知”,是不能在其他类别的任何染色体代码的价值。

getPosition(object, index, condition): An integer vector of base pair positions.  The optional index is a logical or integer vector specifying elements to extract.    The optional condition is a character string with an SQL clause used to select data (e.g., "LIMIT 10", "WHERE chromosome=1").
getPosition(object, index, condition):一个碱基对位置的整数向量。可选的index是一个逻辑或整数向量,指定要提取的元素。可选的condition是一个用于选择数据的SQL子句的字符串(例如,“极限”10“,”染色体= 1“)。

getVariable(object, varname, index, condition): A vector of the column varname.  The optional index is a logical or integer vector specifying elements to extract.  The optional condition is a character string with an SQL clause used to select data (e.g., "LIMIT 10", "WHERE chromosome=1"). Returns NULL if varname is not found in object.
getVariable(object, varname, index, condition):一个列varname向量。可选的index是一个逻辑或整数向量,指定要提取的元素。可选的condition是一个用于选择数据的SQL子句的字符串(例如,“极限”10“,”染色体= 1“)。返回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):返回元数据描述的注释变量作为一个数据框。

getQuery(object, statement): Returns result of the SQL query statement.
getQuery(object, statement):返回SQL查询statement的结果。

writeAnnotation(object, value, append=FALSE,         overwrite=TRUE): Writes value to the SNP annotation table.  value must be a data.frame containing columns "snpID", "chromosome", and "position".
writeAnnotation(object, value, append=FALSE,         overwrite=TRUE):写入value SNP的注释表。 value必须是数据框包含列“snpID”,“染色体”,“位置”。

writeMetadata(object, value, append=FALSE,         overwrite=TRUE): Writes value to the metadata table. value should be a data.frame containing columns "varname" and "description".
writeMetadata(object, value, append=FALSE,         overwrite=TRUE):写入value元数据表。 value应该是一个数据框包含列“varname的”和“说明”。

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

ScanAnnotationSQLite, SnpAnnotationDataFrame, GenotypeData, IntensityData
ScanAnnotationSQLite,SnpAnnotationDataFrame,GenotypeData,IntensityData


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


library(GWASdata)
dbpath <- tempfile()
snpAnnot <- SnpAnnotationSQLite(dbpath)

data(affy_snp_annot)
writeAnnotation(snpAnnot, affy_snp_annot)

# list columns[列表中的列]
vars <- getVariableNames(snpAnnot)

# add metadata[添加元数据]
metadf <- data.frame(varname=vars, description=rep(NA, length(vars)),
  row.names=vars, stringsAsFactors=FALSE)
metadf["snpID", "description"] <- "integer id"
writeMetadata(snpAnnot, metadf)

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

# get positions only for chromosome 22[只得到22号染色体的位置]
pos22 <- getPosition(snpAnnot, condition="WHERE chromosome = 22")

# get rsID[获得RSID]
if (hasVariable(snpAnnot, "rsID")) rsID <- getVariable(snpAnnot, "rsID")

# display data[显示数据]
head(getAnnotation(snpAnnot))
getMetadata(snpAnnot)

close(snpAnnot)
file.remove(dbpath)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-6 06:54 , Processed in 0.023805 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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