miraculix: MIRACULIX

Description Details Support Author(s) Examples

Description

Various functions used in quantitative genetics

Details

  1. Very fast calculation of genomic relationship matrix for 0-1-coded haplotypes and 0-1-2-coded genotypes; Matrix should be in the RAM

    1. relationshipMatrix fast calculation of (M-P) (M-P)^T / σ^2

    2. crossprodx fast implementation of crossprod for SNP matrices

  2. further commands

    1. haplomatrix compresses haplotype data

    2. as.matrix uncompresses genomicmatrix or haplomatrix

    3. genomicmatrix transformation to a compressed genotype from a usual matrix or a compressed haplotype

    4. genomicmatrix,fillGeno creating a compressed matrix and filling it with uncompressed data. These two functions make sense if the SNP matrix is too large to be kept in the RAM.

    5. solveRelMat calculates the inverse of a relatioship matrix and also solves equations

    6. allele_freq calculates the allele frequencies of a SNP matrix that might have been compressed by genomicmatrix, for instance.

    7. genoVector, vectorGeno multiplication of vector onto a compressed SNP matrix from the right and left, respectively.

    8. vectorGeno etc. fast calculation of 012 matrix with an arbitrary vector

    9. matrixvector012 etc. fast calculation of an arbitrary matrix with a 012 vector

  3. Functions related to the package MoBPs by Torsten Pook.

    1. codeOrigins,decodeOrigins compressed data representation of breeding relevant information of an individuum

    2. computeSNPS calculates the genome of an individuum from the coding in the population tree

    3. compute concatenation of computeSNPS, relationshipMatrix, and solveRelMat

Support

This package was partially developed at the Department of Animal Breeding and Genetics and CiBreed, University of Goettingen.

Author(s)

\martin

;

Malena Erbe

Examples

1
2
3
4
5
indiv <- 5
snps <- indiv * 10
M <- matrix(ncol=indiv, sample(0:2, indiv * snps, replace=TRUE))
print(M)
print(relationshipMatrix(M))

Example output

Loading required package: RandomFieldsUtils
'miraculix' sees OMP, SSE2, but not AVX2, SSSE3.
Without appropriate SIMD instruction set, the calculations might be slow.
Consider recompiling 'miraculix'  with flags e.g.,
 install.packages("miraculix", configure.args="CXX_FLAGS=-march=native")
 install.packages("miraculix", configure.args="CXX_FLAGS=-mavx2")
Alternatively consider installing 'miraculix'
from https://github.com/schlather/miraculix, i.e.,
   install.packages("devtools")
   library(devtools)
   devtools::install_github("schlather/miraculix/pkg")
      [,1] [,2] [,3] [,4] [,5]
 [1,]    0    0    1    1    2
 [2,]    0    0    1    0    2
 [3,]    1    0    2    2    2
 [4,]    1    0    1    2    0
 [5,]    0    0    2    2    0
 [6,]    2    1    1    1    2
 [7,]    2    0    0    0    2
 [8,]    2    2    2    1    2
 [9,]    2    2    1    2    2
[10,]    0    0    2    1    0
[11,]    1    1    2    2    1
[12,]    0    0    0    1    0
[13,]    2    1    0    2    0
[14,]    1    0    0    1    1
[15,]    2    0    2    2    2
[16,]    1    0    2    1    1
[17,]    1    0    1    0    0
[18,]    2    2    1    0    1
[19,]    2    1    2    2    0
[20,]    2    0    1    0    2
[21,]    2    0    1    2    1
[22,]    2    2    1    1    2
[23,]    0    0    1    0    0
[24,]    2    2    2    2    1
[25,]    0    0    2    2    0
[26,]    1    0    0    2    0
[27,]    2    1    0    1    1
[28,]    2    0    2    2    0
[29,]    0    2    1    1    2
[30,]    2    2    2    0    0
[31,]    1    2    1    0    0
[32,]    0    2    0    0    0
[33,]    0    1    2    2    1
[34,]    1    2    1    2    1
[35,]    1    2    1    0    0
[36,]    1    2    2    1    0
[37,]    2    1    0    1    0
[38,]    0    1    2    0    0
[39,]    1    0    0    0    1
[40,]    1    0    2    0    2
[41,]    1    0    2    0    0
[42,]    0    1    1    2    1
[43,]    1    1    2    2    1
[44,]    2    1    2    1    2
[45,]    2    2    2    1    0
[46,]    2    0    1    1    1
[47,]    2    2    0    1    0
[48,]    0    0    2    1    1
[49,]    1    1    0    2    1
[50,]    0    2    1    1    1
           [,1]       [,2]        [,3]        [,4]       [,5]
[1,]  1.0916031 -0.1297710 -0.45419847 -0.30152672 -0.2061069
[2,] -0.1297710  1.4160305 -0.43511450 -0.47328244 -0.3778626
[3,] -0.4541985 -0.4351145  1.24427481 -0.03435115 -0.3206107
[4,] -0.3015267 -0.4732824 -0.03435115  1.16793893 -0.3587786
[5,] -0.2061069 -0.3778626 -0.32061069 -0.35877863  1.2633588
attr(,"centered")
[1] TRUE

miraculix documentation built on Sept. 22, 2021, 5:07 p.m.