Metadata-Version: 2.4
Name: fastlmm
Version: 1.1.0b1
Summary: Fast GWAS
Keywords: gwas,bioinformatics,LMMs,MLMs,linear,mixed models,genomics,genetics,python
Author: FaST-LMM Team
Author-email: FaST-LMM Team <fastlmm-dev@python.org>
License-Expression: Apache-2.0
License-File: LICENSE.md
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Requires-Dist: numpy>=1.23.5 ; python_full_version < '3.12'
Requires-Dist: numpy>=1.26.0 ; python_full_version == '3.12.*'
Requires-Dist: numpy>=2.1.0 ; python_full_version == '3.13.*'
Requires-Dist: numpy>=2.3.5 ; python_full_version == '3.14.*'
Requires-Dist: numpy>=2.5.4 ; python_full_version >= '3.15'
Requires-Dist: scipy>=1.9.3 ; python_full_version < '3.12'
Requires-Dist: scipy>=1.11.3 ; python_full_version == '3.12.*'
Requires-Dist: scipy>=1.14.1 ; python_full_version == '3.13.*'
Requires-Dist: scipy>=1.16.1 ; python_full_version == '3.14.*'
Requires-Dist: scipy>=1.18.1 ; python_full_version >= '3.15'
Requires-Dist: pandas>=1.5.3,<4 ; python_full_version < '3.12'
Requires-Dist: pandas>=2.1.1,<4 ; python_full_version == '3.12.*'
Requires-Dist: pandas>=2.2.3,<4 ; python_full_version == '3.13.*'
Requires-Dist: pandas>=2.3.3,<4 ; python_full_version >= '3.14'
Requires-Dist: matplotlib>=3.8.0 ; python_full_version < '3.14'
Requires-Dist: matplotlib>=3.10.5 ; python_full_version >= '3.14'
Requires-Dist: scikit-learn>=1.4.2 ; python_full_version < '3.14'
Requires-Dist: scikit-learn>=1.7.2 ; python_full_version >= '3.14'
Requires-Dist: cloudpickle>=3.1.0 ; python_full_version < '3.14'
Requires-Dist: cloudpickle>=3.1.1 ; python_full_version >= '3.14'
Requires-Dist: statsmodels>=0.14.2 ; python_full_version < '3.14'
Requires-Dist: statsmodels>=0.14.5 ; python_full_version >= '3.14'
Requires-Dist: psutil>=6.1.0 ; python_full_version < '3.14'
Requires-Dist: psutil>=7.1.2 ; python_full_version >= '3.14'
Requires-Dist: bed-reader>=1.3.0b3
Requires-Dist: tabulate>=0.9.0
Requires-Dist: pysnptools>=1.1.0b2
Requires-Dist: fastlmmrslib>=0.1.0
Requires-Dist: cbgen>=1.0.6 ; extra == 'bgen'
Requires-Dist: bgen-reader>=4.0.9 ; extra == 'bgen'
Requires-Dist: pysnptools[cupy]>=1.1.0b2 ; extra == 'cupy'
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: pytest-cov ; extra == 'dev'
Requires-Dist: pytest-doctestplus ; extra == 'dev'
Requires-Dist: pytest-datadir ; extra == 'dev'
Requires-Dist: limix-sphinx-theme>=0.0.4 ; extra == 'dev'
Requires-Dist: pytest-sphinx>=0.2.2 ; extra == 'dev'
Requires-Dist: sphinx>=6.2.1 ; extra == 'dev'
Requires-Dist: sphinx-rtd-theme>=0.4.3 ; extra == 'dev'
Requires-Dist: ruff>=0.1.0 ; extra == 'dev'
Requires-Dist: h5py>=3.12.1 ; python_full_version < '3.14' and extra == 'hdf5'
Requires-Dist: h5py>=3.15.0 ; python_full_version >= '3.14' and extra == 'hdf5'
Requires-Python: >=3.11.5
Project-URL: Homepage, https://fastlmm.github.io/
Project-URL: Documentation, https://fastlmm.github.io/FaST-LMM
Project-URL: Issues, https://github.com/fastlmm/FaST-LMM/issues
Project-URL: Source, https://github.com/fastlmm/FaST-LMM
Provides-Extra: bgen
Provides-Extra: cupy
Provides-Extra: dev
Provides-Extra: hdf5
Description-Content-Type: text/markdown

FaST-LMM
=================================

FaST-LMM, which stands for Factored Spectrally Transformed Linear Mixed Models, is a program for performing 
genome-wide association studies (GWAS) on datasets of all sizes, up to one million individuals.

This release contains the following features, each illustrated with an IPython notebook.

* Core FaST-LMM ([notebook](https://github.com/fastlmm/FaST-LMM/blob/main/doc/ipynb/FaST-LMM.ipynb)) -- [Lippert *et al.*, *Nature Methods* 2011](http://www.nature.com/nmeth/journal/v8/n10/abs/nmeth.1681.html)

Improvements:

* **New: GPU and float32 for `single_snp`** ([notebook](https://github.com/fastlmm/FaST-LMM/blob/main/doc/ipynb/FaST-LMM.ipynb), [GPU guide](https://github.com/fastlmm/FaST-LMM/blob/main/doc/source/gpu.rst)) -- single-kernel `single_snp` runs about 10 times as fast on an NVIDIA GPU with float32 as on the CPU with the default float64. See [GPU and float32](#gpu-and-float32) below.
* New features for single_snp (including effect size and multiple phenotype support) and epistasis (including reporting beta and using pre-computed eigenvalue decompositions) ([notebook](https://github.com/fastlmm/FaST-LMM/blob/main/doc/ipynb/fastlmm2021.ipynb))  -- [Lippert *et al.*, *Nature Methods* 2011](http://www.nature.com/nmeth/journal/v8/n10/abs/nmeth.1681.html)
* Ludicrous-Speed GWAS ([notebook](https://github.com/fastlmm/FaST-LMM/blob/main/doc/ipynb/SingleSnpScale.ipynb)) -- [Kadie and Heckerman, *bioRxiv* 2018](https://www.biorxiv.org/content/10.1101/154682v2)
* Heritability with Spatial Correction ([notebook](https://github.com/fastlmm/FaST-LMM/blob/main/doc/ipynb/heritability_si.ipynb)), [Heckerman *et al.*, *PNAS* 2016](http://www.pnas.org/content/113/27/7377.abstract)
* Two Kernels ([notebook](https://github.com/fastlmm/FaST-LMM/blob/main/doc/ipynb/FaST-LMM.ipynb)) -- [Widmer *et al.*, *Scientific Reports* 2014](http://www.nature.com/srep/2014/141112/srep06874/full/srep06874.html)
* Set Analysis ([notebook](https://github.com/fastlmm/FaST-LMM/blob/main/doc/ipynb/FaST-LMM.ipynb)) -- [Lippert *et al.*, *Bioinformatics* 2014](http://bioinformatics.oxfordjournals.org/content/early/2014/09/07/bioinformatics.btu504)
* Epistasis ([notebook](https://github.com/fastlmm/FaST-LMM/blob/main/doc/ipynb/FaST-LMM.ipynb)) -- [Lippert *et al.*, *Scientific Reports,* 2013](http://www.nature.com/srep/2013/130122/srep01099/full/srep01099.html)
* Prediction ([notebook](https://github.com/fastlmm/FaST-LMM/blob/main/doc/ipynb/FaST-LMM.ipynb)) -- [Lippert *et al.*, *Nature Methods* 2011](http://www.nature.com/nmeth/journal/v8/n10/abs/nmeth.1681.html)

*A C++ version, which is generally less functional, is available. See http://fastlmm.github.io/.*

Quick install:
=================================

`pip install fastlmm`

FaST-LMM supports Python 3.11.5 through 3.15. HDF5 and BGEN file support are optional and available on Python 3.11 through 3.14: install `fastlmm[hdf5]`, `fastlmm[bgen]`, or `fastlmm[hdf5,bgen]`.

For best CPU performance, limit BLAS threads to your physical core count (for example, `export OMP_NUM_THREADS=16` on a 16-core, 32-thread CPU); in our tests, using every logical core was slower. For large problems, an NVIDIA GPU is much faster; see [GPU and float32](#gpu-and-float32).

GPU and float32
=================================

FaST-LMM's single-kernel `single_snp` can run on an NVIDIA GPU, in float32 (strongly recommended) or float64.
On a synthetic dataset with 14,925 individuals and 100,000 SNPs, float32 on an RTX 3060
ran about 10 times as fast as the default CPU float64, and about 5 times as fast as
CPU float32. On the CPU alone, float32 ran about 2.5 times as fast as float64.

Install the `cupy` extra:

    pip install "fastlmm[cupy]==1.1.0b1"

Then ask for the GPU and float32:

```python
from fastlmm.association import single_snp

results = single_snp(bed_fn, pheno_fn, covar=cov_fn, count_A1=False, xp="cupy", dtype="float32")
```

Float32 changes p-values slightly, so compare against float64 on representative data
when precision matters. Other FaST-LMM functions, including two-kernel `single_snp` and
epistasis, warn and run on the CPU in float64. GPU support requires NVIDIA CUDA on
x86-64 Windows or Linux, including WSL2; Python 3.15 is currently CPU-only.
A 12 GB card handles about 20,000 individuals with a full-rank kernel, or about 50,000
individuals with an 8,000-SNP low-rank kernel; the guide gives the general rule.
See the [GPU guide](https://github.com/fastlmm/FaST-LMM/blob/main/doc/source/gpu.rst)
for setup, defaults, caching, and limitations.

Documentation
=================================

* IPython Notebooks:
	* [Core, Epistasis, Set Analysis, Two Kernels](https://github.com/fastlmm/FaST-LMM/blob/main/doc/ipynb/FaST-LMM.ipynb)
    * [Multiple-Phenotype GWAS and related features](https://github.com/fastlmm/FaST-LMM/blob/main/doc/ipynb/fastlmm2021.ipynb)
	* [Heritability with Spatial Correction](https://github.com/fastlmm/FaST-LMM/blob/main/doc/ipynb/heritability_si.ipynb)
	* [Ludicrous-Speed GWAS](https://github.com/fastlmm/FaST-LMM/blob/main/doc/ipynb/SingleSnpScale.ipynb)
* [Main Documentation](http://fastlmm.github.io/FaST-LMM/)
* [Project Home and Full Annotated Bibliography](https://fastlmm.github.io/)


Code
=================================

* [PyPi](https://pypi.org/project/fastlmm/)
* [GitHub](https://github.com/fastlmm/FaST-LMM)

Development
=================================

The project uses [uv](https://docs.astral.sh/uv/) for reproducible development
environments, dependency locking, testing, and builds:

```console
uv sync --frozen --extra dev --extra hdf5 --extra bgen
cd tests
uv run --frozen --no-sync python test.py
cd ..
uv build --no-sources
```

Testing has two supported runners. `pytest` collects Python tests and module,
reStructuredText, and Markdown doctests under `fastlmm/`; it is useful for
focused tests and editor integration. The canonical `tests/test.py` runner also
executes the input-based expected-output cases in `tests/inputs` and assembles
the project's legacy unittest suites. The runners overlap but cover different
workflows, so pytest collection does not replace the canonical runner.
CI and release qualification also run the focused backend and dtype pytest
modules. Cases that need a usable CUDA device require a separate GPU run.

See [RELEASING.md](RELEASING.md) for lower-bound, artifact, notebook, and
release qualification.

Policy on AI-assisted development and contributions
=================================

AI tools may be used as productivity aids for drafting, exploration, and
refactoring. Every contributed code or documentation change must be reviewed,
edited, and validated by a human. AI does not replace design judgment,
testing, or human responsibility for correctness.

The repository's published instructions and constraints for AI tools are in
[AGENTS.md](AGENTS.md).

Contacts
=================================

* Email the developers at fastlmm-dev@python.org.
* [Join](mailto:fastlmm-user-join@python.org?subject=Subscribe) the user discussion and announcement list (or use [web sign up](https://mail.python.org/mailman3/lists/fastlmm-user.python.org)).
* [Open an issue](https://github.com/fastlmm/FaST-LMM/issues) on GitHub.
