Skip to content

Commit

Permalink
Setup
Browse files Browse the repository at this point in the history
Update setup
  • Loading branch information
daikitag authored and mergify[bot] committed Aug 3, 2023
1 parent 8aa8707 commit 62b521a
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 39 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# tstrait

**tstrait** is a Quantitative trait simulator of [tskit](https://tskit.readthedocs.io/) tree sequences. It supports simulation from various trait models, and the details of the package are indicated in the [documentation].
**tstrait** is a quantitative trait simulator of [tskit](https://tskit.readthedocs.io/) tree sequences.

- Documentation:
- Source code: https://github.com/tskit-dev/tstrait
- Tree sequence documentation: https://tskit.dev/learn/

It provides:
- Simulation of quantitative traits
- Simulation of genetic effect sizes from various distributions
- Simulation of pleiotropic phenotypes
- Simulation of environmental noise
- Computation of individual genetic values given the effect sizes of causal mutations
1 change: 1 addition & 0 deletions requirements/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ matplotlib
msprime
numba
numpy
packaging
pandas
pre-commit
pytest
Expand Down
53 changes: 39 additions & 14 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,33 +1,58 @@
[metadata]
name = tstrait
version = 0.0.1
license = MIT
author = Daiki Tagami
author_email = [email protected]
description = Quantitative trait simulation
#long_description_content_type = text/markdown
#long_description = file: README.md
#url = https://github.com/daikitag/tstrait
maintainer = Tskit Developers
maintainer_email = [email protected]
description = Quantitative trait simulation of tree sequence data
long_description = file: README.md
long_description_content_type = text/markdown
url = https://tskit.dev/tstrait/
auuthor = Daiki Tagami et al.
download_url = https://pypi.python.org/pypi/tstrait
project_urls =
Github = https://github.com/daikitag/tstrait

classifiers =
Programming Language :: Python :: 3
Bug Tracker = https://github.com/tskit-dev/tstrait/issues
Documentation = https://tskit.dev/tstrait/docs/
Source Code = https://github.com/tskit-dev/tstrait
license = MIT
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved :: MIT License

Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3 :: Only
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Bio-Informatics
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: MacOS
platforms =
POSIX
Windows
MacOS X
keywords =
gwas
population genetics
quantitative trait
simulation
statistical genetics
tree sequence
tskit

[options]
packages = tstrait
python_requires = >=3.7
python_requires = >=3.8
install_requires =
numpy
numba>=0.57.0
pandas
tskit>=0.5.5
setup_requires =
setuptools_scm

[options.extras_require]
tests =
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import setuptools
from setuptools import setup

if __name__ == "__main__":
setuptools.setup()
setup(
use_scm_version={"write_to": "tstrait/_version.py"},
)
7 changes: 7 additions & 0 deletions tests/test_provenance.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import tstrait
from tstrait.provenance import __version__


class TestVersion:
def test_version(self):
assert tstrait.__version__ == __version__
2 changes: 1 addition & 1 deletion tests/test_simulate_phenotype.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_output_dim_exponential(self, num_ind, num_causal, h2, random_seed):
assert len(genetic_result.effect_size) == num_causal
assert len(genetic_result.allele_frequency) == num_causal

assert max(genetic_result.allele_frequency < 1) and min(
assert max(genetic_result.allele_frequency <= 1) and min(
genetic_result.allele_frequency > 0
)

Expand Down
50 changes: 30 additions & 20 deletions tstrait/__init__.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,43 @@
from tstrait.simulate_effect_size import sim_trait
from tstrait.simulate_effect_size import TraitSimulator
from tstrait.simulate_phenotype import GenotypeResult
from tstrait.simulate_phenotype import PhenotypeResult
from tstrait.simulate_phenotype import PhenotypeSimulator
from tstrait.simulate_phenotype import Result
from tstrait.simulate_phenotype import sim_phenotype
from tstrait.trait_model import trait_model
from tstrait.trait_model import TraitModel
from tstrait.trait_model import TraitModelExponential
from tstrait.trait_model import TraitModelFixed
from tstrait.trait_model import TraitModelGamma
from tstrait.trait_model import TraitModelMultivariateNormal
from tstrait.trait_model import TraitModelNormal
from tstrait.trait_model import TraitModelT
"""
tstrait
=======
tstrait is a quantitative trait simulator of a tree sequence data.
See https://tskit.dev/ for complete documentation.
"""
from .provenance import __version__ # NOQA
from .simulate_effect_size import sim_trait
from .simulate_effect_size import TraitSimulator
from .simulate_phenotype import GenotypeResult
from .simulate_phenotype import PhenotypeResult
from .simulate_phenotype import PhenotypeSimulator
from .simulate_phenotype import Result
from .simulate_phenotype import sim_phenotype
from .trait_model import trait_model
from .trait_model import TraitModel
from .trait_model import TraitModelExponential
from .trait_model import TraitModelFixed
from .trait_model import TraitModelGamma
from .trait_model import TraitModelMultivariateNormal
from .trait_model import TraitModelNormal
from .trait_model import TraitModelT

__all__ = [
"TraitSimulator",
"__version__",
"sim_trait",
"sim_phenotype",
"PhenotypeSimulator",
"Result",
"TraitSimulator",
"GenotypeResult",
"PhenotypeResult",
"PhenotypeSimulator",
"Result",
"sim_phenotype",
"trait_model",
"TraitModel",
"TraitModelExponential",
"TraitModelFixed",
"TraitModelGamma",
"TraitModelMultivariateNormal",
"TraitModelNormal",
"TraitModelT",
"TraitModelMultivariateNormal",
]
7 changes: 7 additions & 0 deletions tstrait/provenance.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
__version__ = "undefined"
try:
from . import _version

__version__ = _version.version
except ImportError: # pragma: nocover
pass

0 comments on commit 62b521a

Please sign in to comment.