{"id":21433566,"url":"https://github.com/limix/struct-lmm","last_synced_at":"2025-07-14T13:31:22.563Z","repository":{"id":57471940,"uuid":"89617659","full_name":"limix/struct-lmm","owner":"limix","description":"Structured Linear Mixed Model is a method to test for loci that interact with multiple environments.","archived":false,"fork":false,"pushed_at":"2020-09-16T17:25:27.000Z","size":378,"stargazers_count":14,"open_issues_count":7,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-09-29T14:36:23.340Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/limix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-27T16:22:30.000Z","updated_at":"2024-06-11T13:42:36.000Z","dependencies_parsed_at":"2022-08-30T13:52:13.635Z","dependency_job_id":null,"html_url":"https://github.com/limix/struct-lmm","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limix%2Fstruct-lmm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limix%2Fstruct-lmm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limix%2Fstruct-lmm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limix%2Fstruct-lmm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/limix","download_url":"https://codeload.github.com/limix/struct-lmm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225980902,"owners_count":17554919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T23:28:48.196Z","updated_at":"2024-11-22T23:28:48.773Z","avatar_url":"https://github.com/limix.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Struct-LMM\n\nStructured Linear Mixed Model (StructLMM) is a computationally efficient method to\ntest for and characterize loci that interact with multiple environments [1].\n\nThis a standalone module that implements the basic functionalities of StructLMM.\nHowever, we recommend using StructLMM via\n[LIMIX2](https://limix.readthedocs.io/en/2.0.x/index.html) as this additionally\nimplements:\n\n- Multiple methods for GWAS;\n- Methods to characterize GxE at specific variants;\n- Command line interface.\n\n## Install\n\nFrom terminal, it can be installed using [pip](https://pypi.org/pypi/pip):\n\n```bash\npip install struct-lmm\n```\n\n## Usage\n\n```python\n\u003e\u003e\u003e from numpy import ones, concatenate\n\u003e\u003e\u003e from numpy.random import RandomState\n\u003e\u003e\u003e\n\u003e\u003e\u003e from struct_lmm import StructLMM\n\u003e\u003e\u003e\n\u003e\u003e\u003e random = RandomState(1)\n\u003e\u003e\u003e n = 20\n\u003e\u003e\u003e k = 4\n\u003e\u003e\u003e y = random.randn(n, 1)\n\u003e\u003e\u003e E = random.randn(n, k)\n\u003e\u003e\u003e M = ones((n, 1))\n\u003e\u003e\u003e x = 1.0 * (random.rand(n, 1) \u003c 0.2)\n\u003e\u003e\u003e\n\u003e\u003e\u003e lmm = StructLMM(y, M, E)\n\u003e\u003e\u003e lmm.fit(verbose=False)\n\u003e\u003e\u003e # Association test\n\u003e\u003e\u003e pv = lmm.score_2dof_assoc(x)\n\u003e\u003e\u003e print(pv)\n0.8470017313426488\n\u003e\u003e\u003e # Association test\n\u003e\u003e\u003e pv, rho = lmm.score_2dof_assoc(x, return_rho=True)\n\u003e\u003e\u003e print(pv)\n0.8470017313426488\n\u003e\u003e\u003e print(rho)\n0\n\u003e\u003e\u003e M = concatenate([M, x], axis=1)\n\u003e\u003e\u003e lmm = StructLMM(y, M, E)\n\u003e\u003e\u003e lmm.fit(verbose=False)\n\u003e\u003e\u003e # Interaction test\n\u003e\u003e\u003e pv = lmm.score_2dof_inter(x)\n\u003e\u003e\u003e print(pv)\n0.6781100453132024\n```\n\n## Problems\n\nIf you encounter any problem, please, consider submitting a [new issue](https://github.com/limix/struct-lmm/issues/new).\n\n## Authors\n\n- [Danilo Horta](https://github.com/horta)\n- [Francesco Paolo Casale](https://github.com/fpcasale)\n- [Oliver Stegle](https://github.com/ostegle)\n- [Rachel Moore](https://github.com/rm18)\n\n## License\n\nThis project is licensed under the [MIT License](https://raw.githubusercontent.com/limix/struct-lmm/master/LICENSE.md).\n\n[1] Moore, R., Casale, F. P., Bonder, M. J., Horta, D., Franke, L., Barroso, I., \u0026\n    Stegle, O. (2018). [A linear mixed-model approach to study multivariate\n    gene–environment interactions](https://www.nature.com/articles/s41588-018-0271-0) (p. 1). Nature Publishing Group.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimix%2Fstruct-lmm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flimix%2Fstruct-lmm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimix%2Fstruct-lmm/lists"}