# spaceprime
[](https://pypi.python.org/pypi/spaceprime)
[](https://anaconda.org/conda-forge/spaceprime)
- Free software: MIT License
- Documentation: https://connor-french.github.io/spaceprime
## *Overview*
*spaceprime* is a Python package that facilitates the creation and analysis of spatially gridded coalescent models in the [msprime](https://tskit.dev/msprime/docs/stable/intro.html#) library. The package is designed to make it easier for practitioners to convert spatial maps of habitat suitability into extensible two-dimensional stepping-stone models of gene flow, where each pixel of the map represents a deme and demes are able to migrate with their neighbors. Demes and migration rates are able to change over time according to habitat suitability model projections. These demographic parameters are then used to simulate genetic data under a coalescent model with *msprime* as the simulator, which can be used to infer the demographic history of the population. The package is designed to be user-friendly and intuitive, allowing users to easily simulate and analyze spatially explicit genetic data.
This page provides an overview of the package and its main features. For more detailed information, please refer to the [documentation](https://connor-french.github.io/spaceprime).
**Note for R users**: *spaceprime* is coded in Python, yet many interested users may come from an R background. I have a [*spaceprime* for R users](spaceprime-for-r-users.qmd) vignette that provides a brief introduction to the Python concepts necessary to use *spaceprime* in a practical walk-through of an example analysis. Additionally, it is possible to use Python code in R using the *reticulate* package. For more information on how to use Python code in R, see the [reticulate documentation](https://rstudio.github.io/reticulate/).
## Main features
*spaceprime* includes a number of features:
- **Convert habitat suitability values into demographic parameters**, including deme sizes, migration rates, and their change through time using **very little code**. Code complexity does not increase with model complexity, allowing users to focus on the biological questions they are interested in.
- Simulate spatially explicit genetic data under a coalescent model with *msprime*. The modeling approach is **fully coalescent** with no forward-time component, allowing for **computationally efficient simulations** of large spatially explicit models.
- Visualize demographic models to facilitate model interpretation and model checking.
- Compute genetic summary statistics for simulated and empirical data to facilitate comparison with empirical data.
- Extensibility: *spaceprime* is designed to be interoperable with *msprime*, where users can setup a model with *spaceprime*, then customize it using the full range of *msprime* functionality.
## Installation
### Stable release
*spaceprime* can be installed using `pip` or `conda`. Due to the package's reliance on `msprime`, the `pip` installation is only available on unix-based systems (MacOS, Linux). Windows users should install *spaceprime* using `conda`.
To install *spaceprime* using `pip`, run the following command in your terminal:
```bash
pip install spaceprime
```
To install *spaceprime* using `conda`, run the following command in your terminal:
```bash
conda install -c conda-forge spaceprime
```
The `mamba` package manager can also be used to install *spaceprime* using `conda`. `mamba` tends to be much faster than conda. To install *spaceprime* using `mamba`, install `mamba`, then run the following command in your terminal:
```bash
mamba install -c conda-forge spaceprime
```
### From source
To install spaceprime from source, run this command in your terminal:
```
pip install git+https://github.com/connor-french/spaceprime
```
Raw data
{
"_id": null,
"home_page": null,
"name": "spaceprime",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "spaceprime",
"author": null,
"author_email": "Connor French <french.connor.m@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/93/34/74aa3e66c2e68709eb9a0bab11fda353150980477bfbccc657eb8b2f3cc6/spaceprime-0.0.5.tar.gz",
"platform": null,
"description": "# spaceprime\n\n\n[](https://pypi.python.org/pypi/spaceprime)\n[](https://anaconda.org/conda-forge/spaceprime)\n\n\n\n\n- Free software: MIT License\n- Documentation: https://connor-french.github.io/spaceprime\n \n\n## *Overview*\n*spaceprime* is a Python package that facilitates the creation and analysis of spatially gridded coalescent models in the [msprime](https://tskit.dev/msprime/docs/stable/intro.html#) library. The package is designed to make it easier for practitioners to convert spatial maps of habitat suitability into extensible two-dimensional stepping-stone models of gene flow, where each pixel of the map represents a deme and demes are able to migrate with their neighbors. Demes and migration rates are able to change over time according to habitat suitability model projections. These demographic parameters are then used to simulate genetic data under a coalescent model with *msprime* as the simulator, which can be used to infer the demographic history of the population. The package is designed to be user-friendly and intuitive, allowing users to easily simulate and analyze spatially explicit genetic data. \n\nThis page provides an overview of the package and its main features. For more detailed information, please refer to the [documentation](https://connor-french.github.io/spaceprime). \n\n**Note for R users**: *spaceprime* is coded in Python, yet many interested users may come from an R background. I have a [*spaceprime* for R users](spaceprime-for-r-users.qmd) vignette that provides a brief introduction to the Python concepts necessary to use *spaceprime* in a practical walk-through of an example analysis. Additionally, it is possible to use Python code in R using the *reticulate* package. For more information on how to use Python code in R, see the [reticulate documentation](https://rstudio.github.io/reticulate/).\n\n## Main features\n*spaceprime* includes a number of features:\n- **Convert habitat suitability values into demographic parameters**, including deme sizes, migration rates, and their change through time using **very little code**. Code complexity does not increase with model complexity, allowing users to focus on the biological questions they are interested in.\n- Simulate spatially explicit genetic data under a coalescent model with *msprime*. The modeling approach is **fully coalescent** with no forward-time component, allowing for **computationally efficient simulations** of large spatially explicit models. \n- Visualize demographic models to facilitate model interpretation and model checking.\n- Compute genetic summary statistics for simulated and empirical data to facilitate comparison with empirical data. \n- Extensibility: *spaceprime* is designed to be interoperable with *msprime*, where users can setup a model with *spaceprime*, then customize it using the full range of *msprime* functionality. \n\n## Installation\n\n### Stable release\n\n*spaceprime* can be installed using `pip` or `conda`. Due to the package's reliance on `msprime`, the `pip` installation is only available on unix-based systems (MacOS, Linux). Windows users should install *spaceprime* using `conda`.\n\nTo install *spaceprime* using `pip`, run the following command in your terminal:\n\n```bash\npip install spaceprime\n```\n\nTo install *spaceprime* using `conda`, run the following command in your terminal:\n\n```bash\nconda install -c conda-forge spaceprime\n```\n\nThe `mamba` package manager can also be used to install *spaceprime* using `conda`. `mamba` tends to be much faster than conda. To install *spaceprime* using `mamba`, install `mamba`, then run the following command in your terminal:\n\n```bash\nmamba install -c conda-forge spaceprime\n```\n\n### From source\n\nTo install spaceprime from source, run this command in your terminal:\n\n```\npip install git+https://github.com/connor-french/spaceprime\n```\n\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "A python package to facilitate spatially explicit coalescent modeling in msprime",
"version": "0.0.5",
"project_urls": {
"Homepage": "https://github.com/connor-french/spaceprime"
},
"split_keywords": [
"spaceprime"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f7edff87d322e5939f5a35aae6d8261e076d09fc8559da4038cc413b401b1172",
"md5": "2ebaaf76c57cf093c050a71e2bc925f7",
"sha256": "fdf0a792f79ec36fe1aea52e609a5eb4d04592f02e144be4cd8cf8e0f5eed2f4"
},
"downloads": -1,
"filename": "spaceprime-0.0.5-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "2ebaaf76c57cf093c050a71e2bc925f7",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.8",
"size": 222782,
"upload_time": "2024-08-13T16:48:27",
"upload_time_iso_8601": "2024-08-13T16:48:27.748685Z",
"url": "https://files.pythonhosted.org/packages/f7/ed/ff87d322e5939f5a35aae6d8261e076d09fc8559da4038cc413b401b1172/spaceprime-0.0.5-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "933474aa3e66c2e68709eb9a0bab11fda353150980477bfbccc657eb8b2f3cc6",
"md5": "0981f0724954f2f4a3eff9cb86ba9870",
"sha256": "374697cb4e15a70aac1d83926bf699647077cb735a93249af71f914720e600a6"
},
"downloads": -1,
"filename": "spaceprime-0.0.5.tar.gz",
"has_sig": false,
"md5_digest": "0981f0724954f2f4a3eff9cb86ba9870",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 1727721,
"upload_time": "2024-08-13T16:48:29",
"upload_time_iso_8601": "2024-08-13T16:48:29.522073Z",
"url": "https://files.pythonhosted.org/packages/93/34/74aa3e66c2e68709eb9a0bab11fda353150980477bfbccc657eb8b2f3cc6/spaceprime-0.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-13 16:48:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "connor-french",
"github_project": "spaceprime",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "numpy",
"specs": [
[
"<",
"2"
]
]
},
{
"name": "typing",
"specs": []
},
{
"name": "msprime",
"specs": []
},
{
"name": "rasterio",
"specs": [
[
">=",
"1.0.0"
]
]
},
{
"name": "scipy",
"specs": []
},
{
"name": "shapely",
"specs": []
},
{
"name": "geopandas",
"specs": []
},
{
"name": "scikit-allel",
"specs": []
},
{
"name": "contextily",
"specs": []
},
{
"name": "matplotlib",
"specs": []
},
{
"name": "folium",
"specs": []
},
{
"name": "mapclassify",
"specs": []
},
{
"name": "esda",
"specs": [
[
">=",
"2.5.1"
]
]
},
{
"name": "libpysal",
"specs": [
[
">=",
"4.10"
]
]
},
{
"name": "scikit-learn",
"specs": []
},
{
"name": "pandas",
"specs": []
}
],
"lcname": "spaceprime"
}