UCSCTableQuery-class(rtracklayer)
UCSCTableQuery-class()所属R语言包:rtracklayer
Querying UCSC Tables
查询UCSC的表
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The UCSC genome browser is backed by a large database, which is exposed by the Table Browser web interface. Tracks are stored as tables, so this is also the mechanism for retrieving tracks. The UCSCTableQuery class represents a query against the Table Browser. Storing the query fields in a formal class facilitates
UCSC基因组浏览器是由一个庞大的数据库,这是暴露表浏览器Web界面支持。曲目存储表,所以这也是轨道检索机制。 UCSCTableQuery类代表了对表浏览器的查询。在一个正式的类存储查询字段有利于
Details
详情----------Details----------
There are five supported fields for a table query:
有5个支持表查询中的字段:
session The UCSCSession instance from the tables are retrieved. Although all sessions are based on the same database, the set of user-uploaded tracks, which are represented as tables, is not the same, in general.
会议UCSCSession从表的实例检索。虽然基于相同的数据库,用户上传的轨道,这是代表表的所有会议上,是不一样的,一般。
trackName The name of a track from which to retrieve a table. Each track can have multiple tables. Many times there is a primary table that is used to display the track, while the other tables are supplemental. Sometimes, tracks are displayed by aggregating multiple tables.
trackName轨道从中检索表的名称。每首曲目可以有多个表。有很多时候是一个主表,用于显示轨道,而其他表的补充。有时候,通过聚合多个表显示曲目。
tableName The name of the specific table to retrieve. May be NULL, in which case the behavior depends on how the query is executed, see below.
检索的特定表的TableName的名称。可NULL,在这种情况下,行为取决于如何执行查询,见下文。
range A genome identifier, a GRanges or a RangesList indicating the portion of the table to retrieve, in genome coordinates. Simply specifying the genome string is the easiest way to download data for the entire genome, and GRangesForUCSCGenome facilitates downloading data for e.g. an entire chromosome.
一个基因组范围的标识符,GRanges或RangesList检索表的部分,表明在基因组坐标。只需指定的基因组字符串是最简单的方式下载整个基因组的数据,GRangesForUCSCGenome方便如下载数据一个完整的染色体。
names Names/accessions of the desired features
地名名称/加入所需的功能
A common workflow for querying the UCSC database is to create an instance of UCSCTableQuery using the ucscTableQuery constructor, invoke tableNames to list the available tables for a track, and finally to retrieve the desired table either as a data.frame via getTable or as a RangedData track via track. See the examples.
UCSC的数据库查询的一个共同的工作流程是创建一个实例UCSCTableQuery使用ucscTableQuery构造,调用tableNames列出可用表的轨道,并最终获取所需的表作为data.frame通过getTable或经RangedDatatrack轨道。见的例子。
The reason for a formal query class is to facilitate multiple queries when the differences between the queries are small. For example, one might want to query multiple tables within the track and/or same genomic region, or query the same table for multiple regions. The UCSCTableQuery instance can be incrementally adjusted for each new query. Some caching is also performed, which enhances performance.
正式查询类的原因是为了方便多个查询时,查询之间的差异很小。例如,一个可能要查询的轨道和/或相同的基因组区域内的多个表或查询同一个表的多个区域。 UCSCTableQuery实例,可以逐步调整为每一个新的查询。也进行一些缓存,从而提高性能。
构造----------Constructor----------
ucscTableQuery(x, track, range = genome(x), table = NULL, names = NULL): Creates a UCSCTableQuery with the UCSCSession given as x and the track name given by the single string track. range should be a genome string identifier, a GRanges instance or RangesList instance, and it effectively defaults to genome(x). If the genome is missing, it is taken from the session. The table name is given by table, which may be a single string or NULL. Feature names, such as gene identifiers, may be passed via names as a character vector.
ucscTableQuery(x, track, range = genome(x), table = NULL, names = NULL):创建与的UCSCTableQueryUCSCSession和曲目名称由单个字符串xtrack,。 range应该是基因组字符串标识符,GRanges实例或RangesList实例,它有效地默认genome(x)。如果缺少的基因,它是从会话。表的名称是由table,这可能是一个字符串或NULL。可通过功能的名称,如基因标识,通过names作为一个特征向量。
执行查询----------Executing Queries----------
Below, object is a UCSCTableQuery instance.
下面,objectUCSCTableQuery实例。
track(object, asRangedData = TRUE): Retrieves the indicated table as a track, i.e. a RangedData instance. Note that not all tables are available as tracks. Pass asRangedData = FALSE to obtain a GRanges object.
track(object, asRangedData = TRUE):检索指定的表作为一个轨道,即RangedData实例。请注意,并非所有的表作为轨道。通过asRangedData = FALSE获得GRanges对象。
getTable(object): Retrieves the indicated table as a data.frame. Note that not all tables are output in parseable form.
getTable(object):检索data.frame的指示表。请注意,并非所有的表都是在解析的形式输出。
tableNames(object): Gets the names of the tables available for the session, track and range specified by the query.
tableNames(object):获取会话,跟踪和查询指定的范围内提供的表的名称。
存取方法----------Accessor methods----------
In the code snippets below, x/object is a UCSCTableQuery object.
在下面的代码片段,x/object是UCSCTableQuery对象。
browserSession(object), browserSession(object) <- value: Get or set the UCSCSession to query.
browserSession(object),browserSession(object) <- value:获取或设置UCSCSession来查询。
trackName(x), trackName(x) <- value: Get or set the single string indicating the track containing the table of interest.
trackName(x),trackName(x) <- value:获取或设置单个字符串包含利率表指示轨道。
trackNames(x)
trackNames(x)
List the names of the tracks available for retrieval for the assigned genome.
分配的基因组列出用于检索的曲目名称。
tableName(x), tableName(x) <- value: Get or set the single string indicating the name of the table to retrieve. May be NULL, in which case the table is automatically determined.
tableName(x),tableName(x) <- value:获取或设置指示表的名称来检索单个字符串。可能是NULL,在这种情况下,该表自动确定。
range(x), range(x) <- value: Get or set the GRanges indicating the portion of the table to retrieve in genomic coordinates. Any missing information, such as the genome identifier, is filled in using range(browserSession(x)). It is also possible to set the genome identifier string or a RangesList.
range(x),range(x) <- value:获取或设置GRanges表明,在基因组的坐标检索表的部分。任何缺少的信息,如基因组标识符,是充满使用range(browserSession(x))。它也有可能设置的基因组标识符字符串或一个RangesList。
names(x), names(x) <- value: Get or set the names of the features to retrieve. If NULL, this filter is disabled.
names(x),names(x) <- value:获取或设置检索功能的名称。如果NULL,这个过滤器被禁用。
ucscSchema(x): Get
ucscSchema(x):
作者(S)----------Author(s)----------
Michael Lawrence
举例----------Examples----------
## Not run: [#无法运行:]
session <- browserSession()
genome(session) <- "mm9"
trackNames(session) ## list the track names[#列出的曲目名称]
## choose the Conservation track for a portion of mm9 chr1[#选择的MM9 chr1的部分养护轨道]
query <- ucscTableQuery(session, "Conservation",
GRangesForUCSCGenome("mm9", "chr12",
IRanges(57795963, 57815592))))
## list the table names[#列出的表名]
tableNames(query)
## get the phastCons30way track[#得到phastCons30way轨道。]
tableName(query) <- "phastCons30way"
## retrieve the track data[#检索的轨道数据。]
track(query)
## get a data.frame summarizing the multiple alignment[#总结了多序列比对的数据框。]
tableName(query) <- "multiz30waySummary"
getTable(query)
genome(session) <- "hg18"
query <- ucscTableQuery(session, "snp129",
names = c("rs10003974", "rs10087355", "rs10075230"))
ucscSchema(query)
getTable(query)
## End(Not run)[#结束(不运行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|