Learn R Programming

RFLPtools (version 2.0)

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

Description

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

Usage

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.

Value

A matrix with distances.

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.

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

Run this code
# NOT RUN {
## 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)
# }

Run the code above in your browser using DataLab