From 116940b1728b3cb6063d8091434510e673cd49e9 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Sat, 6 Nov 2021 21:12:08 +0000 Subject: [PATCH] build based on 60c3066 --- stable/assets/themes/documenter-dark.css | 8 ++++- stable/assets/themes/documenter-light.css | 43 +++++++++++++---------- stable/functions/index.html | 20 +++++------ stable/guide/analysis/index.html | 2 +- stable/guide/tutorial/index.html | 2 +- stable/index.html | 2 +- stable/search/index.html | 2 +- 7 files changed, 46 insertions(+), 33 deletions(-) diff --git a/stable/assets/themes/documenter-dark.css b/stable/assets/themes/documenter-dark.css index 5a64259..65e34e4 100644 --- a/stable/assets/themes/documenter-dark.css +++ b/stable/assets/themes/documenter-dark.css @@ -1128,7 +1128,7 @@ html.theme--documenter-dark { color: #1dd2af; } html.theme--documenter-dark code { background-color: rgba(255, 255, 255, 0.05); - color: #e74c3c; + color: #ececec; font-size: 0.875em; font-weight: normal; padding: 0.1em; } @@ -7277,8 +7277,12 @@ html.theme--documenter-dark { position: absolute; right: 0.625rem; bottom: 0.5rem; } + html.theme--documenter-dark .docstring > section > a.docs-sourcelink:focus { + opacity: 1 !important; } html.theme--documenter-dark .docstring:hover > section > a.docs-sourcelink { opacity: 0.2; } + html.theme--documenter-dark .docstring:focus-within > section > a.docs-sourcelink { + opacity: 0.2; } html.theme--documenter-dark .docstring > section:hover a.docs-sourcelink { opacity: 1; } html.theme--documenter-dark .documenter-example-output { @@ -7338,6 +7342,8 @@ html.theme--documenter-dark { html.theme--documenter-dark html { -moz-osx-font-smoothing: auto; -webkit-font-smoothing: auto; } + html.theme--documenter-dark li.no-marker { + list-style: none; } html.theme--documenter-dark #documenter .docs-main > article { overflow-wrap: break-word; } html.theme--documenter-dark #documenter .docs-main > article .math-container { diff --git a/stable/assets/themes/documenter-light.css b/stable/assets/themes/documenter-light.css index 3ce8010..14f6a0e 100644 --- a/stable/assets/themes/documenter-light.css +++ b/stable/assets/themes/documenter-light.css @@ -808,10 +808,10 @@ a.has-text-danger:hover, a.has-text-danger:focus { background-color: #4a4a4a !important; } .has-text-grey { - color: #7a7a7a !important; } + color: #6b6b6b !important; } .has-background-grey { - background-color: #7a7a7a !important; } + background-color: #6b6b6b !important; } .has-text-grey-light { color: #b5b5b5 !important; } @@ -1954,7 +1954,7 @@ a.box:active { .button.is-static { background-color: whitesmoke; border-color: #dbdbdb; - color: #7a7a7a; + color: #6b6b6b; box-shadow: none; pointer-events: none; } .button.is-rounded, #documenter .docs-sidebar form.docs-search > input.button { @@ -2862,7 +2862,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { background-color: whitesmoke; border-color: whitesmoke; box-shadow: none; - color: #7a7a7a; } + color: #6b6b6b; } .input[disabled]::-moz-placeholder, #documenter .docs-sidebar form.docs-search > input[disabled]::-moz-placeholder, .textarea[disabled]::-moz-placeholder, .select select[disabled]::-moz-placeholder, fieldset[disabled] .input::-moz-placeholder, fieldset[disabled] #documenter .docs-sidebar form.docs-search > input::-moz-placeholder, @@ -2870,7 +2870,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { fieldset[disabled] .textarea::-moz-placeholder, fieldset[disabled] .select select::-moz-placeholder, .select fieldset[disabled] select::-moz-placeholder { - color: rgba(122, 122, 122, 0.3); } + color: rgba(107, 107, 107, 0.3); } .input[disabled]::-webkit-input-placeholder, #documenter .docs-sidebar form.docs-search > input[disabled]::-webkit-input-placeholder, .textarea[disabled]::-webkit-input-placeholder, .select select[disabled]::-webkit-input-placeholder, fieldset[disabled] .input::-webkit-input-placeholder, fieldset[disabled] #documenter .docs-sidebar form.docs-search > input::-webkit-input-placeholder, @@ -2878,7 +2878,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { fieldset[disabled] .textarea::-webkit-input-placeholder, fieldset[disabled] .select select::-webkit-input-placeholder, .select fieldset[disabled] select::-webkit-input-placeholder { - color: rgba(122, 122, 122, 0.3); } + color: rgba(107, 107, 107, 0.3); } .input[disabled]:-moz-placeholder, #documenter .docs-sidebar form.docs-search > input[disabled]:-moz-placeholder, .textarea[disabled]:-moz-placeholder, .select select[disabled]:-moz-placeholder, fieldset[disabled] .input:-moz-placeholder, fieldset[disabled] #documenter .docs-sidebar form.docs-search > input:-moz-placeholder, @@ -2886,7 +2886,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { fieldset[disabled] .textarea:-moz-placeholder, fieldset[disabled] .select select:-moz-placeholder, .select fieldset[disabled] select:-moz-placeholder { - color: rgba(122, 122, 122, 0.3); } + color: rgba(107, 107, 107, 0.3); } .input[disabled]:-ms-input-placeholder, #documenter .docs-sidebar form.docs-search > input[disabled]:-ms-input-placeholder, .textarea[disabled]:-ms-input-placeholder, .select select[disabled]:-ms-input-placeholder, fieldset[disabled] .input:-ms-input-placeholder, fieldset[disabled] #documenter .docs-sidebar form.docs-search > input:-ms-input-placeholder, @@ -2894,7 +2894,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { fieldset[disabled] .textarea:-ms-input-placeholder, fieldset[disabled] .select select:-ms-input-placeholder, .select fieldset[disabled] select:-ms-input-placeholder { - color: rgba(122, 122, 122, 0.3); } + color: rgba(107, 107, 107, 0.3); } .input, #documenter .docs-sidebar form.docs-search > input, .textarea { box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1); @@ -2994,7 +2994,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { .checkbox[disabled], .radio[disabled], fieldset[disabled] .checkbox, fieldset[disabled] .radio { - color: #7a7a7a; + color: #6b6b6b; cursor: not-allowed; } .radio + .radio { @@ -3122,7 +3122,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { .select.is-large { font-size: 1.5rem; } .select.is-disabled::after { - border-color: #7a7a7a; } + border-color: #6b6b6b; } .select.is-fullwidth { width: 100%; } .select.is-fullwidth select { @@ -3630,7 +3630,7 @@ a.tag:hover, .docstring > section > a.docs-sourcelink:hover { .control.has-icons-left .input:focus ~ .icon, .control.has-icons-left #documenter .docs-sidebar form.docs-search > input:focus ~ .icon, #documenter .docs-sidebar .control.has-icons-left form.docs-search > input:focus ~ .icon, .control.has-icons-left .select:focus ~ .icon, .control.has-icons-right .input:focus ~ .icon, .control.has-icons-right #documenter .docs-sidebar form.docs-search > input:focus ~ .icon, #documenter .docs-sidebar .control.has-icons-right form.docs-search > input:focus ~ .icon, .control.has-icons-right .select:focus ~ .icon { - color: #7a7a7a; } + color: #6b6b6b; } .control.has-icons-left .input.is-small ~ .icon, .control.has-icons-left #documenter .docs-sidebar form.docs-search > input ~ .icon, #documenter .docs-sidebar .control.has-icons-left form.docs-search > input ~ .icon, .control.has-icons-left .select.is-small ~ .icon, .control.has-icons-left #documenter .docs-sidebar form.docs-search > input.select ~ .icon, @@ -4021,7 +4021,7 @@ a.list-item { padding-left: 0.75em; } .menu-label { - color: #7a7a7a; + color: #6b6b6b; font-size: 0.75em; letter-spacing: 0.1em; text-transform: uppercase; } @@ -5130,7 +5130,7 @@ a.navbar-item, background-color: #dbdbdb; border-color: #dbdbdb; box-shadow: none; - color: #7a7a7a; + color: #6b6b6b; opacity: 0.5; } .pagination-previous, @@ -5267,7 +5267,7 @@ label.panel-block { text-align: center; vertical-align: top; width: 1em; - color: #7a7a7a; + color: #6b6b6b; margin-right: 0.75em; } .panel-icon .fa { font-size: inherit; @@ -7234,8 +7234,12 @@ h1:hover .docs-heading-anchor-permalink, h2:hover .docs-heading-anchor-permalink position: absolute; right: 0.625rem; bottom: 0.5rem; } + .docstring > section > a.docs-sourcelink:focus { + opacity: 1 !important; } .docstring:hover > section > a.docs-sourcelink { opacity: 0.2; } + .docstring:focus-within > section > a.docs-sourcelink { + opacity: 0.2; } .docstring > section:hover a.docs-sourcelink { opacity: 1; } @@ -7311,6 +7315,9 @@ html { -moz-osx-font-smoothing: auto; -webkit-font-smoothing: auto; } +li.no-marker { + list-style: none; } + /* This file contain the overall layout. * * The main container is
that is identified by id #documenter. @@ -7629,7 +7636,7 @@ html { color: #007989; } .ansi span.sgr37 { - color: #8f8f8f; } + color: gray; } .ansi span.sgr40 { background-color: #242424; } @@ -7653,10 +7660,10 @@ html { background-color: #007989; } .ansi span.sgr47 { - background-color: #8f8f8f; } + background-color: gray; } .ansi span.sgr90 { - color: #707070; } + color: #616161; } .ansi span.sgr91 { color: #cb3c33; } @@ -7680,7 +7687,7 @@ html { color: whitesmoke; } .ansi span.sgr100 { - background-color: #707070; } + background-color: #616161; } .ansi span.sgr101 { background-color: #cb3c33; } diff --git a/stable/functions/index.html b/stable/functions/index.html index 8b6a142..2b73a8b 100644 --- a/stable/functions/index.html +++ b/stable/functions/index.html @@ -1,24 +1,24 @@ -Types and Functions · FlxQTL.jl

Functions and Types

Flexible Multivariate Linear Mixed Models (flxMLMM)

FlxQTL.FlxQTLModule
FlxQTL

flexible Multivariate Linear Mixed Model based QTL analysis tools for structured multiple traits.

source
FlxQTL.flxMLMMModule
flxMLMM

A module designed for fitting a Multivariate Linear Mixed Model run by Nesterov's Accelerated Gradient with restarting scheme incorporated with Expectation Conditional Maximization.

The model:

$Y=XBZ'+R+E$, where $E(vec(Y))= (Z \otimes X)vec(B)$, $var(vec(Y))= \tau^2 K_G \otimes K_C + I_n \otimes \Sigma$

source
FlxQTL.flxMLMM.K2EigFunction
  K2Eig(Kg,Kc::Array{Float64,2},LOCO::Bool=false)

Returns a two pairs of eigenvectors and eigenvalues for genetic and climatic relatedness matrices.

Arguments

  • Kg : A matrix of a genetic kinship, or 3-d array of that if LOCO sets to be true.
  • Kc : A matrix of a climatic relatedness.
  • LOCO : Boolean. Default is false (no LOCO). (Leave One Chromosome Out). LOCO is only connected to the genetic kinship (Kg).

Output

  • Tg : A matrix of eigenvectors for Kg, or 3-d array of eigenvectors if LOCO sets to be true.
  • λg : A vector of eigenvalues for Kg, or matrix of eigenvalues if LOCO sets to be true.
  • Tc : A matrix of eigenvectors for Kc.
  • λc : A vector of eigenvalues for Kc

See K2eig.

Examples

For a genetic kinship calculated under LOCO (3-d array of kinship),

 Tg,λg,Tc,λc = K2Eig(Kg,Kc,true)
-

produces a 3-d array of Tg, matrices of λg, Tc, and a vector of λc.

source
FlxQTL.flxMLMM.K2eigFunction
   K2eig(K,LOCO::Bool=false)

Returns eigenvectors and eigenvalues of a (genetic, climatic) relatedness, or 3-d array of these of a genetic relatedness if LOCO is true.

Arguments

  • K : A matrix of (genetic or climatic) relatedness (Default). 3-d array of genetic relatedness (LOCO sets to be true.)
  • LOCO : Boolean. Default is false (no LOCO). (Leave One Chromosome Out).

Output

  • T : A matrix of eigenvectors, or 3-d array of eigenvectors if LOCO sets to be true.
  • λ : A vector of eigenvalues, or matrix of eigenvalues if LOCO sets to be true.

See also K2Eig.

Examples

For a (climatic) relatedness, or genetic relatedness for LOCO =false,

 T, λ = K2eig(K)
+Types and Functions · FlxQTL.jl

Functions and Types

Flexible Multivariate Linear Mixed Models (flxMLMM)

FlxQTL.FlxQTLModule
FlxQTL

flexible Multivariate Linear Mixed Model based QTL analysis tools for structured multiple traits.

source
FlxQTL.flxMLMMModule
flxMLMM

A module designed for fitting a Multivariate Linear Mixed Model run by Nesterov's Accelerated Gradient with restarting scheme incorporated with Expectation Conditional Maximization.

The model:

$Y=XBZ'+R+E$, where $E(vec(Y))= (Z \otimes X)vec(B)$, $var(vec(Y))= \tau^2 K_G \otimes K_C + I_n \otimes \Sigma$

source
FlxQTL.flxMLMM.K2EigFunction
  K2Eig(Kg,Kc::Array{Float64,2},LOCO::Bool=false)

Returns a two pairs of eigenvectors and eigenvalues for genetic and climatic relatedness matrices.

Arguments

  • Kg : A matrix of a genetic kinship, or 3-d array of that if LOCO sets to be true.
  • Kc : A matrix of a climatic relatedness.
  • LOCO : Boolean. Default is false (no LOCO). (Leave One Chromosome Out). LOCO is only connected to the genetic kinship (Kg).

Output

  • Tg : A matrix of eigenvectors for Kg, or 3-d array of eigenvectors if LOCO sets to be true.
  • λg : A vector of eigenvalues for Kg, or matrix of eigenvalues if LOCO sets to be true.
  • Tc : A matrix of eigenvectors for Kc.
  • λc : A vector of eigenvalues for Kc

See K2eig.

Examples

For a genetic kinship calculated under LOCO (3-d array of kinship),

 Tg,λg,Tc,λc = K2Eig(Kg,Kc,true)
+

produces a 3-d array of Tg, matrices of λg, Tc, and a vector of λc.

source
FlxQTL.flxMLMM.K2eigFunction
   K2eig(K,LOCO::Bool=false)

Returns eigenvectors and eigenvalues of a (genetic, climatic) relatedness, or 3-d array of these of a genetic relatedness if LOCO is true.

Arguments

  • K : A matrix of (genetic or climatic) relatedness (Default). 3-d array of genetic relatedness (LOCO sets to be true.)
  • LOCO : Boolean. Default is false (no LOCO). (Leave One Chromosome Out).

Output

  • T : A matrix of eigenvectors, or 3-d array of eigenvectors if LOCO sets to be true.
  • λ : A vector of eigenvalues, or matrix of eigenvalues if LOCO sets to be true.

See also K2Eig.

Examples

For a (climatic) relatedness, or genetic relatedness for LOCO =false,

 T, λ = K2eig(K)
 

produces a matrix of T and a vector of λ.

For a genetic kinship calculated under LOCO (3-d array of kinship),

 T, λ = K2eig(K,true)
-

produces a 3-d array of T and a matrix of λ.

source
FlxQTL.flxMLMM.envScanFunction
  envScan(Midx::Array{Int64,1},cross::Int64,Tg,Tc::Array{Float64,2},Λg,λc::Array{Float64,1},
+

produces a 3-d array of T and a matrix of λ.

source
FlxQTL.flxMLMM.envScanFunction
  envScan(Midx::Array{Int64,1},cross::Int64,Tg,Tc::Array{Float64,2},Λg,λc::Array{Float64,1},
     Y0::Array{Float64,2},XX::Markers,Z0::Array{Float64,2},LOCO::Bool=false;
-            Xnul::Array{Float64,2}=ones(1,size(Y0,2)),itol=1e-4,tol0=1e-3,tol::Float64=1e-4,ρ=0.001)

Implement environment scan conditional on a genetic marker of interest (QTL). Each of q trait covariate data is scanned (regressed) given a major QTL selected from genome scan, geneScan to obtain LOD scores.

Arguments

  • Midx : A vector of genetic marker indices (major QTL) selected based on LOD scores from geneScan.

  • cross : An integer indicating the number of alleles or genotypes. Ex. 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc. This value is related to degree of freedom when doing genome scan.

  • Tg : A n x n matrix of eigenvectors from K2eig, or K2Eig. Returns 3d-array of eigenvectors as many as Chromosomes if LOCO is true.

  • Tc : A m x m matrix of eigenvectors from climatic relatedness matrix.

  • Λg : A n x 1 vector of eigenvalues from kinship. Returns a matrix of eigenvalues if LOCO is true.

  • λc : A m x 1 vector of eigenvalues from climatic relatedness matrix. Use ones(m) for no climatic information added.

  • Y0 : A m x n matrix of response variables, i.e. m traits (or environments) by n individuals (or lines). For univariate phenotypes, use square brackets in arguement. i.e. Y0[1,:] (a vector) ->Y[[1],:] (a matrix) .

  • XX : A type of Markers.

  • Z0 : A m x q matrix of low-dimensional trait covariate data for environment scan, i.e. minimum or maximum monthly temperature data, monthly photoperiod data, etc.

  • LOCO : Boolean. Default is false (no LOCO). Runs genome scan using LOCO (Leave One Chromosome Out).

Keyword Arguments

  • Xnul : A matrix of covariates. Default is intercepts (1's). Unless plugging in particular covariates, just leave as it is.
  • itol : A tolerance controlling ECM (Expectation Conditional Maximization) under H0: no QTL. Default is 1e-3.
  • tol0 : A tolerance controlling ECM under H1: existence of QTL. Default is 1e-3.
  • tol : A tolerance of controlling Nesterov Acceleration Gradient method under both H0 and H1. Default is 1e-4.
  • ρ : A tunning parameter controlling $\tau^2$. Default is 0.001.

!!! Note

  • When some LOD scores return negative values, reduce tolerences for ECM to tol0 = 1e-4. It works in most cases. If not, can reduce both tol0 and tol to 1e-4 or further.

Output

  • LODs : A vector of LOD scores by envrionment scan when including each major QTL.
  • B : A 3-d array of B (fixed effects) matrices under H1: existence of an environment factor (covariate) conditional on a major QTL.
  • est0 : A type of EcmNestrv.Approx including parameter estimates under H0: no environment factor conditional on a major QTL.
source
FlxQTL.flxMLMM.gene2ScanFunction
gene2Scan(cross::Int64,Tg,Tc::Array{Float64,2},Λg,λc::Array{Float64,1},
+            Xnul::Array{Float64,2}=ones(1,size(Y0,2)),itol=1e-4,tol0=1e-3,tol::Float64=1e-4,ρ=0.001)

Implement environment scan conditional on a genetic marker of interest (QTL). Each of q trait covariate data is scanned (regressed) given a major QTL selected from genome scan, geneScan to obtain LOD scores.

Arguments

  • Midx : A vector of genetic marker indices (major QTL) selected based on LOD scores from geneScan.

  • cross : An integer indicating the number of alleles or genotypes. Ex. 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc. This value is related to degree of freedom when doing genome scan.

  • Tg : A n x n matrix of eigenvectors from K2eig, or K2Eig. Returns 3d-array of eigenvectors as many as Chromosomes if LOCO is true.

  • Tc : A m x m matrix of eigenvectors from climatic relatedness matrix.

  • Λg : A n x 1 vector of eigenvalues from kinship. Returns a matrix of eigenvalues if LOCO is true.

  • λc : A m x 1 vector of eigenvalues from climatic relatedness matrix. Use ones(m) for no climatic information added.

  • Y0 : A m x n matrix of response variables, i.e. m traits (or environments) by n individuals (or lines). For univariate phenotypes, use square brackets in arguement. i.e. Y0[1,:] (a vector) ->Y[[1],:] (a matrix) .

  • XX : A type of Markers.

  • Z0 : A m x q matrix of low-dimensional trait covariate data for environment scan, i.e. minimum or maximum monthly temperature data, monthly photoperiod data, etc.

  • LOCO : Boolean. Default is false (no LOCO). Runs genome scan using LOCO (Leave One Chromosome Out).

Keyword Arguments

  • Xnul : A matrix of covariates. Default is intercepts (1's). Unless plugging in particular covariates, just leave as it is.
  • itol : A tolerance controlling ECM (Expectation Conditional Maximization) under H0: no QTL. Default is 1e-3.
  • tol0 : A tolerance controlling ECM under H1: existence of QTL. Default is 1e-3.
  • tol : A tolerance of controlling Nesterov Acceleration Gradient method under both H0 and H1. Default is 1e-4.
  • ρ : A tunning parameter controlling $\tau^2$. Default is 0.001.

!!! Note

  • When some LOD scores return negative values, reduce tolerences for ECM to tol0 = 1e-4. It works in most cases. If not, can reduce both tol0 and tol to 1e-4 or further.

Output

  • LODs : A vector of LOD scores by envrionment scan when including each major QTL.
  • B : A 3-d array of B (fixed effects) matrices under H1: existence of an environment factor (covariate) conditional on a major QTL.
  • est0 : A type of EcmNestrv.Approx including parameter estimates under H0: no environment factor conditional on a major QTL.
source
FlxQTL.flxMLMM.gene2ScanFunction
gene2Scan(cross::Int64,Tg,Tc::Array{Float64,2},Λg,λc::Array{Float64,1},
     Y0::Array{Float64,2},XX::Markers,Z0::Array{Float64,2},LOCO::Bool=false;ρ=0.001,Xnul::Array{Float64,2}=ones(1,size(Y0,2))
     ,itol=1e-4,tol0=1e-3,tol::Float64=1e-4)
 gene2Scan(cross::Int64,Tg,Λg,Y0::Array{Float64,2},XX::Markers,LOCO::Bool=false;
-                  Xnul::Array{Float64,2}=ones(1,size(Y0,2)),itol=1e-4,tol0=1e-3,tol::Float64=1e-4,ρ=0.001)

Implement 2d-genome scan with/without LOCO (Leave One Chromosome Out). Note that the second gene2Scan() is based on a conventional MLMM:

\[vec(Y) \sim MVN((Z \otimes X)vec(B) (or XBZ') , K \otimes \Sigma_1 +I \otimes \Sigma_2),\]

where K is a genetic kinship, $\Sigma_1, \Sigma_2$ are covariance matrices for random and error terms, respectively. Z can be replaced with an identity matrix.

Arguments

  • cross : An integer indicating the number of alleles or genotypes. Ex. 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc. This value is related to degree of freedom when doing genome scan.
  • Tg : A n x n matrix of eigenvectors from K2eig, or K2Eig. Returns 3d-array of eigenvectors as many as Chromosomes if LOCO is true.
  • Tc : A m x m matrix of eigenvectors from climatic relatedness matrix.
  • Λg : A n x 1 vector of eigenvalues from kinship. Returns a matrix of eigenvalues if LOCO is true.
  • λc : A m x 1 vector of eigenvalues from climatic relatedness matrix. Use ones(m) for no climatic information added.
  • Y0 : A m x n matrix of response variables, i.e. m traits (or environments) by n individuals (or lines). For univariate phenotypes, use square brackets in arguement. i.e. Y0[1,:] (a vector) -> Y[[1],:] (a matrix) .
  • XX : A type of Markers.
  • Z0 : An optional m x q matrix of low-dimensional phenotypic covariates, i.e. contrasts, basis functions (fourier, wavelet, polynomials, B-splines, etc.). If nothing to insert in Z0, just insert an identity matrix, Matrix(1.0I,m,m). m traits x q phenotypic covariates.
  • LOCO : Boolean. Default is false (no LOCO). Runs genome scan using LOCO (Leave One Chromosome Out).

Keyword Arguments

  • Xnul : A matrix of covariates. Default is intercepts (1's). Unless adding covariates, just leave as it is. See geneScan.
  • itol : A tolerance controlling ECM (Expectation Conditional Maximization) under H0: no QTL. Default is 1e-3.
  • tol0 : A tolerance controlling ECM under H1: existence of QTL. Default is 1e-3.
  • tol : A tolerance of controlling Nesterov Acceleration Gradient method under both H0 and H1. Default is 1e-4.
  • ρ : A tunning parameter controlling $\tau^2$. Default is 0.001.

!!! Note

  • When some LOD scores return negative values, reduce tolerences for ECM to tol0 = 1e-4. It works in most cases. If not, can reduce both tol0 and tol to 1e-4 or further.

Output

  • LODs : LOD scores. Can change to $- \log_{10}{P}$ using lod2logP.
  • est0 : A type of EcmNestrv.Approx including parameter estimates under H0: no QTL.
source
FlxQTL.flxMLMM.geneScanFunction
geneScan(cross::Int64,Tg,Tc::Array{Float64,2},Λg,λc::Array{Float64,1},Y0::Array{Float64,2},XX::Markers,Z0::Array{Float64,2},LOCO::Bool=false;
+                  Xnul::Array{Float64,2}=ones(1,size(Y0,2)),itol=1e-4,tol0=1e-3,tol::Float64=1e-4,ρ=0.001)

Implement 2d-genome scan with/without LOCO (Leave One Chromosome Out). Note that the second gene2Scan() is based on a conventional MLMM:

\[vec(Y) \sim MVN((Z \otimes X)vec(B) (or XBZ') , K \otimes \Sigma_1 +I \otimes \Sigma_2),\]

where K is a genetic kinship, $\Sigma_1, \Sigma_2$ are covariance matrices for random and error terms, respectively. Z can be replaced with an identity matrix.

Arguments

  • cross : An integer indicating the number of alleles or genotypes. Ex. 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc. This value is related to degree of freedom when doing genome scan.
  • Tg : A n x n matrix of eigenvectors from K2eig, or K2Eig. Returns 3d-array of eigenvectors as many as Chromosomes if LOCO is true.
  • Tc : A m x m matrix of eigenvectors from climatic relatedness matrix.
  • Λg : A n x 1 vector of eigenvalues from kinship. Returns a matrix of eigenvalues if LOCO is true.
  • λc : A m x 1 vector of eigenvalues from climatic relatedness matrix. Use ones(m) for no climatic information added.
  • Y0 : A m x n matrix of response variables, i.e. m traits (or environments) by n individuals (or lines). For univariate phenotypes, use square brackets in arguement. i.e. Y0[1,:] (a vector) -> Y[[1],:] (a matrix) .
  • XX : A type of Markers.
  • Z0 : An optional m x q matrix of low-dimensional phenotypic covariates, i.e. contrasts, basis functions (fourier, wavelet, polynomials, B-splines, etc.). If nothing to insert in Z0, just insert an identity matrix, Matrix(1.0I,m,m). m traits x q phenotypic covariates.
  • LOCO : Boolean. Default is false (no LOCO). Runs genome scan using LOCO (Leave One Chromosome Out).

Keyword Arguments

  • Xnul : A matrix of covariates. Default is intercepts (1's). Unless adding covariates, just leave as it is. See geneScan.
  • itol : A tolerance controlling ECM (Expectation Conditional Maximization) under H0: no QTL. Default is 1e-3.
  • tol0 : A tolerance controlling ECM under H1: existence of QTL. Default is 1e-3.
  • tol : A tolerance of controlling Nesterov Acceleration Gradient method under both H0 and H1. Default is 1e-4.
  • ρ : A tunning parameter controlling $\tau^2$. Default is 0.001.

!!! Note

  • When some LOD scores return negative values, reduce tolerences for ECM to tol0 = 1e-4. It works in most cases. If not, can reduce both tol0 and tol to 1e-4 or further.

Output

  • LODs : LOD scores. Can change to $- \log_{10}{P}$ using lod2logP.
  • est0 : A type of EcmNestrv.Approx including parameter estimates under H0: no QTL.
source
FlxQTL.flxMLMM.geneScanFunction
geneScan(cross::Int64,Tg,Tc::Array{Float64,2},Λg,λc::Array{Float64,1},Y0::Array{Float64,2},XX::Markers,Z0::Array{Float64,2},LOCO::Bool=false;
             Xnul::Array{Float64,2}=ones(1,size(Y0,2)),itol=1e-3,tol0=1e-3,tol::Float64=1e-4,ρ=0.001,LogP::Bool=false)
 geneScan(cross::Int64,Tg,Tc::Array{Float64,2},Λg,λc::Array{Float64,1},Y0::Array{Float64,2},XX::Markers,LOCO::Bool=false;
             Xnul::Array{Float64,2}=ones(1,size(Y0,2)),itol=1e-3,tol0=1e-3,tol::Float64=1e-4,ρ=0.001,LogP::Bool=false)
 geneScan(cross::Int64,Tg,Λg,Y0::Array{Float64,2},XX::Markers,LOCO::Bool=false;
-    Xnul::Array{Float64,2}=ones(1,size(Y0,2)),itol=1e-3,tol0=1e-3,tol::Float64=1e-4,ρ=0.001,LogP::Bool=false)

Implement 1d-genome scan with/without LOCO (Leave One Chromosome Out). Note that the third geneScan() is based on a conventional MLMM:

\[vec(Y) \sim MVN((Z \otimes X)vec(B) (or XBZ'), K \otimes \Sigma_1 +I \otimes \Sigma_2),\]

where K is a genetic kinship, $\Sigma_1, \Sigma_2$ are covariance matrices for random and error terms, respectively. Z can be replaced with an identity matrix.

Arguments

  • cross : An integer indicating the number of alleles or genotypes. Ex. 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc. This value is related to degree of freedom when doing genome scan.
  • Tg : A n x n matrix of eigenvectors from K2eig, or K2Eig. Returns 3d-array of eigenvectors as many as Chromosomes if LOCO is true.
  • Tc : A m x m matrix of eigenvectors from climatic relatedness matrix.
  • Λg : A n x 1 vector of eigenvalues from kinship. Returns a matrix of eigenvalues if LOCO is true.
  • λc : A m x 1 vector of eigenvalues from climatic relatedness matrix. Use ones(m) for no climatic information added.
  • Y0 : A m x n matrix of response variables, i.e. m traits (or environments) by n individuals (or lines). For univariate phenotypes, use square brackets in arguement. i.e. Y0[1,:] (a vector) ->Y[[1],:] (a matrix) .
  • XX : A type of Markers.
  • Z0 : An optional m x q matrix of low-dimensional phenotypic covariates, i.e. contrasts, basis functions (fourier, wavelet, polynomials, B-splines, etc.). If nothing to insert in Z0, just exclude it or insert an identity matrix, Matrix(1.0I,m,m). m traits x q phenotypic covariates.
  • LOCO : Boolean. Default is false (no LOCO). Runs genome scan using LOCO (Leave One Chromosome Out).

Keyword Arguments

  • Xnul : A matrix of covariates. Default is intercepts (1's): 'Xnul= ones(1,size(Y0)). Adding covariates (C) isXnul= vcat(ones(1,m),C)' where size(C)=(c,m) for m = size(Y0,1).
  • itol : A tolerance controlling ECM (Expectation Conditional Maximization) under H0: no QTL. Default is 1e-3.
  • tol0 : A tolerance controlling ECM under H1: existence of QTL. Default is 1e-3.
  • tol : A tolerance of controlling Nesterov Acceleration Gradient method under both H0 and H1. Default is 1e-4.
  • ρ : A tunning parameter controlling $\tau^2$. Default is 0.001.
  • LogP : Boolean. Default is false. Returns $-\log_{10}{P}$ instead of LOD scores if true.

!!! Note

  • When some LOD scores return negative values, reduce tolerences for ECM to tol0 = 1e-4. It works in most cases. If not, can reduce both tol0 and tol to 1e-4 or further.

Output

  • LODs (or logP) : LOD scores. Can change to $- \log_{10}{P}$ in lod2logP if LogP = true.
  • B : A 3-d array of B (fixed effects) matrices under H1: existence of QTL. If covariates are added to Xnul : Xnul= [ones(1,size(Y0)); Covariates], ex. For sex covariates in 4-way cross analysis, B[:,2,100], B[:,3:5,100] are effects for sex, the rest genotypes of the 100th QTL, respectively.
  • est0 : A type of EcmNestrv.Approx including parameter estimates under H0: no QTL.
source
FlxQTL.flxMLMM.permTestMethod
  permTest(nperm,cross,Kg,Kc,Y0,XX::Markers,Z0;pval=[0.05 0.01],Xnul=ones(1,size(Y0,2)),itol=1e-4,tol0=1e-3,tol=1e-4,ρ=0.001)
-  permTest(nperm,cross,Kg,Y0,XX::Markers;pval=[0.05 0.01],Xnul=ones(1,size(Y0,2)),itol=1e-4,tol0=1e-3,tol=1e-4,ρ=0.001)

Implement permutation test to get thresholds at the levels of type 1 error, α. Note that the second permTest() is for the conventional MLMM:

\[vec(Y)\sim MVN((I \otimes X)vec(B) (or BX), K \otimes \Sigma_1 +I \otimes \Sigma_2),\]

where K is a genetic kinship, $\Sigma_1, \Sigma_2$ are covariance matrices for random and error terms, respectively.

Arguments

  • nperm : An integer indicating the number of permutation to be implemented.
  • cross : An integer indicating the number of alleles or genotypes. Ex. 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc. This value is related to degree of freedom when doing genome scan.
  • Kg : A n x n genetic kinship matrix. Should be symmetric positive definite.
  • Kc : A m x m climatic relatedness matrix. Should be symmetric positive definite.
  • Y0 : A m x n matrix of response variables, i.e. m traits (or environments) by n individuals (or lines). For univariate phenotypes, use square brackets in arguement. i.e. Y0[1,:] (a vector) -> Y[[1],:] (a matrix) .
  • XX : A type of Markers.
  • Z0 : An optional m x q matrix of low-dimensional phenotypic covariates, i.e. contrasts, basis functions (fourier, wavelet, polynomials, B-splines, etc.). If nothing to insert in Z0, just insert an identity matrix, Matrix(1.0I,m,m). m traits x q phenotypic covariates.

Keyword Arguments

  • pval : A vector of p-values to get their quantiles. Default is [0.05 0.01] (without comma).
  • Xnul : A matrix of covariates. Default is intercepts (1's). Unless plugging in particular covariates, just leave as it is.
  • itol : A tolerance controlling ECM (Expectation Conditional Maximization) under H0: no QTL. Default is 1e-3.
  • tol0 : A tolerance controlling ECM under H1: existence of QTL. Default is 1e-3.
  • tol : A tolerance of controlling Nesterov Acceleration Gradient method under both H0 and H1. Default is 1e-4.
  • ρ : A tunning parameter controlling $\tau^2$. Default is 0.001.

Output

  • maxLODs : A nperm x 1 vector of maximal LOD scores by permutation.
  • H1par_perm : A type of struct, EcmNestrv.Approx(B,τ2,Σ,loglik) including parameter estimates or EcmNestrv.Result(B,Vc,Σ,loglik) for a conventional MLMM under H0: no QTL by permutation.
  • cutoff : A vector of thresholds corresponding to pval.
source
FlxQTL.EcmNestrvModule
EcmNestrv

A module for base algorithms using ECM (Expectation-Conditional Maxization) with Speed restarting Nesterov's accelerated gradient method to fit a flexible multivariate linear mixed model (flxMLMM).

source

Genetic Relatedness Matrices (GRM)

FlxQTL.GRMModule
 GRM

A module for computing Genetic Relatedness Matrix (or kinship).

source
FlxQTL.GRM.kinship4wayMethod
 kinship4way(genmat::Array{Float64,2})

Computes a kinship for four-way cross data counting different alleles between two markers: ex. AB-AB=0; AB-AC=1; AB-CD=2,$\dots$ Note: In R/qtl, genotypes are labeled as 1=AC; 2=BC; 3=AD; 4=BD by the function, read.cross.

Argument

  • genmat : A matrix of genotypes for four-way cross $(1,2, \dots)$. size(genematrix)= (p,n), for p genetic markers x n individuals(or lines).

Output

Returns a n x n symmetric matrix containing 1's on the diagonal.

source
FlxQTL.GRM.kinshipCtrMethod
 kinshipCtr(genmat::Array{Float64,2})

Calculates a kinship by a centered genotype matrix (linear kernel), i.e. genotypes subtracted by marker mean.

Argument

  • genmat : A matrix of genotype data (0,1,2). size(genmat)=(p,n) for p markers x n individuals

Output

Returns a n x n symmetric matrix. See also kinshipStd.

source
FlxQTL.GRM.kinshipGsMethod
 kinshipGs(climate::Array{Float64,2},ρ::Float64)

Computes a kinship matrix using the Gaussian Kernel.

Arguments

  • climate : A matrix of genotype, or climate information data. size(climate)=(r,m), such that r genotype markers (or days/years of climate factors, i.e. precipitations, temperatures, etc.), and m individuals (or environments/sites)
  • ρ : A free parameter determining the width of the kernel. Could be attained empirically.

Output

Returns a m x m symmetric (positive definite) matrix containing 1's on the diagonal.

source
FlxQTL.GRM.kinshipLinMethod
kinshipLin(mat,cross)

Calculates a kinship (or climatic relatedness, kinshipGs) matrix by linear kernel.

Arguments

  • mat : A matrix of genotype (or allele) probabilities usually extracted from R/qtl, R/qtl2, or the counterpart packages. size(mat)= (p,n) for p genetic markers x n individuals.
  • cross : A scalar indicating instances of alleles or genotypes in a genetic marker. ex. 1 for genotypes (labeled as 0,1,2), 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc.

Output

Returns a n x n symmetric (positive definite) matrix containing 1's on the diagonal.

See also kinshipCtr, kinshipStd for genetype data.

source
FlxQTL.GRM.kinshipLocoFunction
 kinshipLoco(kin,g::Markers,cross::Int64=1)

Generates a 3-d array of symmetric positive definite kinship matrices using LOCO (Leave One Chromosome Out) witout shrinkage intensity estimation. When a kinship is not positive definite, a tweak like a weighted average of kinship and Identity is used to correct minuscule negative eigenvalues.

Arguments

  • kin : A function of computing a kinship. Can only use with kinshipCtr, kinshipStd for genotypes, and with kinshipLin for genotype (or allele) probabilities.
  • g : A struct of arrays, type Markers.
  • cross : A scalar indicating instances of alleles or genotypes in a genetic marker. ex. 1 for genotypes (0,1,2) as default, 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc.

Output

Returns 3-d array of n x n symmetric positive definite matrices as many as Chromosomes. Refer to shrinkgLoco.

source
FlxQTL.GRM.kinshipManMethod
  kinshipMan(genematrix::Array{Float64,2})

Calculates a kinship matrix using a manhattan distance. Missing values need to be either omitted or imputed. This function is for recombinant inbred line (RIL) (AA/BB), not for 4-way cross genotype data. See kinship4way.

Argument

  • genematrix : A matrix of genotypes, i.e. 0,1 (or 1,2). size(genematrix)= (p,n) for p genetic markers x n individuals(or lines).

Output

Returns a n x n symmetric matrix containing 1's on the diagonal.

source
FlxQTL.GRM.kinshipStdMethod
 kinshipStd(genmat::Array{Float64,2})

Calculates a kinship by a standardized (or normalized) genotype matrix (linear kernel), i.e. genotypes subtracted by marker mean and divided by marker standard deviation. Can also do with climatic information data. See kinshipGs.

Argument

  • genmat : A matrix of genotype data (0,1,2). size(genmat)=(p,n) for p markers x n individuals

Output

Returns a n x n symmetric matrix. See also kinshipCtr.

source
FlxQTL.GRM.shrinkgMethod
 shrinkg(f,nb::Int64,geno)

Estimates a full-rank positive definite kinship matrix by shrinkage intensity estimation (bootstrap). Can only use with kinshipMan, kinship4way. This function runs faster by CPU parallelization. Add workers/processes using addprocs() function before running for speedup.

Arguments

  • f: A function of computing a kinship. Can only use with kinshipMan, kinship4way.
  • nb : An integer indicating the number of bootstrap. It does not have to be a large number.
  • geno : A matrix of genotypes. See kinshipMan, kinship4way for dimension.

Example

julia> using flxQTL
+    Xnul::Array{Float64,2}=ones(1,size(Y0,2)),itol=1e-3,tol0=1e-3,tol::Float64=1e-4,ρ=0.001,LogP::Bool=false)

Implement 1d-genome scan with/without LOCO (Leave One Chromosome Out). Note that the third geneScan() is based on a conventional MLMM:

\[vec(Y) \sim MVN((Z \otimes X)vec(B) (or XBZ'), K \otimes \Sigma_1 +I \otimes \Sigma_2),\]

where K is a genetic kinship, $\Sigma_1, \Sigma_2$ are covariance matrices for random and error terms, respectively. Z can be replaced with an identity matrix.

Arguments

  • cross : An integer indicating the number of alleles or genotypes. Ex. 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc. This value is related to degree of freedom when doing genome scan.
  • Tg : A n x n matrix of eigenvectors from K2eig, or K2Eig. Returns 3d-array of eigenvectors as many as Chromosomes if LOCO is true.
  • Tc : A m x m matrix of eigenvectors from climatic relatedness matrix.
  • Λg : A n x 1 vector of eigenvalues from kinship. Returns a matrix of eigenvalues if LOCO is true.
  • λc : A m x 1 vector of eigenvalues from climatic relatedness matrix. Use ones(m) for no climatic information added.
  • Y0 : A m x n matrix of response variables, i.e. m traits (or environments) by n individuals (or lines). For univariate phenotypes, use square brackets in arguement. i.e. Y0[1,:] (a vector) ->Y[[1],:] (a matrix) .
  • XX : A type of Markers.
  • Z0 : An optional m x q matrix of low-dimensional phenotypic covariates, i.e. contrasts, basis functions (fourier, wavelet, polynomials, B-splines, etc.). If nothing to insert in Z0, just exclude it or insert an identity matrix, Matrix(1.0I,m,m). m traits x q phenotypic covariates.
  • LOCO : Boolean. Default is false (no LOCO). Runs genome scan using LOCO (Leave One Chromosome Out).

Keyword Arguments

  • Xnul : A matrix of covariates. Default is intercepts (1's): 'Xnul= ones(1,size(Y0)). Adding covariates (C) isXnul= vcat(ones(1,m),C)' where size(C)=(c,m) for m = size(Y0,1).
  • itol : A tolerance controlling ECM (Expectation Conditional Maximization) under H0: no QTL. Default is 1e-3.
  • tol0 : A tolerance controlling ECM under H1: existence of QTL. Default is 1e-3.
  • tol : A tolerance of controlling Nesterov Acceleration Gradient method under both H0 and H1. Default is 1e-4.
  • ρ : A tunning parameter controlling $\tau^2$. Default is 0.001.
  • LogP : Boolean. Default is false. Returns $-\log_{10}{P}$ instead of LOD scores if true.

!!! Note

  • When some LOD scores return negative values, reduce tolerences for ECM to tol0 = 1e-4. It works in most cases. If not, can reduce both tol0 and tol to 1e-4 or further.

Output

  • LODs (or logP) : LOD scores. Can change to $- \log_{10}{P}$ in lod2logP if LogP = true.
  • B : A 3-d array of B (fixed effects) matrices under H1: existence of QTL. If covariates are added to Xnul : Xnul= [ones(1,size(Y0)); Covariates], ex. For sex covariates in 4-way cross analysis, B[:,2,100], B[:,3:5,100] are effects for sex, the rest genotypes of the 100th QTL, respectively.
  • est0 : A type of EcmNestrv.Approx including parameter estimates under H0: no QTL.
source
FlxQTL.flxMLMM.permTestMethod
  permTest(nperm,cross,Kg,Kc,Y0,XX::Markers,Z0;pval=[0.05 0.01],Xnul=ones(1,size(Y0,2)),itol=1e-4,tol0=1e-3,tol=1e-4,ρ=0.001)
+  permTest(nperm,cross,Kg,Y0,XX::Markers;pval=[0.05 0.01],Xnul=ones(1,size(Y0,2)),itol=1e-4,tol0=1e-3,tol=1e-4,ρ=0.001)

Implement permutation test to get thresholds at the levels of type 1 error, α. Note that the second permTest() is for the conventional MLMM:

\[vec(Y)\sim MVN((I \otimes X)vec(B) (or BX), K \otimes \Sigma_1 +I \otimes \Sigma_2),\]

where K is a genetic kinship, $\Sigma_1, \Sigma_2$ are covariance matrices for random and error terms, respectively.

Arguments

  • nperm : An integer indicating the number of permutation to be implemented.
  • cross : An integer indicating the number of alleles or genotypes. Ex. 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc. This value is related to degree of freedom when doing genome scan.
  • Kg : A n x n genetic kinship matrix. Should be symmetric positive definite.
  • Kc : A m x m climatic relatedness matrix. Should be symmetric positive definite.
  • Y0 : A m x n matrix of response variables, i.e. m traits (or environments) by n individuals (or lines). For univariate phenotypes, use square brackets in arguement. i.e. Y0[1,:] (a vector) -> Y[[1],:] (a matrix) .
  • XX : A type of Markers.
  • Z0 : An optional m x q matrix of low-dimensional phenotypic covariates, i.e. contrasts, basis functions (fourier, wavelet, polynomials, B-splines, etc.). If nothing to insert in Z0, just insert an identity matrix, Matrix(1.0I,m,m). m traits x q phenotypic covariates.

Keyword Arguments

  • pval : A vector of p-values to get their quantiles. Default is [0.05 0.01] (without comma).
  • Xnul : A matrix of covariates. Default is intercepts (1's). Unless plugging in particular covariates, just leave as it is.
  • itol : A tolerance controlling ECM (Expectation Conditional Maximization) under H0: no QTL. Default is 1e-3.
  • tol0 : A tolerance controlling ECM under H1: existence of QTL. Default is 1e-3.
  • tol : A tolerance of controlling Nesterov Acceleration Gradient method under both H0 and H1. Default is 1e-4.
  • ρ : A tunning parameter controlling $\tau^2$. Default is 0.001.

Output

  • maxLODs : A nperm x 1 vector of maximal LOD scores by permutation.
  • H1par_perm : A type of struct, EcmNestrv.Approx(B,τ2,Σ,loglik) including parameter estimates or EcmNestrv.Result(B,Vc,Σ,loglik) for a conventional MLMM under H0: no QTL by permutation.
  • cutoff : A vector of thresholds corresponding to pval.
source
FlxQTL.EcmNestrvModule
EcmNestrv

A module for base algorithms using ECM (Expectation-Conditional Maxization) with Speed restarting Nesterov's accelerated gradient method to fit a flexible multivariate linear mixed model (flxMLMM).

source

Genetic Relatedness Matrices (GRM)

FlxQTL.GRMModule
 GRM

A module for computing Genetic Relatedness Matrix (or kinship).

source
FlxQTL.GRM.kinship4wayMethod
 kinship4way(genmat::Array{Float64,2})

Computes a kinship for four-way cross data counting different alleles between two markers: ex. AB-AB=0; AB-AC=1; AB-CD=2,$\dots$ Note: In R/qtl, genotypes are labeled as 1=AC; 2=BC; 3=AD; 4=BD by the function, read.cross.

Argument

  • genmat : A matrix of genotypes for four-way cross $(1,2, \dots)$. size(genematrix)= (p,n), for p genetic markers x n individuals(or lines).

Output

Returns a n x n symmetric matrix containing 1's on the diagonal.

source
FlxQTL.GRM.kinshipCtrMethod
 kinshipCtr(genmat::Array{Float64,2})

Calculates a kinship by a centered genotype matrix (linear kernel), i.e. genotypes subtracted by marker mean.

Argument

  • genmat : A matrix of genotype data (0,1,2). size(genmat)=(p,n) for p markers x n individuals

Output

Returns a n x n symmetric matrix. See also kinshipStd.

source
FlxQTL.GRM.kinshipGsMethod
 kinshipGs(climate::Array{Float64,2},ρ::Float64)

Computes a kinship matrix using the Gaussian Kernel.

Arguments

  • climate : A matrix of genotype, or climate information data. size(climate)=(r,m), such that r genotype markers (or days/years of climate factors, i.e. precipitations, temperatures, etc.), and m individuals (or environments/sites)
  • ρ : A free parameter determining the width of the kernel. Could be attained empirically.

Output

Returns a m x m symmetric (positive definite) matrix containing 1's on the diagonal.

source
FlxQTL.GRM.kinshipLinMethod
kinshipLin(mat,cross)

Calculates a kinship (or climatic relatedness, kinshipGs) matrix by linear kernel.

Arguments

  • mat : A matrix of genotype (or allele) probabilities usually extracted from R/qtl, R/qtl2, or the counterpart packages. size(mat)= (p,n) for p genetic markers x n individuals.
  • cross : A scalar indicating instances of alleles or genotypes in a genetic marker. ex. 1 for genotypes (labeled as 0,1,2), 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc.

Output

Returns a n x n symmetric (positive definite) matrix containing 1's on the diagonal.

See also kinshipCtr, kinshipStd for genetype data.

source
FlxQTL.GRM.kinshipLocoFunction
 kinshipLoco(kin,g::Markers,cross::Int64=1)

Generates a 3-d array of symmetric positive definite kinship matrices using LOCO (Leave One Chromosome Out) witout shrinkage intensity estimation. When a kinship is not positive definite, a tweak like a weighted average of kinship and Identity is used to correct minuscule negative eigenvalues.

Arguments

  • kin : A function of computing a kinship. Can only use with kinshipCtr, kinshipStd for genotypes, and with kinshipLin for genotype (or allele) probabilities.
  • g : A struct of arrays, type Markers.
  • cross : A scalar indicating instances of alleles or genotypes in a genetic marker. ex. 1 for genotypes (0,1,2) as default, 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc.

Output

Returns 3-d array of n x n symmetric positive definite matrices as many as Chromosomes. Refer to shrinkgLoco.

source
FlxQTL.GRM.kinshipManMethod
  kinshipMan(genematrix::Array{Float64,2})

Calculates a kinship matrix using a manhattan distance. Missing values need to be either omitted or imputed. This function is for recombinant inbred line (RIL) (AA/BB), not for 4-way cross genotype data. See kinship4way.

Argument

  • genematrix : A matrix of genotypes, i.e. 0,1 (or 1,2). size(genematrix)= (p,n) for p genetic markers x n individuals(or lines).

Output

Returns a n x n symmetric matrix containing 1's on the diagonal.

source
FlxQTL.GRM.kinshipStdMethod
 kinshipStd(genmat::Array{Float64,2})

Calculates a kinship by a standardized (or normalized) genotype matrix (linear kernel), i.e. genotypes subtracted by marker mean and divided by marker standard deviation. Can also do with climatic information data. See kinshipGs.

Argument

  • genmat : A matrix of genotype data (0,1,2). size(genmat)=(p,n) for p markers x n individuals

Output

Returns a n x n symmetric matrix. See also kinshipCtr.

source
FlxQTL.GRM.shrinkgMethod
 shrinkg(f,nb::Int64,geno)

Estimates a full-rank positive definite kinship matrix by shrinkage intensity estimation (bootstrap). Can only use with kinshipMan, kinship4way. This function runs faster by CPU parallelization. Add workers/processes using addprocs() function before running for speedup.

Arguments

  • f: A function of computing a kinship. Can only use with kinshipMan, kinship4way.
  • nb : An integer indicating the number of bootstrap. It does not have to be a large number.
  • geno : A matrix of genotypes. See kinshipMan, kinship4way for dimension.

Example

julia> using flxQTL
 julia> addprocs(8)
-julia> K = shinkage(kinshipMan,20,myGeno)

Output

Returns a full-rank symmetric positive definite matrix.

source
FlxQTL.GRM.shrinkgLocoMethod
   shrinkgLoco(kin,nb,g::Markers)

Generates 3-d array of full-rank positive definite kinship matrices by shrinkage intensity estimation (bootstrap) using a LOCO (Leave One Chromosome Out) scheme.

Argument

  • kin : A function of computing a kinship. Can only use with kinshipMan, kinship4way
  • nb : An integer indicating the number of bootstrap.
  • g : A struct of arrays, type Markers.

Output

Returns 3-d array of n x n symmetric positive definite matrices as many as Chromosomes.

source

Visualization (QTLplot)

FlxQTL.QTLplotModule
 QTLplot

A module for generating PyPlot-based 1D-, 2D-plots for LOD scores (or effects).

source
FlxQTL.QTLplot.layersType
layers(chr::Array{Any,1},pos::Array{Float64,1},lod::Array{Float64,2})

Creates a struct of arrays for plotting LOD scores, (or main, interaction) effects

Argument

  • chr : A vector of strings or numbers indicating Chromosome names, ex. 1,2,3,... or 1K,1N,2K,2N,...
  • pos : A vector of marker positions.
  • lod : A matrix of LOD scores obtained from 1d- or 2d-genome scan. Can be a matrix of effects (main, or interaction).
source
FlxQTL.QTLplot.plot1dMethod
  function plot1d(xx::layers;title= " ",title_font=25,ylabel="LOD",yint=[],yint_color=["red"],Legend=[],fontsize=20,loc="upper right")

Generates one or more graphs of LOD scores (or effects) obtained from 1d-genome scan on a single plot.

Arguments

  • xx : A type of layers that consists of chromosome names, marker positions, and a matrix of LODs(or effects).

Keyword arguements

  • title : A string of title. Default is blank.
  • title_font : A string or number to set title fontsize (default= 25). i.e. "small", "medium", "large", or any integer.
  • ylabel : A string of a y-axis label (default = LOD)
  • yint : A vector of y-intercept(s).
  • yint_color : A vector of colors (strings) of y-intercepts in yint.
  • Legend : A vector of graph names in layers.
  • fontsize : A string or number to set fontsizes of Legend, xlabel and ylabel (default= 20). i.e. "small", "medium", "large", or any integer.
  • loc : A string of Legend's position. Default is "upper right".
source
FlxQTL.QTLplot.plot2dMethod
    plot2d(S::layers;title_font=20,fontsize=15)

Generates 2-d heatmap plots of LOD scores from 2d-genome scan

Argument

  • S: a type of 'layers' that consists of chromosome names, marker positions, and a matrix of LODs

Keyword arguements

  • title_font : A string or number to set title fontsize (default= 20). i.e. "small", "medium", "large", or any integer.
  • fontsize : A string or number to set fontsizes of x-, y-ticks, and colorbar (default= 15). i.e. "small", "medium", "large", or any integer.
source
FlxQTL.QTLplot.subplot2dMethod
 subplot2d(S::layers,sub_dim::Int64;title_font=20,fontsize=15)

Generates a matrix of 2-d heatmap subplots for LOD scores obtained from 2d-genome scan

Arguments

  • sub_dim: A two digit integer, where the first digit (m) is the number of rows, the second (n) the number of columns. It returns a m x n matrix of subplots.

Keyword Arguments

  • title_font : A string or number to set title fontsize (default= 20). i.e. "small", "medium", "large", or any integer.
  • fontsize : A string or number to set fontsizes of x-, y-ticks, and colorbar (default= 15). i.e. "small", "medium", "large", or any integer.
source

Multivariate Linear Models (MLM)

FlxQTL.MLMModule
  MLM

A module for fitting general Multivariate Linear Models motivated by functional data analysis via mle or reml. The default fitting method is mle. ( i.e. reml=false)

The model: $Y=XBZ'+E$, where $E(Y)=XBZ'$ (or $E(vec(Y))= (Z \otimes X)vec(B)$ ), $var(vec(E))=\Sigma \otimes I.$ size(Y)=(n,m), size(X)=(n,p), size(Z)=(m,q).

source
FlxQTL.MLM.EstimatType
 Estimat(B::Array{Float64,2},Σ::Array{Float64,2},loglik::Float64)

A struct of arrays for results by fitting a multivariate linear model, mGLM(). The results are B(fixed effects), Σ (m x m covariance matrix), loglik(a value of log-likelihood by mle or reml).

source
FlxQTL.MLM.mGLMFunction
  mGLM(Y::Array{Float64,2},X::Array{Float64,2},Z::Array{Float64,2},reml::Bool=false)
-  mGLM(Y::Array{Float64,2},X::Array{Float64,2},reml::Bool=false)

Fitting multivariate General Linear Models via MLE (or REML) and returns a type of a struct Estimat.

Arguments

  • Y : A matrix of response variables, i.e. traits. size(Y)=(n,m) for n individuals x m traits
  • X : A matrix of independent variables, i.e. genotypes or genotype probabilities including intercept or/and covariates. size(X)=(n,p) for n individuals x p markers including intercept or/and covariates
  • Z : An optional matrix of low-dimensional phenotypic covariates, i.e. contrasts, basis functions (fourier, wavelet, polynomials, B-splines, etc.). If nothing to insert in Z, just exclude it or insert Matrix(1.0I,m,m). size(Z)=(m,q) for m traits x q phenotypic covariates.
  • reml : Boolean. Default is fitting the model via mle. Resitricted MLE is implemented if true.

Output

Returns Estimat .

source

Utility Functions (Util)

FlxQTL.Util.MarkersType
Markers(name::Array{String,1},chr::Array{Any,1},pos::Array{Float64,1},X::Array{Float64,2})

A struct of arrays creating genotype or genotype probability data for genome scan.

Arguments

  • name : A vector of marker names
  • chr : A vector of Chromosomes
  • pos : A vector of marker positions (cM)
  • X : A matrix of genotypes or genotype probabilities
source
FlxQTL.Util.Y_huberMethod
Y_huber(Y::Array{Float64,2})

Rescale Y (phenotype or trait data) to be less sensitive to outliers using by Huber loss function and MAD (median absolute deviation). size(Y)=(m,n) for m trait and n individuals.

source
FlxQTL.Util.array2matMethod
 array2mat(cross::Int64,X0::Array{Float64,3})

Returns a 3-d array to a matrix of genotype probabilities. size(X0)=(p,cross,n) –> (p1,n), where p1 = cross*p for p markers, cross alleles or genotypes, and n individuals. See mat2array.

source
FlxQTL.Util.getFinoidxMethod
getFinoidx(phenoData::Array{Union{Missing,Float64},2})

Attains indices of phenotype data without missing values.

Argument

  • phenoData : A matrix of phenotype (or trait) data including missing values. size(phenoData) = (m,n) for m traits and n individuals.
source
FlxQTL.Util.getGenoidxFunction
getGenoidx(GenoData::Union{Array{Any,2},Array{Float64,2}},maf::Float64=0.025)

Attains genotype indices to drop correlated or bad markers.

Arguments

  • GenoData : A matrix of genotype data. size(GenoData)= (p,n) for p markers and n individuals.
  • maf : A scalar for dropping criterion of markers. Default is 0.025 i.e. markers of MAF < 0.025 are dropped.
source
FlxQTL.Util.lod2logPMethod
lod2logP(LODs::Union{Array{Float64,1},Array{Any,1}},v::Int64)

Caculates $-\log_{10}{P}$ from LOD scores.

Arguments

  • LODs : A vector of LOD scores computed from genome scan.
  • v : Degrees of freedom for Chi-squared distribution.

!!! NOTE

  • To compute degrees of freedom for 1D-genome scan (geneScan), v = prod(size(B1))-prod(size(B0), where B1 and B0 are effect size matrices under H1 of a full model (intercept + covariates + QTL) and H0 of no QTL (intercept + covariates), respectively.
source
FlxQTL.Util.mat2arrayMethod
 mat2array(cross::Int64,X0)

Returns a matrix of genotype probabilities to 3-d array. size(X0)=(p1,n) –> (p,cross,n), where p1 = cross*p for p markers, cross alleles or genotypes, and n individuals.

Argument

  • cross : An integer indicating the number of alleles or genotypes. Ex. 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc.
  • X0 : A matrix of genotype probability data computed from r/qtl or r/qtl2.

See array2mat.

source
FlxQTL.Util.newMarkersFunction
newMarkers(XX::Markers,cross::Int64,cM::Int64=2)

Returns a struct of Markers by keeping only markers positioned in every cM centimorgans for 2-d genome scan to avoid singularity.

Arguments

  • XX : A type of Markers. See Markers.
  • cross : An integer indicating the number of alleles or genotypes. Ex. 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc.
  • cM : An integer of dropping criterion of markers. Default is 2, i.e. keeping only markers in every 2 cM, or dropping markers within 2cM between 2 markers.
source
FlxQTL.Util.ordrMarkersMethod
ordrMarkers(markers::Array{Any,2})

Rearrange by CPU parallelization marker information composed of marker name, chr, position obtained from rqtl2, which is not listed in order (excluding X chromosome).

Argument

  • markers : An array of marker information.
source
FlxQTL.Util.setSeedFunction
setSeed(lw::Int64,up::Int64,replace::Bool=false)

Assigns different numbers of seeds to workers (or processes).

Arguments

  • lw : A lower bound to set seeds.
  • up : A upper bound to set seeds.
  • replace : Sampling seed numbers between lw and up with/without replacement. Default is false: without replacement. Since the function itself recognize the number of processes (or workers) and their id, a wider range of seed numbers needs to set for default.

Examples

julia> using Distributed
+julia> K = shinkage(kinshipMan,20,myGeno)

Output

Returns a full-rank symmetric positive definite matrix.

source
FlxQTL.GRM.shrinkgLocoMethod
   shrinkgLoco(kin,nb,g::Markers)

Generates 3-d array of full-rank positive definite kinship matrices by shrinkage intensity estimation (bootstrap) using a LOCO (Leave One Chromosome Out) scheme.

Argument

  • kin : A function of computing a kinship. Can only use with kinshipMan, kinship4way
  • nb : An integer indicating the number of bootstrap.
  • g : A struct of arrays, type Markers.

Output

Returns 3-d array of n x n symmetric positive definite matrices as many as Chromosomes.

source

Visualization (QTLplot)

FlxQTL.QTLplotModule
 QTLplot

A module for generating PyPlot-based 1D-, 2D-plots for LOD scores (or effects).

source
FlxQTL.QTLplot.layersType
layers(chr::Array{Any,1},pos::Array{Float64,1},lod::Array{Float64,2})

Creates a struct of arrays for plotting LOD scores, (or main, interaction) effects

Argument

  • chr : A vector of strings or numbers indicating Chromosome names, ex. 1,2,3,... or 1K,1N,2K,2N,...
  • pos : A vector of marker positions.
  • lod : A matrix of LOD scores obtained from 1d- or 2d-genome scan. Can be a matrix of effects (main, or interaction).
source
FlxQTL.QTLplot.plot1dMethod
  function plot1d(xx::layers;title= " ",title_font=25,ylabel="LOD",yint=[],yint_color=["red"],Legend=[],fontsize=20,loc="upper right")

Generates one or more graphs of LOD scores (or effects) obtained from 1d-genome scan on a single plot.

Arguments

  • xx : A type of layers that consists of chromosome names, marker positions, and a matrix of LODs(or effects).

Keyword arguements

  • title : A string of title. Default is blank.
  • title_font : A string or number to set title fontsize (default= 25). i.e. "small", "medium", "large", or any integer.
  • ylabel : A string of a y-axis label (default = LOD)
  • yint : A vector of y-intercept(s).
  • yint_color : A vector of colors (strings) of y-intercepts in yint.
  • Legend : A vector of graph names in layers.
  • fontsize : A string or number to set fontsizes of Legend, xlabel and ylabel (default= 20). i.e. "small", "medium", "large", or any integer.
  • loc : A string of Legend's position. Default is "upper right".
source
FlxQTL.QTLplot.plot2dMethod
    plot2d(S::layers;title_font=20,fontsize=15)

Generates 2-d heatmap plots of LOD scores from 2d-genome scan

Argument

  • S: a type of 'layers' that consists of chromosome names, marker positions, and a matrix of LODs

Keyword arguements

  • title_font : A string or number to set title fontsize (default= 20). i.e. "small", "medium", "large", or any integer.
  • fontsize : A string or number to set fontsizes of x-, y-ticks, and colorbar (default= 15). i.e. "small", "medium", "large", or any integer.
source
FlxQTL.QTLplot.subplot2dMethod
 subplot2d(S::layers,sub_dim::Int64;title_font=20,fontsize=15)

Generates a matrix of 2-d heatmap subplots for LOD scores obtained from 2d-genome scan

Arguments

  • sub_dim: A two digit integer, where the first digit (m) is the number of rows, the second (n) the number of columns. It returns a m x n matrix of subplots.

Keyword Arguments

  • title_font : A string or number to set title fontsize (default= 20). i.e. "small", "medium", "large", or any integer.
  • fontsize : A string or number to set fontsizes of x-, y-ticks, and colorbar (default= 15). i.e. "small", "medium", "large", or any integer.
source

Multivariate Linear Models (MLM)

FlxQTL.MLMModule
  MLM

A module for fitting general Multivariate Linear Models motivated by functional data analysis via mle or reml. The default fitting method is mle. ( i.e. reml=false)

The model: $Y=XBZ'+E$, where $E(Y)=XBZ'$ (or $E(vec(Y))= (Z \otimes X)vec(B)$ ), $var(vec(E))=\Sigma \otimes I.$ size(Y)=(n,m), size(X)=(n,p), size(Z)=(m,q).

source
FlxQTL.MLM.EstimatType
 Estimat(B::Array{Float64,2},Σ::Array{Float64,2},loglik::Float64)

A struct of arrays for results by fitting a multivariate linear model, mGLM(). The results are B(fixed effects), Σ (m x m covariance matrix), loglik(a value of log-likelihood by mle or reml).

source
FlxQTL.MLM.mGLMFunction
  mGLM(Y::Array{Float64,2},X::Array{Float64,2},Z::Array{Float64,2},reml::Bool=false)
+  mGLM(Y::Array{Float64,2},X::Array{Float64,2},reml::Bool=false)

Fitting multivariate General Linear Models via MLE (or REML) and returns a type of a struct Estimat.

Arguments

  • Y : A matrix of response variables, i.e. traits. size(Y)=(n,m) for n individuals x m traits
  • X : A matrix of independent variables, i.e. genotypes or genotype probabilities including intercept or/and covariates. size(X)=(n,p) for n individuals x p markers including intercept or/and covariates
  • Z : An optional matrix of low-dimensional phenotypic covariates, i.e. contrasts, basis functions (fourier, wavelet, polynomials, B-splines, etc.). If nothing to insert in Z, just exclude it or insert Matrix(1.0I,m,m). size(Z)=(m,q) for m traits x q phenotypic covariates.
  • reml : Boolean. Default is fitting the model via mle. Resitricted MLE is implemented if true.

Output

Returns Estimat .

source

Utility Functions (Util)

FlxQTL.Util.MarkersType
Markers(name::Array{String,1},chr::Array{Any,1},pos::Array{Float64,1},X::Array{Float64,2})

A struct of arrays creating genotype or genotype probability data for genome scan.

Arguments

  • name : A vector of marker names
  • chr : A vector of Chromosomes
  • pos : A vector of marker positions (cM)
  • X : A matrix of genotypes or genotype probabilities
source
FlxQTL.Util.Y_huberMethod
Y_huber(Y::Array{Float64,2})

Rescale Y (phenotype or trait data) to be less sensitive to outliers using by Huber loss function and MAD (median absolute deviation). size(Y)=(m,n) for m trait and n individuals.

source
FlxQTL.Util.array2matMethod
 array2mat(cross::Int64,X0::Array{Float64,3})

Returns a 3-d array to a matrix of genotype probabilities. size(X0)=(p,cross,n) –> (p1,n), where p1 = cross*p for p markers, cross alleles or genotypes, and n individuals. See mat2array.

source
FlxQTL.Util.getFinoidxMethod
getFinoidx(phenoData::Array{Union{Missing,Float64},2})

Attains indices of phenotype data without missing values.

Argument

  • phenoData : A matrix of phenotype (or trait) data including missing values. size(phenoData) = (m,n) for m traits and n individuals.
source
FlxQTL.Util.getGenoidxFunction
getGenoidx(GenoData::Union{Array{Any,2},Array{Float64,2}},maf::Float64=0.025)

Attains genotype indices to drop correlated or bad markers.

Arguments

  • GenoData : A matrix of genotype data. size(GenoData)= (p,n) for p markers and n individuals.
  • maf : A scalar for dropping criterion of markers. Default is 0.025 i.e. markers of MAF < 0.025 are dropped.
source
FlxQTL.Util.lod2logPMethod
lod2logP(LODs::Union{Array{Float64,1},Array{Any,1}},v::Int64)

Caculates $-\log_{10}{P}$ from LOD scores.

Arguments

  • LODs : A vector of LOD scores computed from genome scan.
  • v : Degrees of freedom for Chi-squared distribution.

!!! NOTE

  • To compute degrees of freedom for 1D-genome scan (geneScan), v = prod(size(B1))-prod(size(B0), where B1 and B0 are effect size matrices under H1 of a full model (intercept + covariates + QTL) and H0 of no QTL (intercept + covariates), respectively.
source
FlxQTL.Util.mat2arrayMethod
 mat2array(cross::Int64,X0)

Returns a matrix of genotype probabilities to 3-d array. size(X0)=(p1,n) –> (p,cross,n), where p1 = cross*p for p markers, cross alleles or genotypes, and n individuals.

Argument

  • cross : An integer indicating the number of alleles or genotypes. Ex. 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc.
  • X0 : A matrix of genotype probability data computed from r/qtl or r/qtl2.

See array2mat.

source
FlxQTL.Util.newMarkersFunction
newMarkers(XX::Markers,cross::Int64,cM::Int64=2)

Returns a struct of Markers by keeping only markers positioned in every cM centimorgans for 2-d genome scan to avoid singularity.

Arguments

  • XX : A type of Markers. See Markers.
  • cross : An integer indicating the number of alleles or genotypes. Ex. 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc.
  • cM : An integer of dropping criterion of markers. Default is 2, i.e. keeping only markers in every 2 cM, or dropping markers within 2cM between 2 markers.
source
FlxQTL.Util.ordrMarkersMethod
ordrMarkers(markers::Array{Any,2})

Rearrange by CPU parallelization marker information composed of marker name, chr, position obtained from rqtl2, which is not listed in order (excluding X chromosome).

Argument

  • markers : An array of marker information.
source
FlxQTL.Util.setSeedFunction
setSeed(lw::Int64,up::Int64,replace::Bool=false)

Assigns different numbers of seeds to workers (or processes).

Arguments

  • lw : A lower bound to set seeds.
  • up : A upper bound to set seeds.
  • replace : Sampling seed numbers between lw and up with/without replacement. Default is false: without replacement. Since the function itself recognize the number of processes (or workers) and their id, a wider range of seed numbers needs to set for default.

Examples

julia> using Distributed
 julia> addprocs(10)
 julia> @everywhere using flxQTL
 julia> setSeed(1,20)
-
source
FlxQTL.Util.sortBycMFunction
    sortBycM(Chr::Any,XX::Markers,cross::Int64,cM::Int64=2)

Returns marker indices in Chromosome Chr and the corresponding genotype probabilities keeping only markers positioned in every cM centimorgans for 2-d genome scan to avoid singularity.

Arguments

  • Chr : A type of Any indicating a particular chromosome to sort markers out.
  • XX : A type of Markers.
  • cross : An integer indicating the number of alleles or genotypes. Ex. 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc.
  • cM : An integer of dropping criterion of markers. Default is 2, i.e. keeping only markers in every 2 cM, or dropping markers within 2cM between 2 markers.

See also newMarkers

source
+
source
FlxQTL.Util.sortBycMFunction
    sortBycM(Chr::Any,XX::Markers,cross::Int64,cM::Int64=2)

Returns marker indices in Chromosome Chr and the corresponding genotype probabilities keeping only markers positioned in every cM centimorgans for 2-d genome scan to avoid singularity.

Arguments

  • Chr : A type of Any indicating a particular chromosome to sort markers out.
  • XX : A type of Markers.
  • cross : An integer indicating the number of alleles or genotypes. Ex. 2 for RIF, 4 for four-way cross, 8 for HS mouse (allele probabilities), etc.
  • cM : An integer of dropping criterion of markers. Default is 2, i.e. keeping only markers in every 2 cM, or dropping markers within 2cM between 2 markers.

See also newMarkers

source
diff --git a/stable/guide/analysis/index.html b/stable/guide/analysis/index.html index 9f64ff7..1aa9010 100644 --- a/stable/guide/analysis/index.html +++ b/stable/guide/analysis/index.html @@ -34,4 +34,4 @@ LODs,B,est0 = FlxQTL.geneScan(1,T,Tc,λ,λc,Ystd,XX); LODs,B,est0 =FlxQTL.geneScan(1,T,λ,Ystd,XX); # MLMM

The function geneScan has three arguments: LOD scores (LODs), effects matrix under H1 (B), and parameter estimates under H0 (est0), which is an Array{Any,1}. If you want to see null parameter esitmate in chromosome 1 for LOCO option, type est0[1].B, est0[1].loglik, est0[1].τ2, est0[1].Σ. In particular, you can extract values from each matrix in B (3D array of matrices) to generate an effects plot. To print an effect size matrix for the third marker, type B[:,:,3].

Generating plots

To produce a plot (or plots) for LOD scores or effects, you need first a struct of arrays, layers consisting of chromosomes, marker positions, LOD scores (or effects), which should be Array{Float64,2}. You can then generate one genome scan result or multiple genenome scan results on one plot. Note that the color is randomly selected to generate a plot. The function plot1d has more keyword argument options: yint=[] for a vector of y-intercept(s), yint_color=["red"] for a vector of y-intercept color(s), Legend=[] for multiple graphs, loc="upper right" for the location of Legend, etc.

Arab_lod = FlxQTL.layers(markerinfo[:,2],markerinfo[:,3],LODs[:,:]) # LODs is a vector here, so force it to be a matrix
-plot1d(Arab_lod;title= "LOD for Arabidopsis thaliana : Fitness (2 site by 3 year, 6 traits)",ylabel="LOD")

arabidopsis

Performing a permutation test

Since the statistical inference for FlxQTL relies on LOD scores and LOD scores, the function permTest finds thresholds for a type I error. The first argument is nperm::Int64 to set the number of permutations for the test. For Z = I, type Matrix(1.0I,6,6) for the Arabidopsis thaliana data. In the keyword argument, pval=[0.05 0.01] is default to get thresholds of type I error rates (α). Note that permutation test is implemented by no LOCO option.

julia> maxLODs, H1par_perm, cutoff = FlxQTL.permTest(1000,1,K,Kc,Ystd,XX,Z;pval=[0.05]) # cutoff at 5 %
+plot1d(Arab_lod;title= "LOD for Arabidopsis thaliana : Fitness (2 site by 3 year, 6 traits)",ylabel="LOD")

arabidopsis

Performing a permutation test

Since the statistical inference for FlxQTL relies on LOD scores and LOD scores, the function permTest finds thresholds for a type I error. The first argument is nperm::Int64 to set the number of permutations for the test. For Z = I, type Matrix(1.0I,6,6) for the Arabidopsis thaliana data. In the keyword argument, pval=[0.05 0.01] is default to get thresholds of type I error rates (α). Note that permutation test is implemented by no LOCO option.

julia> maxLODs, H1par_perm, cutoff = FlxQTL.permTest(1000,1,K,Kc,Ystd,XX,Z;pval=[0.05]) # cutoff at 5 %
diff --git a/stable/guide/tutorial/index.html b/stable/guide/tutorial/index.html index b942d37..f1012ac 100644 --- a/stable/guide/tutorial/index.html +++ b/stable/guide/tutorial/index.html @@ -1,2 +1,2 @@ -Package Guide · FlxQTL.jl

Package Guide

Installation

The package can installed in following ways. In a Julia REPL, press ] to enter a package mode,

pkg> add FlxQTL

Or, equivalently,

julia> using Pkg; Pkg.add("FlxQTL")

Currently Julia 1.5 supports for the package.

To remove the package from the Julia REPL,

pkg> rm FlxQTL

Equivalently,

julia> using Pkg; Pkg.rm("FlxQTL")

Choice of BLAS vendors

The package can be run in either openblas (built-in Julia dense linear algebra routines) or MKL (intel MKL linear algebra). Without the intel MKL hardware, the installation of MKL.jl in Julia can slightly improve the performance. For its installation, consult with MKL.jl.

+Package Guide · FlxQTL.jl

Package Guide

Installation

The package can installed in following ways. In a Julia REPL, press ] to enter a package mode,

pkg> add FlxQTL

Or, equivalently,

julia> using Pkg; Pkg.add("FlxQTL")

Currently Julia 1.5 supports for the package.

To remove the package from the Julia REPL,

pkg> rm FlxQTL

Equivalently,

julia> using Pkg; Pkg.rm("FlxQTL")

Choice of BLAS vendors

The package can be run in either openblas (built-in Julia dense linear algebra routines) or MKL (intel MKL linear algebra). Without the intel MKL hardware, the installation of MKL.jl in Julia can slightly improve the performance. For its installation, consult with MKL.jl.

diff --git a/stable/index.html b/stable/index.html index 5825e21..2ce2f84 100644 --- a/stable/index.html +++ b/stable/index.html @@ -1,2 +1,2 @@ -Home · FlxQTL.jl

FlxQTL.jl

A package for a Flexible multivariate linear mixed model (MLMM) suitable for QTL (Quantitative Trait Loci) analysis of structured multivariate traits.

Package Features

  • Genome scan (1D, 2D) for univariate, multivariate trait(s), and genotype (probability) data
  • LOCO (Leave One Chromosome Out) support for genome scan
  • Visualization (1D, 2D plots)
  • Computation for Genetic (or Climatic) Relatedness matrix (or kinship)
  • CPU parallelization

Guide

Manual

The descriptions of functions and types arranged by module.

Index

+Home · FlxQTL.jl

FlxQTL.jl

A package for a Flexible multivariate linear mixed model (MLMM) suitable for QTL (Quantitative Trait Loci) analysis of structured multivariate traits.

Package Features

  • Genome scan (1D, 2D) for univariate, multivariate trait(s), and genotype (probability) data
  • LOCO (Leave One Chromosome Out) support for genome scan
  • Visualization (1D, 2D plots)
  • Computation for Genetic (or Climatic) Relatedness matrix (or kinship)
  • CPU parallelization

Guide

Manual

The descriptions of functions and types arranged by module.

Index

diff --git a/stable/search/index.html b/stable/search/index.html index a914957..9befd02 100644 --- a/stable/search/index.html +++ b/stable/search/index.html @@ -1,2 +1,2 @@ -Search · FlxQTL.jl

Loading search...

    +Search · FlxQTL.jl

    Loading search...