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

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

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

                                        Class ScanAnotationSQLite
                                         类ScanAnotationSQLite

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

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

The ScanAnnotationSQLite class stores annotation data associated with scans, as well as metadata describing each column, in an SQLite database.
ScanAnnotationSQLite类存储注释数据与扫描,以及描述每个列的元数据,在一个SQLite数据库。


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

ScanAnnotationSQLite(dbpath):
ScanAnnotationSQLite(dbpath):

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

"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" 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 ScanAnnotationSQLite constructor creates and returns a ScanAnnotationSQLite instance.
ScanAnnotationSQLite构造创建和返回ScanAnnotationSQLite实例。


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

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

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

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

nscan(object): The number of scans in the database.
nscan(object):在数据库中的扫描数目。

getScanID(object, index, condition): A unique integer vector of scan 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 sex='M'").
getScanID(object, index, condition):一个独特的扫描标识的整数向量。可选的index是一个逻辑或整数向量,指定要提取的元素。可选condition是一个用于选择数据的SQL子句的字符串(例如,“极限”10“,”性“M”)。

getSex(object, index, condition): A character vector of sex, with values 'M' or 'F'.    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.
getSex(object, index, condition):对性的特征向量,“M”或“F”值。可选的index是一个逻辑或整数向量,指定要提取的元素。可选的condition是一个用于选择数据的SQL子句的字符串。

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

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 sex='M'"). Returns NULL if varname is not found in object.
getVariable(object, varname, index, condition):一个列varname向量。可选的index是一个逻辑或整数向量,指定要提取的元素。可选condition是一个用于选择数据的SQL子句的字符串(例如,“极限”10“,”性“M”)。返回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 scan annotation table.  value must be a data.frame containing a column "scanID".
writeAnnotation(object, value, append=FALSE,         overwrite=TRUE):写入value扫描注释表。 value必须有一个数据框包含列“scanID”。

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的”和“说明”。


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


Stephanie Gogarten



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

SnpAnnotationSQLite, ScanAnnotationDataFrame, GenotypeData, IntensityData
SnpAnnotationSQLite,ScanAnnotationDataFrame,GenotypeData,IntensityData


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


library(GWASdata)
dbpath <- tempfile()
scanAnnot <- ScanAnnotationSQLite(dbpath)

data(affy_scan_annot)
writeAnnotation(scanAnnot, affy_scan_annot)

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

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

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

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

close(scanAnnot)
file.remove(dbpath)

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


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

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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