RFLPdist2ref: Compute distance between RFLP data and RFLP reference data.

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/RFLPdist2ref.R

Description

Function to compute distance between RFLP data and RFLP reference data.

Usage

1
RFLPdist2ref(x, ref, distfun = dist, nrBands, LOD = 0)

Arguments

x

data.frame with RFLP data; e.g. RFLPdata.

ref

data.frame with RFLP reference data; e.g. RFLPref.

distfun

function computing the distance with default dist; cf. dist.

nrBands

only samples and reference samples with this number of bands are considered.

LOD

threshold for low-bp bands.

Details

For each sample with nrBands bands the distance to each reference sample with nrBands bands is computed. The result is a matrix with the corresponding distances where rows represent the samples and columns the reference samples.

If LOD > 0 is specified, all values below LOD are removed before the distances are calculated. This applies to x and ref.

Value

A matrix with distances.

Author(s)

Fabienne Flessa Fabienne.Flessa@uni-bayreuth.de,
Alexandra Kehl Alexandra.Kehl@botgarten.uni-tuebingen.de,
Matthias Kohl Matthias.Kohl@stamats.de

References

Flessa, F., Kehl, A., Kohl, M. Analysing diversity and community structures using PCR-RFLP: a new software application. Molecular Ecology Resources 2013 Jul; 13(4):726-33.

See Also

RFLPdata, dist

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Euclidean distance
data(RFLPdata)
data(RFLPref)
nrBands(RFLPref)
RFLPdist2ref(RFLPdata, RFLPref, nrBands = 4)
RFLPdist2ref(RFLPdata, RFLPref, nrBands = 6)

Dir <- system.file("extdata", package = "RFLPtools") # input directory 
filename <- file.path(Dir, "AZ091016_report.txt")
RFLP1 <- read.rflp(file = filename)
RFLP2 <- RFLPqc(RFLP1)
nrBands(RFLP2)
RFLPdist2ref(RFLP1, RFLPref, nrBands = 4)
RFLPdist2ref(RFLP1, RFLPref, nrBands = 5)

RFLPtools documentation built on May 2, 2019, 6:08 p.m.