Description Usage Arguments Value Examples
The functions below have been written mainly for use in the package MoBPS written by Torsten Pook.
codeOrigins
compresses information about generation of
introduced new genes,
sex, number of individuals and haplotype in a single 32 Bit integer
value.
decodeOrigins
make the compressed data human readable again.
computeSNPS
extracts from a coded, complete breeding scheme
an individuum defined by its generation, sex and number within its
cohort.
compute
essentially
concatenates (efficiently) the three commands computeSNPS
,
relationshipMatrix
,
solveRelMat
1 2 3 4 5 6 | codeOrigins(M)
decodeOrigins(CM, row)
computeSNPS(population, gen, sex, nr, from_p = 1, to_p = Inf,
output_compressed=FALSE, select = NULL, what = c("geno", "haplo"))
compute(population, gen, sex, nr, tau, vec, betahat, select = NULL,
matrix.return=FALSE)
|
M |
matrix with information on generation of introduced new genes, sex, number of individual and haplotype on each line. the generation takes values in 1...2^6, sex values in 1...2^1, individual values in 1...2^22 and the haplotype values in 1...2^3 |
CM |
a vector obtained from coding a matrix by |
row |
integer. Row number of the matrix |
population |
list of list, as described in package MoBPs, which contains the whole information of all generations of a breeding scheme |
gen,sex,nr |
information specifying an individuum; instead of the
three argument, only |
from_p, to_p |
loci between which the genomic information of the specified individuum is extracted. Default: whole genomic information |
output_compressed |
logical. If |
select |
integer vector. List of loci that should be returned;
the loci might be further restricted by |
what |
The type of information that should be extracted and returned |
tau,vec,betahat |
see |
matrix.return |
logical. If |
codeOrigins
: a vector with length equal to the number of
rows of M
.
decodeOrigins
: an integer vector of 4 components.
computeSNPS
: vector of integers with either human readable
values or compressed data depending on the argument what
.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
set.seed(0)
n <- sample(1000, 1)
M <- cbind(sample(1:2^6, n, replace=TRUE),
sample(1:2^1, n, replace=TRUE),
sample(1:2^22, n, replace=TRUE),
sample(1:2^3, n, replace=TRUE))
print(head(M))
Z <- matrix(NA, ncol=ncol(M), nrow=nrow(M))
CM <- codeOrigins(M)
print(head(CM))
for (i in 1:nrow(M)) Z[i, ] <- decodeOrigins(CM, i)
stopifnot(all(M == Z))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.