build.knowns {TRAMPR}R Documentation

Automatically Build Knowns Database

Description

This function uses several filters to select likely knowns, and construct a TRAMPknowns object from a TRAMPsamples object. Samples are considered to be “potential knowns” if they have data for an adequate number of enzyme/primer combinations, and if for each combination they have either a single peak, or a peak that is “distinct enough” from any other peaks.

Usage

build.knowns(d, min.ratio=3, min.comb=NA, restrict=FALSE, ...)

Arguments

d

A TRAMPsamples object, containing samples from which to build the knowns database.

min.ratio

Minimum ratio of maximum to second highest peak to accept known (see Details).

min.comb

Minimum number of enzyme/primer combinations required for each known (see Details for behaviour of default).

restrict

Logical: Use only cases where d$info$species is non-blank? (These are assumed to come from samples of a known species. However, it is not guaranteed that all samples with data for species will become knowns; if they fail either the min.ratio or min.comb checks they will be excluded.)

...

Additional arguments passed to TRAMPknowns (e.g. cluster.pars, file.pat and any additional objects).

Details

For all samples and enzyme/primer combinations, the ratio of the largest to the second largest peak is calculated. If it is greater than min.ratio, then that combination is accepted. If the sample has at least min.comb valid enzyme/primer combinations, then that sample is included in the knowns database. If min.comb is NA (the default), then every enzyme/primer combination present in the data is required.

Value

A new TRAMPknowns object. It will generally be neccessary to edit this object; see read.TRAMPknowns for details on how to write, edit, and read back a modified object.

Note

If two peaks have the same height, then using min.ratio=1 will not allow the entry as part of the knowns database; use min.ratio=0 instead if this is desired. In this case, the peak chosen is unspecified.

Note that this function is sensitive to data quality. In particular split peaks may cause a sample not to be added. These samples may be manually added using add.known.

Examples

data(demo.samples)
demo.knowns.auto <- build.knowns(demo.samples, min.comb=4)
plot(demo.knowns.auto, cex=.75)

[Package TRAMPR version 1.0-10 Index]