orchard: Minimum-Inbreeding seed orchard layout.

Description Usage Arguments Details Value Author(s) References Examples

Description

Function to calculate the Minimum-Inbreeding seed orchard layout from supplied coancestry matrix (GM) and respective seed orchard grid (GR). It then transforms the input (GR) to the "flow" matrix and (GR) to the "distance" matrix; These are transferred to the package 'qap' (instance of the quadratic assignment problem). The solution is then allocated on the respective grid. Methodical details are provided in the scientific reference paper.

Usage

1
orchMI(ID, GR, GM, xy, ...)

Arguments

ID

Clonal identification (column 1: clonal ID, column2: respective clonal size, i.e. number of ramets). This input must be declared. User may optionaly declare the actual clonal ID codes as row names of the ID. The function would then return MI layout with these codes.

GR

Seed orchard grid - ascending numbering of planting positions (row-wise from left/up to write/down); zeros: empty positions. This input must be declared.

GM

Coancestry matrix. When absent, all clones are assumed unrelated and non-inbred (maximum separation among ramets of the same clone).

xy

The ratio of the x/y planting distance, 1: equal x and y. When absent, the default value is 1.

...

Optional arguments of the "qap" package. See "qap" manual for details.

Details

This function utilizes the following packages: qap, distances, DescTools.

Value

Returns the optimized MI layout (matrix with clonal ID's corresponding to the supplied grid matrix).

Author(s)

Milan Lstiburek lstiburek@fld.czu.cz

Jaroslav Cepl

References

Lstiburek M & El-Kassaby YA (2010). Minimum-inbreeding seed orchard design. Forest Science 56(6): 603-608.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
GRMAT <- matrix(1:9, nrow=3, byrow=TRUE) #grid of 9 positions
#1 2 3
#4 5 6
#7 8 9

#4 clones: 2 ramets,1 clone: 1 ramet
IDMAT <- matrix(0:0, nrow=5, ncol=2)
IDMAT[,1] <- 1:5 #clonal ID's in the first column
IDMAT[,2] <- 2 #clonal sizes in the second column
IDMAT[5,2] <- 1 #clonal sizes in the second column
#1 2
#2 2
#3 2
#4 2
#5 1

GMAT <- matrix(0:0, nrow=5, ncol=5) #coancestry matrix
diag(GMAT) <- 0.5 # all clones unrelated
#0.5 0 0 0 0
#0 0.5 0 0 0
#0 0 0.5 0 0
#0 0 0 0.5 0
#0 0 0 0 0.5

MI <- orchMI(ID = IDMAT, GR = GRMAT, GM = GMAT, xy = 1.5, rep = 10)
#note one extra argument "rep" is passed to the "qap package,
#see the "qap" documentation.
MI #MI solution with respective clonal ID at each position:
#3 4 1
#2 5 2
#1 4 3

#Alternatively, we can assume the central position on the grid empty:
#GRMAT <- matrix(0:0, nrow=3, ncol=3) #grid of 9 positions
#GRMAT[1,1] <- 1 #note asscending numbering
#GRMAT[1,2] <- 2
#GRMAT[1,3] <- 3
#GRMAT[2,1] <- 4
#GRMAT[2,2] <- 0 #empty position
#GRMAT[2,3] <- 5 #starts where we left
#GRMAT[3,1] <- 6
#GRMAT[3,2] <- 7
#GRMAT[3,3] <- 8
#1 2 3
#4 0 5
#6 7 8

#IDMAT <- matrix(0:0, nrow=4, ncol=2) #4 clones, 2 ramets each
#IDMAT[,1] <- 1:4
#IDMAT[,2] <- 2
#1 2
#2 2
#3 2
#4 2

#Specification of the actual clonal codes:
#rownames(IDMAT) <- c("a", "b", "c", "d")

#As the clones are unrelated, we skip the GM matrix:

#MI <- orchMI(ID = IDMAT, GR = GRMAT, xy = 1.5, rep = 10)
#MI solution with respective clonal ID at each position:
#c d a
#b 0 b #central position is empty as requested
#a d c

#Bigger input matrices can be prepared externally (e.g., MS Excel):
#list.files()
#IDMAT <- as.matrix(read.delim("ID.dat", header = F))
#GRMAT <- as.matrix(read.delim("grid.dat", header = F))
#GMAT <- as.matrix(read.delim("GM.dat", header = F))

mlstiburek/orchards documentation built on July 25, 2020, 7:22 a.m.