S7 MagicScan

Alternative

MagicScan performs QTL mapping by a single-QTL linear model via genomic scan. There exist more sophisticated methods using linear mixed models and multi-QTL models. It is recommended to use the statgenMPP package. Here are two key references for statgenMPP: Li et al. 2021 and Li et al. 2022. For more questions, please contact: bart-jan.vanrossum@wur.nl.

MagicScan

input ancestryfile

The input ancestryfile can be obtained from magicreconstruct with hmmalg = "forwardbackward". However, the ancestryfile resulting from hmmalg = "viterbi" does not work for magicscan.

The magicscan performs QTL mapping by scanning each marker with the simple linear model that can be specified by keyarg equation. The keyarg equation is a formula expression resulting from @formula. See StatsModels.@formula for the syntax.

For the default equation = nothing, it means lastcolumn ~ 1 where lastcolumn denotes the name of last column in the phenofile. For the default threshold = nothing, the permutation method is used to calculate the threshold for QTL detection.

# code for Julia 
using StatsModels # required for @formula
using MagicScan
cd(@__DIR__)
ancestryfile = outstem*"_magicreconstruct_ancestry.csv.gz"
phenofile = outstem*"_magicsimulate_pheno.csv"
magicscan(ancestryfile,phenofile;
    equation = @formula(phenotype ~ 1 + population),
    outstem     
)
# code for Linux shell. 
# For Window CMD, replace multiline key \ by  ^, and replace comment-key # by ::
julia rabbit_magicscan.jl -g example_magicreconstruct_ancestry.csv.gz \
    -p example_magicsimulate_pheno.csv \
    -e "phenotype ~ 1 + population"  \
    -o example

Output files

outfileDescription
outstem*"_magicscan.log"log file
outstem*"_magicscan_perm.csvlogscore at siglevels for each permutation of offspring
outstem*"_magicscan_profile.csvlodscore and log10 pvalue for each marker
outstem*"_magicscan_manhattan_qq.pngManhattan and qq plots for the scanning profile
outstem*"_magicscan_peak.csvdetected QTL peaks

Output: peak

using CSV, DataFrames
CSV.read("example_magicscan_peak.csv",DataFrame;comment="##")
7×2 DataFrame
Rowidpeak
String15String15
1markersnp7
2linkagegroupLG2
3poscm19.9873
4physposbpmissing
5loglike-203.8487
6CI0.950.0 ~ 22.1971
7CI0.95_markersnp1 ~ snp9
using MagicBase
truepheno = MagicBase.readmultitable("example_magicsimulate_truepheno.csv")
truepheno["map_qtl"]
1×11 DataFrame
Rowmarkerlinkagegroupposcmleftsnprightsnpallele2_effectvar_qtlP1P2P3P4
String7Int64Float64String7String7Float64Float64Int64Int64Int64Int64
1qtl116.4801snp5snp61.04831.01212

Output: manhattan