Skip to main content

Struct-LMM

Structured Linear Mixed Model (StructLMM) is a computationally efficient method to test for and characterize loci that interact with multiple environments [1].

This a standalone module that implements the basic functionalities of StructLMM. However, we recommend using StructLMM via LIMIX2 as this additionally implements:

  • Multiple methods for GWAS;
  • Methods to characterize GxE at specific variants;
  • Command line interface.

Install

From terminal, it can be installed using pip:

pip install struct-lmm

Usage

>>> from numpy import ones, concatenate
>>> from numpy.random import RandomState
>>>
>>> from struct_lmm import StructLMM
>>>
>>> random = RandomState(1)
>>> n = 20
>>> k = 4
>>> y = random.randn(n, 1)
>>> E = random.randn(n, k)
>>> M = ones((n, 1))
>>> x = 1.0 * (random.rand(n, 1) < 0.2)
>>>
>>> lmm = StructLMM(y, M, E)
>>> lmm.fit(verbose=False)
>>> # Association test
>>> pv = lmm.score_2dof_assoc(x)
>>> print(pv)
0.8470017313426488
>>> # Association test
>>> pv, rho = lmm.score_2dof_assoc(x, return_rho=True)
>>> print(pv)
0.8470017313426488
>>> print(rho)
0
>>> M = concatenate([M, x], axis=1)
>>> lmm = StructLMM(y, M, E)
>>> lmm.fit(verbose=False)
>>> # Interaction test
>>> pv = lmm.score_2dof_inter(x)
>>> print(pv)
0.6781100453132024

Problems

If you encounter any problem, please, consider submitting a new issue.

Authors

License

This project is licensed under the MIT License.

[1] Moore, R., Casale, F. P., Bonder, M. J., Horta, D., Franke, L., Barroso, I., & Stegle, O. (2018). A linear mixed-model approach to study multivariate gene–environment interactions (p. 1). Nature Publishing Group.

Metadata

Release files for struct-lmm 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for struct-lmm 0.3.2
File Size Uploaded Provenance Actions
struct-lmm-0.3.2.tar.gz 13.5 kB Without provenance Details for struct-lmm-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for struct-lmm 0.3.2
File Interpreter ABI Platform Actions
struct_lmm-0.3.2-py3-none-any.whl Python 3 none any Details for struct_lmm-0.3.2-py3-none-any.whl

Total release size: 26.7 kB

Release files / struct-lmm-0.3.2.tar.gz

Download URL struct-lmm-0.3.2.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4abec1e0fc80335bfbe4a95dd6136a22107efb80572376964b65761aaacc4233
BLAKE2b-256 checksum
How to use checksums
4fb9566d61e706cbaea0004c13aa5c83821643572b40aec967ea99005b09538d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

Release files / struct_lmm-0.3.2-py3-none-any.whl

Download URL struct_lmm-0.3.2-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a2d8560e716ce4c6be0f6f2d9adf3015f9f04e456f97e01efd7ee368dd8f047
BLAKE2b-256 checksum
How to use checksums
5bebc7076b118dd99778d2619b0d3408e1dbe96616b765bcecf66222539194e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

Security for struct-lmm 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page