This repository provides example workflows and documentation for genome-wide association studies (GWAS) and QTL mapping of non-normally distributed traits, with a particular emphasis on the Pseudo-Response (PSR) method.
The PSR-GLMM/R framework supports:
Supported trait types include:
For PSR, the framework supports both:
An optional switch is available to compute heritability (H²) and related genetic variance components.
gencsv)CSV format. The first column is sample ID and is not used in computation. Remaining columns are genotype values.
Example:
Bin,F001,F002,F003,…
Bin1,-1,1,1,…
Bin2,-1,1,1,…
Bin3,-1,1,1,…
phecsv)CSV format. Each row corresponds to one individual.
Typical columns may include:
Binary – binary trait (0/1)Poisson – count dataEvent – number of successes (binomial)Trial – number of trials (binomial)Ordinal – ordered categorical traitkkcsv)Required for GLMM / P3D / PSR (kinship mode).
Z.csv)Optional alternative to the kinship matrix for PSR.
ID column (ignored in computation)Z %*% t(Z)cov.csv)Optional fixed-effect covariates.
ID (ignored)model.matrix| Parameter | Description |
|---|---|
| gencsv | Genotype CSV file |
| phecsv | Phenotype CSV file |
| kkcsv | Kinship matrix CSV (kinship mode) |
| zcsv | Random design matrix CSV (Z mode) |
| covcsv | Covariate CSV file |
| phename | Trait column name |
| phetype | “binary”, “poisson”, or “binomial” |
| phenameother | Trial column (binomial only) |
| outpath | Output directory |
| h2 | Whether to compute heritability (H²) |
# ===== Mode A (Kinship K), no covariates =====PSR(gencsv = "data/IMF2-Genotypes-N.csv",phecsv = "data/IMF2-Phenotypes.csv",kkcsv = "data/kk.csv",zcsv = NULL,covcsv = NULL,phename = "Event",phetype = "binomial",phenameother = "Trial",outpath = "PSR_A1_K_noCov_Binomial",h2 = FALSE,use_fixed = FALSE,use_kinship = TRUE,use_randomZ = FALSE)
# ===== Mode A (Kinship K), with covariates =====PSR(gencsv = "data/IMF2-Genotypes-N.csv",phecsv = "data/IMF2-Phenotypes.csv",kkcsv = "data/kk.csv",zcsv = NULL,covcsv = "data/cov.csv",phename = "Event",phetype = "binomial",phenameother = "Trial",outpath = "PSR_A2_K_withCov_Binomial",h2 = FALSE,use_fixed = TRUE,use_kinship = TRUE,use_randomZ = FALSE)
# ===== Mode B (Random Z), no covariates =====PSR(gencsv = "data/IMF2-Genotypes-N.csv",phecsv = "data/IMF2-Phenotypes.csv",kkcsv = NULL,zcsv = "data/Z.csv",covcsv = NULL,phename = "Event",phetype = "binomial",phenameother = "Trial",outpath = "PSR_B1_Z_noCov_Binomial",h2 = FALSE,use_fixed = FALSE,use_kinship = FALSE,use_randomZ = TRUE)
# ===== Mode B (Random Z), with covariates =====PSR(gencsv = "data/IMF2-Genotypes-N.csv",phecsv = "data/IMF2-Phenotypes.csv",kkcsv = NULL,zcsv = "data/Z.csv",covcsv = "data/cov.csv",phename = "Event",phetype = "binomial",phenameother = "Trial",outpath = "PSR_B2_Z_withCov_Binomial",h2 = TRUE, # example: turn on locus-level H2use_fixed = TRUE,use_kinship = FALSE,use_randomZ = TRUE)
PSR(gencsv = "data/IMF2-Genotypes-N.csv",phecsv = "data/IMF2-Phenotypes.csv",kkcsv = "data/kk.csv",zcsv = NULL,covcsv = NULL,phename = "Binary",phetype = "binary",phenameother = NULL,outpath = "PSR_A1_K_noCov_Binary",h2 = FALSE,use_fixed = FALSE,use_kinship = TRUE,use_randomZ = FALSE)
PSR(gencsv = "data/IMF2-Genotypes-N.csv",phecsv = "data/IMF2-Phenotypes.csv",kkcsv = "data/kk.csv",zcsv = NULL,covcsv = NULL,phename = "Poisson",phetype = "poisson",phenameother = NULL,outpath = "PSR_A1_K_noCov_Poisson",h2 = FALSE,use_fixed = FALSE,use_kinship = TRUE,use_randomZ = FALSE)
# ===== Ordinal, Mode A1 (Kinship K), no covariates =====PSR_ORDINAL(gencsv = "data/IMF2-Genotypes-N.csv",phecsv = "data/IMF2-Phenotypes.csv",kkcsv = "data/kk.csv",zcsv = NULL,covcsv = NULL,phename = "Ordinal",outpath = "PSR_Ordinal_A1_K_noCov",h2 = FALSE,use_fixed = FALSE,use_kinship = TRUE,use_randomZ = FALSE)
# ===== Ordinal, Mode A2 (Kinship K), with covariates =====PSR_ORDINAL(gencsv = "data/IMF2-Genotypes-N.csv",phecsv = "data/IMF2-Phenotypes.csv",kkcsv = "data/kk.csv",zcsv = NULL,covcsv = "data/cov.csv",phename = "Ordinal",outpath = "PSR_Ordinal_A2_K_withCov",h2 = FALSE,use_fixed = TRUE,use_kinship = TRUE,use_randomZ = FALSE)
# ===== Ordinal, Mode B (Random Z), no covariates =====PSR_ORDINAL(gencsv = "data/IMF2-Genotypes-N.csv",phecsv = "data/IMF2-Phenotypes.csv",kkcsv = NULL,zcsv = "data/Z.csv",covcsv = NULL,phename = "Ordinal",outpath = "PSR_Ordinal_B1_Z_noCov",h2 = TRUE,use_fixed = FALSE,use_kinship = FALSE,use_randomZ = TRUE)
# ===== Ordinal, Mode B (Random Z), with covariates =====PSR_ORDINAL(gencsv = "data/IMF2-Genotypes-N.csv",phecsv = "data/IMF2-Phenotypes.csv",kkcsv = NULL,zcsv = "data/Z.csv",covcsv = "data/cov.csv",phename = "Ordinal",outpath = "PSR_Ordinal_B2_Z_withCov",h2 = TRUE,use_fixed = TRUE,use_kinship = FALSE,use_randomZ = TRUE)
pseudo.csvwidedata.csv (PSR only)gwas.csvThe PSR-GLMM/R software platform, together with user manuals, demonstration code, full source code, example datasets, and bibliographic references, is freely accessible at: