PSR-GLMM/R User Guide (README)

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.


1. Input File Description

1.1 Genotype file (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,…


1.2 Phenotype file (phecsv)

CSV format. Each row corresponds to one individual.

Typical columns may include:


1.3 Kinship matrix (kkcsv)

Required for GLMM / P3D / PSR (kinship mode).


1.4 User-defined random design matrix (Z.csv)

Optional alternative to the kinship matrix for PSR.


1.5 Covariate file (cov.csv)

Optional fixed-effect covariates.


2. Common Parameters

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²)

3. PSR Method Examples

3.1 The pseudo response method (PSR) for “binomial” trait

  1. # ===== Mode A (Kinship K), no covariates =====
  2. PSR(
  3. gencsv = "data/IMF2-Genotypes-N.csv",
  4. phecsv = "data/IMF2-Phenotypes.csv",
  5. kkcsv = "data/kk.csv",
  6. zcsv = NULL,
  7. covcsv = NULL,
  8. phename = "Event",
  9. phetype = "binomial",
  10. phenameother = "Trial",
  11. outpath = "PSR_A1_K_noCov_Binomial",
  12. h2 = FALSE,
  13. use_fixed = FALSE,
  14. use_kinship = TRUE,
  15. use_randomZ = FALSE
  16. )
  1. # ===== Mode A (Kinship K), with covariates =====
  2. PSR(
  3. gencsv = "data/IMF2-Genotypes-N.csv",
  4. phecsv = "data/IMF2-Phenotypes.csv",
  5. kkcsv = "data/kk.csv",
  6. zcsv = NULL,
  7. covcsv = "data/cov.csv",
  8. phename = "Event",
  9. phetype = "binomial",
  10. phenameother = "Trial",
  11. outpath = "PSR_A2_K_withCov_Binomial",
  12. h2 = FALSE,
  13. use_fixed = TRUE,
  14. use_kinship = TRUE,
  15. use_randomZ = FALSE
  16. )
  1. # ===== Mode B (Random Z), no covariates =====
  2. PSR(
  3. gencsv = "data/IMF2-Genotypes-N.csv",
  4. phecsv = "data/IMF2-Phenotypes.csv",
  5. kkcsv = NULL,
  6. zcsv = "data/Z.csv",
  7. covcsv = NULL,
  8. phename = "Event",
  9. phetype = "binomial",
  10. phenameother = "Trial",
  11. outpath = "PSR_B1_Z_noCov_Binomial",
  12. h2 = FALSE,
  13. use_fixed = FALSE,
  14. use_kinship = FALSE,
  15. use_randomZ = TRUE
  16. )
  1. # ===== Mode B (Random Z), with covariates =====
  2. PSR(
  3. gencsv = "data/IMF2-Genotypes-N.csv",
  4. phecsv = "data/IMF2-Phenotypes.csv",
  5. kkcsv = NULL,
  6. zcsv = "data/Z.csv",
  7. covcsv = "data/cov.csv",
  8. phename = "Event",
  9. phetype = "binomial",
  10. phenameother = "Trial",
  11. outpath = "PSR_B2_Z_withCov_Binomial",
  12. h2 = TRUE, # example: turn on locus-level H2
  13. use_fixed = TRUE,
  14. use_kinship = FALSE,
  15. use_randomZ = TRUE
  16. )

3.2 The pseudo response method (PSR) for “binary” and “poisson” trait

  1. PSR(
  2. gencsv = "data/IMF2-Genotypes-N.csv",
  3. phecsv = "data/IMF2-Phenotypes.csv",
  4. kkcsv = "data/kk.csv",
  5. zcsv = NULL,
  6. covcsv = NULL,
  7. phename = "Binary",
  8. phetype = "binary",
  9. phenameother = NULL,
  10. outpath = "PSR_A1_K_noCov_Binary",
  11. h2 = FALSE,
  12. use_fixed = FALSE,
  13. use_kinship = TRUE,
  14. use_randomZ = FALSE
  15. )
  1. PSR(
  2. gencsv = "data/IMF2-Genotypes-N.csv",
  3. phecsv = "data/IMF2-Phenotypes.csv",
  4. kkcsv = "data/kk.csv",
  5. zcsv = NULL,
  6. covcsv = NULL,
  7. phename = "Poisson",
  8. phetype = "poisson",
  9. phenameother = NULL,
  10. outpath = "PSR_A1_K_noCov_Poisson",
  11. h2 = FALSE,
  12. use_fixed = FALSE,
  13. use_kinship = TRUE,
  14. use_randomZ = FALSE
  15. )

3.3 The pseudo response method (PSR) for “Ordinal” trait

  1. # ===== Ordinal, Mode A1 (Kinship K), no covariates =====
  2. PSR_ORDINAL(
  3. gencsv = "data/IMF2-Genotypes-N.csv",
  4. phecsv = "data/IMF2-Phenotypes.csv",
  5. kkcsv = "data/kk.csv",
  6. zcsv = NULL,
  7. covcsv = NULL,
  8. phename = "Ordinal",
  9. outpath = "PSR_Ordinal_A1_K_noCov",
  10. h2 = FALSE,
  11. use_fixed = FALSE,
  12. use_kinship = TRUE,
  13. use_randomZ = FALSE
  14. )
  1. # ===== Ordinal, Mode A2 (Kinship K), with covariates =====
  2. PSR_ORDINAL(
  3. gencsv = "data/IMF2-Genotypes-N.csv",
  4. phecsv = "data/IMF2-Phenotypes.csv",
  5. kkcsv = "data/kk.csv",
  6. zcsv = NULL,
  7. covcsv = "data/cov.csv",
  8. phename = "Ordinal",
  9. outpath = "PSR_Ordinal_A2_K_withCov",
  10. h2 = FALSE,
  11. use_fixed = TRUE,
  12. use_kinship = TRUE,
  13. use_randomZ = FALSE
  14. )
  1. # ===== Ordinal, Mode B (Random Z), no covariates =====
  2. PSR_ORDINAL(
  3. gencsv = "data/IMF2-Genotypes-N.csv",
  4. phecsv = "data/IMF2-Phenotypes.csv",
  5. kkcsv = NULL,
  6. zcsv = "data/Z.csv",
  7. covcsv = NULL,
  8. phename = "Ordinal",
  9. outpath = "PSR_Ordinal_B1_Z_noCov",
  10. h2 = TRUE,
  11. use_fixed = FALSE,
  12. use_kinship = FALSE,
  13. use_randomZ = TRUE
  14. )
  1. # ===== Ordinal, Mode B (Random Z), with covariates =====
  2. PSR_ORDINAL(
  3. gencsv = "data/IMF2-Genotypes-N.csv",
  4. phecsv = "data/IMF2-Phenotypes.csv",
  5. kkcsv = NULL,
  6. zcsv = "data/Z.csv",
  7. covcsv = "data/cov.csv",
  8. phename = "Ordinal",
  9. outpath = "PSR_Ordinal_B2_Z_withCov",
  10. h2 = TRUE,
  11. use_fixed = TRUE,
  12. use_kinship = FALSE,
  13. use_randomZ = TRUE
  14. )

4. Output Files

4.1 pseudo.csv

4.2 widedata.csv (PSR only)

4.3 gwas.csv


5. Software Availability

The PSR-GLMM/R software platform, together with user manuals, demonstration code, full source code, example datasets, and bibliographic references, is freely accessible at:

http://106.13.144.206/psrglmm/index.html