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

R语言 TRAMPR包 add.known()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-10-1 11:42:36 | 显示全部楼层 |阅读模式
add.known(TRAMPR)
add.known()所属R语言包:TRAMPR

                                        Add Knowns To TRAMPknowns Databases
                                         添加要TRAMPknowns数据库的已知

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

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

Add a single known or many knowns to a knowns database in a TRAMPknowns object.  add.known takes a TRAMPknowns object, and adds the peak profile of a single sample from a TRAMPsamples object. combine.TRAMPknowns combines two TRAMPknowns objects (similar to combine.TRAMPsamples). add.known and combine are generic, so if x argument is a TRAMP object, then the knowns component of that object will be updated.
添加一个已知或多个已知一个已知数据库中的一个TRAMPknowns对象。 add.known需要TRAMPknowns对象,从TRAMPsamples对象,并增加了对单个样品的峰形。 combine.TRAMPknowns结合两个TRAMPknowns对象(类似于combine.TRAMPsamples)。 add.known和combine是通用的,因此,如果x的说法是一个TRAMP对象,那么knowns组成部分,该对象将被更新。


用法----------Usage----------


add.known(x, ...)
## S3 method for class 'TRAMPknowns'
add.known(x, samples, sample.fk, prompt=TRUE, default.species=NULL, ...)
## S3 method for class 'TRAMP'
add.known(x, sample.fk, rebuild=TRUE, ...)

## S3 method for class 'TRAMPknowns'
combine(x, y, rewrite.knowns.pk=FALSE, ...)
## S3 method for class 'TRAMP'
combine(x, y, rebuild=TRUE, ...)



参数----------Arguments----------

参数:x
A TRAMPknowns or TRAMP object, containing identified TRFLP patterns.
ATRAMPknowns或TRAMP对象,包含确定TRFLP模式。


参数:samples
A TRAMPsamples object, containing unidentified samples.
ATRAMPsamples对象,含有不明身份的样本。


参数:sample.fk
sample.fk of sample in samples to add to the knowns database.  If x is a TRAMP object, then sample.fk refers to a sample in the TRAMPsamples object used in the creation of that TRAMP object (stored as x$samples: see labels(x$samples) for codes).
sample.fk samples添加到已知数据库的样本。如果x是TRAMP对象,然后sample.fk是指用于样品中的TRAMPsamples对象的创建,TRAMP对象(存储为x$samples:看到labels(x$samples)代码)。


参数:prompt
Logical: Should the function interactively prompt for a new species name?
逻辑:如果交互式提示一个新的物种名称的功能?


参数:default.species
Default species name.  If NULL (the default), the name chosen will be the value of samples$info$species for the current sample.  Set to NA if no name is currently known (see group.knowns - identical non-NA names are considered related).
默认物种的名称。如果NULL(默认值),所选择的名称将当前样本的价值samples$info$species。设置为NA,如果没有名字是目前已知的(见group.knowns  - 相同非NA名被认为是相关的)。


参数:y
A second TRAMPknowns object, containing knowns to add to x.
第二TRAMPknowns对象,其中包含已知添加到x的。


参数:rewrite.knowns.pk
Logical: If the new knowns data contain knowns.pk values that conflict with those in the original TRAMPknowns object, should the new knowns be renumbered?  If this is TRUE, do not rely on any knowns.pk values staying the same for the newly added knowns. knowns.pk values in the original TRAMPknowns object will never be changed.
逻辑:如果新的已知数据包含knowns.pk值冲突与原TRAMPknowns对象的,应重新编号,新的已知的吗?如果这是TRUE,不依赖于任何knowns.pk为新添加的已知值保持相同。 knowns.pk值在原TRAMPknowns对象将永远不会改变的。


参数:rebuild
Logical: should the TRAMP object be rebuilt after adding knowns, by running rebuild.TRAMP on it?  This is important to determine if the new known(s) match any of the samples in the TRAMP object.  This should be left as TRUE unless you plan on manually rebuilding the object later.
逻辑:TRAMP对象进行重建后,加入已知,通过运行rebuild.TRAMP就可以了吗?这是非常重要的决定,如果新的已知(S)匹配任何样本在TRAMP对象。这应该保留TRUE除非您打算手动重建后的对象。


参数:...
Additional arguments passed to future methods.
额外的参数传递给未来的方法。


Details

详细信息----------Details----------

(add.known only): When adding the profile of a single individual via add.known, if more than one peak per enzyme/primer combination is present we select the most likely profile by picking the highest peak (largest height value) for each enzyme/primer combination (a warning will be given).  If two peaks are of the same height, then the peak taken is unspecified (similar to build.knowns with min.ratio=0).
(add.known):当将通过add.known,如果存在一个以上的峰值,根据酶/引物组合,我们选择了最有可能的个人资料,挑选最高峰(最大单一个人档案添加 height值)为每一种酶/引物组合(警告)。如果两个峰同样的height,然后的峰值是不确定的(类似build.knowns与min.ratio=0的,)。

(combine only): rewrite.knowns.pk provides a simple way of merging knowns databases that use the same values of knowns.pk.  Because knowns.pk must be unique, if y (the new knowns database) uses knowns.pk values present in x (the original database), then the knowns.pk values in y must be rewritten.  This will be done by adding max(labels(x)) to every knowns.pk value in y$info and knowns.fk value in y$data.
(combine):rewrite.knowns.pk合并已知的数据库使用相同的值的knowns.pk提供一个简单的方法。因为knowns.pk必须是唯一的,如果y(新的已知资料库)使用knowns.pk值出现在x(原始数据库),然后knowns.pk值在y必须重写。这项工作将通过添加max(labels(x))每knowns.pk值y$info和knowns.fk值y$data的。

If retaining knowns.pk information is important, we suggest saving the value of knowns.pk before running this function, e.g.
如果保留knowns.pk信息是很重要的,我们建议knowns.pk之前运行此功能,例如保存价值

info$knowns.pk.old <- info$knowns.pk
info$knowns.pk.old <- info$knowns.pk

If more control over the renaming process is required, manually adjust y$info$knowns.pk yourself before calling this function. However, by default no translation will be done, and an error will occur if x and y share knowns.pk values.
如果在重命名过程中,需要更多的控制,手动调整y$info$knowns.pk你自己,然后再调用这个函数。不过,默认情况下,没有翻译完成后,会发生错误,如果x和y份额knowns.pk值。

For add.known, only a subset of columns are passed to the knowns object (a future version may be more inclusive):
对于add.known,只列的子集被传递到的的已知物体(未来的版本可能会更具包容性的):

From samples$info: sample.pk (as knowns.pk.)
从samples$info:sample.pk(knowns.pk。)

From samples$data: sample.fk (as knowns.fk), primer, enzyme, size.
从samples$data:sample.fk(knowns.fk)primer,enzyme,size。

For combine, the data and info elements of the resulting TRAMPknowns object will have the union of the columns present in both sets of knowns.  If any additional elements exist as part of the second TRAMPknowns object (e.g. passed as ... to TRAMPknowns when creating y), these will be ignored.
对于combine,data和info元素产生的TRAMPknowns对象将有工会的列中存在的已知两组。如果有任何额外的元素存在的第二个TRAMPknowns对象(例如,通过为...TRAMPknowns在创建y),这些都将被忽略的一部分。


值----------Value----------

An object of the same class as x: if a TRAMP object is supplied, a new TRAMP object with an updated TRAMPknowns component will be returned, and if the object is a TRAMPknowns object an updated TRAMPknowns object will be returned.
x:如果TRAMP对象,提供一个新的TRAMP对象的更新TRAMPknowns组件将被退回,如果对象是同一类的一个对象一个TRAMPknowns对象TRAMPknowns对象将被返回。


注意----------Note----------

If the TRAMPknowns object has a file.pat element (see TRAMPknowns), then the new knowns database will be written to file.  This may be confusing when operating on TRAMP objects directly, since both the TRAMPknowns object used in the TRAMP object and the original TRAMPknowns object will share the same file.pat argument, but contain different data as soon as add.known or combine is used.  In short - be careful!  To avoid this issue, either set file.pat to NULL before using add.known or combine.
如果TRAMPknowns对象有一个file.pat元素(见TRAMPknowns),然后在新的已知数据库将被写入文件。这可能是混乱时,直接在TRAMP对象,以来TRAMPknowns对象的TRAMP对象和原TRAMPknowns对象将共享相同的file.pat 参数,但包含不同的数据尽快add.known或combine使用。总之 - 小心!为了避免这个问题,无论是file.pat到NULL使用add.known或combine之前。


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

build.knowns, which automatically builds a knowns database, and TRAMPknowns, which documents the object containing the knowns database.
build.knowns,自动生成一个已知的数据库,并TRAMPknowns,它记载了对象,其中包含已知数据库。

combine.TRAMPsamples, which combines a pair of TRAMPsamples objects.
combine.TRAMPsamples,它结合了对TRAMPsamples对象。


实例----------Examples----------


data(demo.knowns)
data(demo.samples)

## (1) Using add.known(), to add a single known:[#(1)使用add.known(),添加一个已知:]

## Sample "101" looks like a potential known, add it to our knowns[#示例看起来像一个潜在的被称为“101”,将其添加到我们的已知]
## database:[#数据库:]
plot(demo.samples, 101)

## Add this to a knowns database:[#添加到一个已知数据库:]
## Because there is more than one peak per enzyme/primer combination, a[#因为有一个以上的峰值,根据酶/引物组合中,一个]
## warning will be given.  In this case, since there are clear peaks it[#发出警告。在这种情况下,因为有清晰的峰,它]
## is harmless.[#是无害的。]
demo.knowns.2 <- add.known(demo.knowns, demo.samples, 101,
                           prompt=FALSE)

## The known has been added:[#已知的已加入:]
demo.knowns.2[101]
try(demo.knowns[101]) # error - known didn't exist in original knowns[在原来的已知错误 - 被称为不存在]

## Same, but adding to an existing TRAMP object.[#一样,但添加到现有TRAMP对象。]
res <- TRAMP(demo.samples, demo.knowns)
plot(res, 101)
res2 <- add.known(res, 101, prompt=FALSE, default.species="New known")

## Now the new known matches itself.[现在新的已知比赛本身。]
plot(res2, 101)

## (2) Using combine() to combine knowns databases.[#(2)使用联合收割机()结合已知的数据库。]

## Let's split the original knowns database in two:[#让我们分裂原已知数据库中的两个:]
demo.knowns.a <- demo.knowns[head(labels(demo.knowns), 10)]
demo.knowns.b <- demo.knowns[tail(labels(demo.knowns), 10)]

## Combining these is easy:[#结合这些是很容易的:]
demo.knowns.c <- combine(demo.knowns.a, demo.knowns.b)

## Knowns from both the small database are present in the new one:[#已知无论从小型的数据库是在新的一年:]
identical(c(labels(demo.knowns.a), labels(demo.knowns.b)),
          labels(demo.knowns.c))


## Demonstration of knowns rewriting:[示范已知重写:]
demo.knowns.d <- demo.knowns.a
demo.knowns.a$info$from <- "a"
demo.knowns.d$info$from <- "d"

try(combine(demo.knowns.a, demo.knowns.d)) # error[错误]
demo.knowns.e <- combine(demo.knowns.a, demo.knowns.d,
                         rewrite.knowns.pk=TRUE)

## See that both data sets are here (check the "from" column).[#看得出来,这两个数据集的位置(检查“,从”一栏)。]
demo.knowns.e$info

## Note that a better approach in might be to manually resolve[#需要注意的是一个更好的方法可能是手动解决]
## conficting knowns.pk values before combining.[#conficting knowns.pk值,然后结合。]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-30 02:49 , Processed in 0.021698 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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