{
  "_id": "6a2122e4cd65a98ecbd1fbd1",
  "Package": "simtrait",
  "Title": "Simulate Complex Traits from Genotypes",
  "Version": "1.1.11.9000",
  "Authors@R": "c(\nperson(given = \"Alejandro\",\nfamily = \"Ochoa\",\nrole = c(\"aut\", \"cre\"),\nemail = \"alejandro.ochoa@duke.edu\",\ncomment = c(ORCID = \"0000-0003-4928-3403\")),\nperson(given = \"Grace E.\",\nfamily = \"Rhodes\",\nrole = \"aut\",\nemail = \"grace.e.rhodes@duke.edu\",\ncomment = c(ORCID = \"0000-0001-9412-5370\"))\n)",
  "Description": "Simulate complex traits given a SNP genotype matrix and\nmodel parameters (the desired heritability, optional\nenvironment group effects, number of causal loci, and either\nthe true ancestral allele frequencies used to generate the\ngenotypes or the mean kinship for a real dataset).  Emphasis is\non avoiding common biases due to the use of estimated allele\nfrequencies.  The code selects random loci to be causal,\nconstructs coefficients for these loci and random independent\nnon-genetic effects, and can optionally generate random group\neffects.  Traits can follow three models: random coefficients,\nfixed effect sizes, and infinitesimal (multivariate normal).\nGWAS method benchmarking functions are also provided. Described\nin Yao and Ochoa (2023) <doi:10.7554/eLife.79238>.",
  "License": "GPL-3",
  "Encoding": "UTF-8",
  "Roxygen": "list(markdown = TRUE)",
  "RoxygenNote": "7.3.2",
  "VignetteBuilder": "knitr",
  "URL": "https://github.com/OchoaLab/simtrait",
  "BugReports": "https://github.com/OchoaLab/simtrait/issues",
  "Repository": "https://ochoalab.r-universe.dev",
  "Date/Publication": "2025-07-08 20:14:32 UTC",
  "RemoteUrl": "https://github.com/ochoalab/simtrait",
  "RemoteRef": "HEAD",
  "RemoteSha": "89b19084517ff563c79b8a490cec9fb1d1925b95",
  "NeedsCompilation": "no",
  "Packaged": {
    "Date": "2026-06-04 06:58:09 UTC",
    "User": "root"
  },
  "Author": "Alejandro Ochoa [aut, cre] (ORCID:\n<https://orcid.org/0000-0003-4928-3403>),\nGrace E. Rhodes [aut] (ORCID: <https://orcid.org/0000-0001-9412-5370>)",
  "Maintainer": "Alejandro Ochoa <alejandro.ochoa@duke.edu>",
  "MD5sum": "d82637d87eed3f1dc5da170a6a99296c",
  "_user": "ochoalab",
  "_type": "src",
  "_file": "simtrait_1.1.11.9000.tar.gz",
  "_fileid": "5043926dcb6ec9b6b51f66a9bad9b1aeff18665b8fbfb400ec4c31282ebf6d45",
  "_filesize": 1044921,
  "_sha256": "5043926dcb6ec9b6b51f66a9bad9b1aeff18665b8fbfb400ec4c31282ebf6d45",
  "_created": "2026-06-04T06:58:09.000Z",
  "_published": "2026-06-04T07:01:56.716Z",
  "_distro": "noble",
  "_jobs": [
    {
      "job": 79466349259,
      "time": 116,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7405027541"
    },
    {
      "job": 79466349305,
      "time": 114,
      "config": "linux-release-x86_64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7405026951"
    },
    {
      "job": 79466349340,
      "time": 134,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7405025858"
    },
    {
      "job": 79466349264,
      "time": 180,
      "config": "macos-release-arm64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7405033147"
    },
    {
      "job": 79465892835,
      "time": 186,
      "config": "source",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7404997023"
    },
    {
      "job": 79466349270,
      "time": 112,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7405026407"
    },
    {
      "job": 79466349255,
      "time": 79,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7405018901"
    },
    {
      "job": 79466349246,
      "time": 70,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7405016447"
    },
    {
      "job": 79466349281,
      "time": 88,
      "config": "windows-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7405020642"
    }
  ],
  "_buildurl": "https://github.com/r-universe/ochoalab/actions/runs/26936018524",
  "_status": "success",
  "_host": "GitHub-Actions",
  "_upstream": "https://github.com/ochoalab/simtrait",
  "_commit": {
    "id": "89b19084517ff563c79b8a490cec9fb1d1925b95",
    "author": "Alejandro Ochoa Garcia <alexviiiag@gmail.com>",
    "committer": "Alejandro Ochoa Garcia <alexviiiag@gmail.com>",
    "message": "Function `sim_trait_model` corrected minor bug that if input `model` contained `trait` and `group_effects` now they are erased and the object contains the new values only.\n",
    "time": 1752005672
  },
  "_maintainer": {
    "name": "Alejandro Ochoa",
    "email": "alejandro.ochoa@duke.edu",
    "login": "alexviiia",
    "orcid": "0000-0003-4928-3403",
    "description": "Statistical geneticist, computational biologist.  Well-rounded nerd, also love languages and music.",
    "uuid": 12603341
  },
  "_registered": true,
  "_dependencies": [
    {
      "package": "PRROC",
      "role": "Imports"
    },
    {
      "package": "stats",
      "role": "Imports"
    },
    {
      "package": "popkin",
      "role": "Suggests"
    },
    {
      "package": "testthat",
      "role": "Suggests"
    },
    {
      "package": "knitr",
      "role": "Suggests"
    },
    {
      "package": "rmarkdown",
      "role": "Suggests"
    },
    {
      "package": "bnpsd",
      "role": "Suggests"
    },
    {
      "package": "BEDMatrix",
      "role": "Suggests"
    }
  ],
  "_owner": "ochoalab",
  "_selfowned": true,
  "_usedby": 0,
  "_updates": [
    {
      "week": "2025-27",
      "n": 1
    },
    {
      "week": "2025-28",
      "n": 1
    }
  ],
  "_tags": [],
  "_stars": 6,
  "_contributors": [
    {
      "user": "alexviiia",
      "count": 77,
      "uuid": 12603341
    }
  ],
  "_userbio": {
    "uuid": 41968176,
    "type": "organization",
    "name": "Ochoa Lab at Duke StatGen",
    "description": "Research in statgen, biostats, compbio"
  },
  "_downloads": {
    "count": 133,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/simtrait"
  },
  "_devurl": "https://github.com/ochoalab/simtrait",
  "_searchresults": 37,
  "_rbuild": "4.6.0",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/readme.html",
    "extra/readme.md",
    "extra/simtrait.html",
    "manual.pdf"
  ],
  "_homeurl": "https://github.com/ochoalab/simtrait",
  "_realowner": "ochoalab",
  "_cranurl": true,
  "_releases": [
    {
      "version": "1.0.21",
      "date": "2021-08-16"
    },
    {
      "version": "1.1.0",
      "date": "2022-08-23"
    },
    {
      "version": "1.1.3",
      "date": "2023-01-06"
    }
  ],
  "_exports": [
    "allele_freqs",
    "cov_trait",
    "herit_loci",
    "inv_var_est_bayesian",
    "p_anc_est_beta_mle",
    "pval_aucpr",
    "pval_gc",
    "pval_infl",
    "pval_power_calib",
    "pval_srmsd",
    "pval_type_1_err",
    "rmsd",
    "sim_trait",
    "sim_trait_model",
    "sim_trait_mvn"
  ],
  "_help": [
    {
      "page": "allele_freqs",
      "title": "Compute locus allele frequencies",
      "topics": [
        "allele_freqs"
      ]
    },
    {
      "page": "cov_trait",
      "title": "The model covariance matrix of the trait",
      "topics": [
        "cov_trait"
      ]
    },
    {
      "page": "herit_loci",
      "title": "Per-locus heritability contribution from allele frequency and causal coefficient",
      "topics": [
        "herit_loci"
      ]
    },
    {
      "page": "inv_var_est_bayesian",
      "title": "Calculate expectations of inverse variance terms over the posterior distribution of the ancestral allele frequency",
      "topics": [
        "inv_var_est_bayesian"
      ]
    },
    {
      "page": "p_anc_est_beta_mle",
      "title": "Calculate maximum likelihood estimates of allele frequencies from Beta model",
      "topics": [
        "p_anc_est_beta_mle"
      ]
    },
    {
      "page": "pval_aucpr",
      "title": "Area under the precision-recall curve",
      "topics": [
        "pval_aucpr"
      ]
    },
    {
      "page": "pval_gc",
      "title": "Apply genomic control transformation to a list of p-values",
      "topics": [
        "pval_gc"
      ]
    },
    {
      "page": "pval_infl",
      "title": "Calculate inflation factor from p-values",
      "topics": [
        "pval_infl"
      ]
    },
    {
      "page": "pval_power_calib",
      "title": "Estimate calibrated power",
      "topics": [
        "pval_power_calib"
      ]
    },
    {
      "page": "pval_srmsd",
      "title": "Signed RMSD measure of null p-value uniformity",
      "topics": [
        "pval_srmsd"
      ]
    },
    {
      "page": "pval_type_1_err",
      "title": "Estimate type I error rate",
      "topics": [
        "pval_type_1_err"
      ]
    },
    {
      "page": "rmsd",
      "title": "Root mean square deviation",
      "topics": [
        "rmsd"
      ]
    },
    {
      "page": "sim_trait",
      "title": "Simulate a complex trait from genotypes",
      "topics": [
        "sim_trait"
      ]
    },
    {
      "page": "sim_trait_model",
      "title": "Simulate a complex trait from a fixed trait model",
      "topics": [
        "sim_trait_model"
      ]
    },
    {
      "page": "sim_trait_mvn",
      "title": "Simulate traits from a kinship matrix under the infinitesimal model",
      "topics": [
        "sim_trait_mvn"
      ]
    },
    {
      "page": "simtrait",
      "title": "simtrait: simulate complex traits from genotypes",
      "topics": [
        "simtrait-package",
        "simtrait"
      ]
    }
  ],
  "_pkglogo": "https://github.com/ochoalab/simtrait/raw/HEAD/man/figures/logo.png",
  "_readme": "https://github.com/ochoalab/simtrait/raw/HEAD/README.md",
  "_rundeps": [
    "PRROC",
    "rlang"
  ],
  "_vignettes": [
    {
      "source": "simtrait.Rmd",
      "filename": "simtrait.html",
      "title": "simtrait: Simulate Complex Traits from Genotypes",
      "author": "Alejandro Ochoa",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Introduction",
        "Sample usage",
        "Load libraries required for this vignette",
        "Simulate an admixed population",
        "Simulate a trait from random coefficients (RC) model",
        "Compare sample covariance of trait to theoretical expectation",
        "Simulated trait without ancestral allele frequencies",
        "Simulated trait from infinitesimal model",
        "Simulated trait from fixed effect sizes (FES) model",
        "Environment group effects",
        "Model",
        "We assume the linear polygenic model for a quantitative trait:$$\\mathbf",
        "Algorithm",
        "Constructing environment and residual effects",
        "Constructing coefficients",
        "Scaling coefficients",
        "Scaling using known ancestral allele frequencies",
        "Scaling using a known kinship matrix",
        "Centering the trait",
        "Centering using known ancestral allele frequencies",
        "This is the preferred approach as it is the only case that guarantees success.Given our model, we obtain the desired overall trait mean $\\mu$ by choosing the intercept to be$$\\alpha",
        "Centering without ancestral allele frequencies",
        "How NOT to center the trait vector",
        "Now let's discuss why the obvious way of centering the trait without known ancestral allele frequencies doesn't work.Why not use the sample allele frequencies as$$\\alpha",
        "\\mu - 2 \\mathbf{\\hat{p}}' \\boldsymbol{\\beta} \\quad ?$$Centering the trait this way is equivalent to centering genotypes at each locus:$$\\mathbf{y} = \\mathbf{1}n \\alpha + \\sum{i=1}^m (\\mathbf{x}_i - 2 \\hat{p}_i \\mathbf{1}_n) \\beta_i + \\boldsymbol{\\epsilon}.$$However, this operation introduces a distortion in the covariance of the genotypes [@Ochoa083923]:$$\\Cov \\left( \\mathbf{x}_i - 2 \\hat{p}_i \\mathbf{1}_n \\right)",
        "References"
      ],
      "created": "2019-02-10 04:27:56",
      "modified": "2024-04-17 01:13:05",
      "commits": 16
    }
  ],
  "_score": 5.346352974450639,
  "_indexed": true,
  "_nocasepkg": "simtrait",
  "_universes": [
    "ochoalab",
    "alexviiia"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "1.1.11.9000",
      "date": "2026-06-04T07:00:12.000Z",
      "distro": "noble",
      "commit": "89b19084517ff563c79b8a490cec9fb1d1925b95",
      "fileid": "7637678205d78cabac4520b64ee514c4418d62a02239cd343f5890d93af449ea",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/ochoalab/actions/runs/26936018524"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "1.1.11.9000",
      "date": "2026-06-04T07:00:09.000Z",
      "distro": "noble",
      "commit": "89b19084517ff563c79b8a490cec9fb1d1925b95",
      "fileid": "ad4f10b6d85f962720eced90b9ad926ede82e444b34868aafc62f2be5b915fa0",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/ochoalab/actions/runs/26936018524"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "1.1.11.9000",
      "date": "2026-06-04T07:00:10.000Z",
      "commit": "89b19084517ff563c79b8a490cec9fb1d1925b95",
      "fileid": "d24bf5f68949a73e2f501be22d0019ce4c788ba199a438f562c2db76b508b530",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/ochoalab/actions/runs/26936018524"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "1.1.11.9000",
      "date": "2026-06-04T07:00:32.000Z",
      "commit": "89b19084517ff563c79b8a490cec9fb1d1925b95",
      "fileid": "11f767506ba3e6753c815ac7d22a5d86cabb882d890fe868ef0ad82bef5d4753",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/ochoalab/actions/runs/26936018524"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "1.1.11.9000",
      "date": "2026-06-04T07:00:20.000Z",
      "commit": "89b19084517ff563c79b8a490cec9fb1d1925b95",
      "fileid": "cefdae862f9439ef8f7f7bd6ac4ab359cc80a6dc808d60f63327c09e23f27421",
      "status": "success",
      "buildurl": "https://github.com/r-universe/ochoalab/actions/runs/26936018524"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "1.1.11.9000",
      "date": "2026-06-04T06:59:30.000Z",
      "commit": "89b19084517ff563c79b8a490cec9fb1d1925b95",
      "fileid": "e70f26052b20d04847148f6c9dff1488728fd35f7bf81501697ca92ceec7c714",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/ochoalab/actions/runs/26936018524"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "1.1.11.9000",
      "date": "2026-06-04T06:59:22.000Z",
      "commit": "89b19084517ff563c79b8a490cec9fb1d1925b95",
      "fileid": "e28489e34f4256c9d2eace81584b0f8fb8fffc87af735126c69e0e2e61fa8fb8",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/ochoalab/actions/runs/26936018524"
    },
    {
      "r": "4.6.0",
      "os": "win",
      "version": "1.1.11.9000",
      "date": "2026-06-04T06:59:37.000Z",
      "commit": "89b19084517ff563c79b8a490cec9fb1d1925b95",
      "fileid": "85a49cb9ea17f2b14e7579fa0bba4381928f5c3992c6dc86067b2ac4b8190830",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/ochoalab/actions/runs/26936018524"
    }
  ]
}