struct-lmm


Namestruct-lmm JSON
Version 0.3.2 PyPI version JSON
download
home_pagehttps://github.com/limix/struct-lmm
SummaryLinear mixed model to study multivariate genotype-environment interactions
upload_time2020-09-16 17:41:24
maintainerDanilo Horta
docs_urlNone
authorD. Horta, P. Casale, R. Moore
requires_python
licenseMIT
keywords lmm gwas environment
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://limix.readthedocs.io/en/2.0.x/index.html) 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](https://pypi.org/pypi/pip):

```bash
pip install struct-lmm
```

## Usage

```python
>>> 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](https://github.com/limix/struct-lmm/issues/new).

## Authors

- [Danilo Horta](https://github.com/horta)
- [Francesco Paolo Casale](https://github.com/fpcasale)
- [Oliver Stegle](https://github.com/ostegle)
- [Rachel Moore](https://github.com/rm18)

## License

This project is licensed under the [MIT License](https://raw.githubusercontent.com/limix/struct-lmm/master/LICENSE.md).

[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](https://www.nature.com/articles/s41588-018-0271-0) (p. 1). Nature Publishing Group.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/limix/struct-lmm",
    "name": "struct-lmm",
    "maintainer": "Danilo Horta",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "horta@ebi.ac.uk",
    "keywords": "lmm,gwas,environment",
    "author": "D. Horta, P. Casale, R. Moore",
    "author_email": "rm18@sanger.ac.uk",
    "download_url": "https://files.pythonhosted.org/packages/4f/b9/566d61e706cbaea0004c13aa5c83821643572b40aec967ea99005b09538d/struct-lmm-0.3.2.tar.gz",
    "platform": "Windows",
    "description": "# 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>>> from numpy import ones, concatenate\n>>> from numpy.random import RandomState\n>>>\n>>> from struct_lmm import StructLMM\n>>>\n>>> random = RandomState(1)\n>>> n = 20\n>>> k = 4\n>>> y = random.randn(n, 1)\n>>> E = random.randn(n, k)\n>>> M = ones((n, 1))\n>>> x = 1.0 * (random.rand(n, 1) < 0.2)\n>>>\n>>> lmm = StructLMM(y, M, E)\n>>> lmm.fit(verbose=False)\n>>> # Association test\n>>> pv = lmm.score_2dof_assoc(x)\n>>> print(pv)\n0.8470017313426488\n>>> # Association test\n>>> pv, rho = lmm.score_2dof_assoc(x, return_rho=True)\n>>> print(pv)\n0.8470017313426488\n>>> print(rho)\n0\n>>> M = concatenate([M, x], axis=1)\n>>> lmm = StructLMM(y, M, E)\n>>> lmm.fit(verbose=False)\n>>> # Interaction test\n>>> pv = lmm.score_2dof_inter(x)\n>>> 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., &\n    Stegle, O. (2018). [A linear mixed-model approach to study multivariate\n    gene\u2013environment interactions](https://www.nature.com/articles/s41588-018-0271-0) (p. 1). Nature Publishing Group.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Linear mixed model to study multivariate genotype-environment interactions",
    "version": "0.3.2",
    "split_keywords": [
        "lmm",
        "gwas",
        "environment"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "5d35737678c3c50b7f9a258388dd7a96",
                "sha256": "3a2d8560e716ce4c6be0f6f2d9adf3015f9f04e456f97e01efd7ee368dd8f047"
            },
            "downloads": -1,
            "filename": "struct_lmm-0.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5d35737678c3c50b7f9a258388dd7a96",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 13189,
            "upload_time": "2020-09-16T17:41:23",
            "upload_time_iso_8601": "2020-09-16T17:41:23.539139Z",
            "url": "https://files.pythonhosted.org/packages/5b/eb/c7076b118dd99778d2619b0d3408e1dbe96616b765bcecf66222539194e7/struct_lmm-0.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "9d7c33e1e24fffcf0e56a35fb671f851",
                "sha256": "4abec1e0fc80335bfbe4a95dd6136a22107efb80572376964b65761aaacc4233"
            },
            "downloads": -1,
            "filename": "struct-lmm-0.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "9d7c33e1e24fffcf0e56a35fb671f851",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 13525,
            "upload_time": "2020-09-16T17:41:24",
            "upload_time_iso_8601": "2020-09-16T17:41:24.775366Z",
            "url": "https://files.pythonhosted.org/packages/4f/b9/566d61e706cbaea0004c13aa5c83821643572b40aec967ea99005b09538d/struct-lmm-0.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-09-16 17:41:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "limix",
    "error": "Could not fetch GitHub repository",
    "lcname": "struct-lmm"
}
        
Elapsed time: 0.14515s