# 💻 **spatools**
## 🚧 Under construction! Not ready for use yet! Currently experimenting and planning! 🚧
## Developed by Pedro Videira Pinho from National Institute of Câncer (Brazil) (c) 2024
spatools is a Python package developed to facilitate and accelerate the analysis of spatial transcriptomics data. This package was created as part of a Scientific Initiation project at the National Cancer Institute (Brazil), focusing on practical tools for preprocessing, analysis, and visualization of spatial data in transcriptomics experiments. It provides an intuitive interface for spatial data manipulation and multiple visualization functions to assist researchers in studying gene expression patterns across different samples.
## 🧬 Github
The github link: [spatools](https://github.com/pedrovp161/pack_v3.git)
## 🧬 Features
The **`spatools`** package is divided into four main modules, each with a specific purpose:
- **`read`** (📂 **input/output**): Functions for reading and saving spatial data files.
- **`pp`** (🧹 **preprocessing**): Functions for data preprocessing before analysis.
- **`tl`** (🛠️ **tools**): Tools for data manipulation and processing the output of pp, including spatial data integration and cluster operations, as well as image analisys.
- **`pl`** (📊 **plotting**): Functions for data visualization, such as cluster plots, spatial images, and cluster quality plots.
- **`constants`** (🎨 **configuration**): Color definitions and parameters used across various functions in the package.
## Package Structure
The package is organized so that methods can be accessed directly from the main spatools namespace (aliased as st). For example:
- **`Plotting`** (**pl**): st.pl.plot_bar(...)
- **`Tools`** (**tl**): st.tl.process_image(...), st.tl.merge_clusters(...)
## Installation
You can install **`spatools`** directly from [pip](https://pypi.org/):
``` bash
pip install spatools
```
## **Usage**
Here’s a simple example of how to use the package to load data, process it, and generate some visualizations:
## Load data and save
``` python
from spatools.read import Reading, save_spatial_files
import spatools as st
import os
# definindo diretório e output
DIR = os.path.dirname(__file__)
read = Reading(DIR)
adatas_dir = read.list_dict_with_data_free()
print(adatas_dir)
save_spatial_files(adatas_dir=adatas_dir, output_dir=r"D:\path\to\directory\output")
```
## preprocess data and save
```python
from spatools.read import Reading, save_spatial_files
import spatools as st
from copy import deepcopy
import random
import os
DIR = os.path.dirname(__file__)
read = Reading(DIR)
adatas_dir = read.list_dict_with_data_h5ad()
print(adatas_dir)
adatas_dir_raw = deepcopy(adatas_dir)
print(adatas_dir_raw)
random.seed(42)
st.pp.preprocessar(adatas_dir=adatas_dir, save_files=True, output_dir=r'D:\path\to\your\directory\of\output')
# Check summary of data before and after preprocessing
spots_raw, genes_raw = st.pp.check_summary(dicionario=adatas_dir_raw)
print(f"Número de celulas antes {spots_raw}, numero de genes antes {genes_raw}")
spots, genes = st.pp.check_summary(dicionario=adatas_dir)
print(f"Número de celulas depois {spots}, numero de genes depois {genes}")
print(1-spots/spots_raw)
```
...
## Licence
This package is licensed under the [MIT License](https://www.mit.edu/~amini/LICENSE.md).
Raw data
{
"_id": null,
"home_page": null,
"name": "spatools",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "python, Spatial transcriptomics, Spatial, transcriptomics, Image analysis, Multiple spatial, Image spatial transcriptomics, series analyses of spatial transcriptomics data, Bioinformatics",
"author": "Pedro Videira Pinho",
"author_email": "pedrovp161@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/62/97/9368ee3bc17f56c98ad8aa619cf78bdaf167f5b8b99d9d5678053e956de8/spatools-0.0.4.tar.gz",
"platform": null,
"description": "# \ud83d\udcbb **spatools**\r\n\r\n## \ud83d\udea7 Under construction! Not ready for use yet! Currently experimenting and planning! \ud83d\udea7\r\n\r\n## Developed by Pedro Videira Pinho from National Institute of C\u00e2ncer (Brazil) (c) 2024\r\nspatools is a Python package developed to facilitate and accelerate the analysis of spatial transcriptomics data. This package was created as part of a Scientific Initiation project at the National Cancer Institute (Brazil), focusing on practical tools for preprocessing, analysis, and visualization of spatial data in transcriptomics experiments. It provides an intuitive interface for spatial data manipulation and multiple visualization functions to assist researchers in studying gene expression patterns across different samples.\r\n\r\n## \ud83e\uddec Github\r\nThe github link: [spatools](https://github.com/pedrovp161/pack_v3.git)\r\n## \ud83e\uddec Features\r\nThe **`spatools`** package is divided into four main modules, each with a specific purpose:\r\n\r\n- **`read`** (\ud83d\udcc2 **input/output**): Functions for reading and saving spatial data files.\r\n- **`pp`** (\ud83e\uddf9 **preprocessing**): Functions for data preprocessing before analysis.\r\n- **`tl`** (\ud83d\udee0\ufe0f **tools**): Tools for data manipulation and processing the output of pp, including spatial data integration and cluster operations, as well as image analisys.\r\n- **`pl`** (\ud83d\udcca **plotting**): Functions for data visualization, such as cluster plots, spatial images, and cluster quality plots.\r\n- **`constants`** (\ud83c\udfa8 **configuration**): Color definitions and parameters used across various functions in the package.\r\n\r\n## Package Structure\r\nThe package is organized so that methods can be accessed directly from the main spatools namespace (aliased as st). For example:\r\n- **`Plotting`** (**pl**): st.pl.plot_bar(...)\r\n- **`Tools`** (**tl**): st.tl.process_image(...), st.tl.merge_clusters(...)\r\n\r\n## Installation\r\nYou can install **`spatools`** directly from [pip](https://pypi.org/):\r\n``` bash\r\npip install spatools\r\n```\r\n\r\n## **Usage**\r\nHere\u2019s a simple example of how to use the package to load data, process it, and generate some visualizations:\r\n\r\n## Load data and save\r\n``` python\r\nfrom spatools.read import Reading, save_spatial_files\r\nimport spatools as st\r\nimport os\r\n\r\n# definindo diret\u00f3rio e output\r\nDIR = os.path.dirname(__file__)\r\n\r\nread = Reading(DIR)\r\n\r\nadatas_dir = read.list_dict_with_data_free()\r\nprint(adatas_dir)\r\n\r\nsave_spatial_files(adatas_dir=adatas_dir, output_dir=r\"D:\\path\\to\\directory\\output\")\r\n\r\n\r\n```\r\n\r\n## preprocess data and save\r\n\r\n```python\r\nfrom spatools.read import Reading, save_spatial_files\r\nimport spatools as st\r\nfrom copy import deepcopy\r\nimport random\r\nimport os\r\n\r\nDIR = os.path.dirname(__file__)\r\nread = Reading(DIR)\r\n\r\nadatas_dir = read.list_dict_with_data_h5ad()\r\nprint(adatas_dir)\r\n\r\nadatas_dir_raw = deepcopy(adatas_dir)\r\nprint(adatas_dir_raw)\r\n\r\nrandom.seed(42)\r\n\r\nst.pp.preprocessar(adatas_dir=adatas_dir, save_files=True, output_dir=r'D:\\path\\to\\your\\directory\\of\\output')\r\n\r\n# Check summary of data before and after preprocessing\r\nspots_raw, genes_raw = st.pp.check_summary(dicionario=adatas_dir_raw)\r\nprint(f\"N\u00famero de celulas antes {spots_raw}, numero de genes antes {genes_raw}\")\r\n\r\nspots, genes = st.pp.check_summary(dicionario=adatas_dir)\r\nprint(f\"N\u00famero de celulas depois {spots}, numero de genes depois {genes}\")\r\nprint(1-spots/spots_raw)\r\n```\r\n\r\n...\r\n\r\n## Licence\r\nThis package is licensed under the [MIT License](https://www.mit.edu/~amini/LICENSE.md).\r\n\r\n",
"bugtrack_url": null,
"license": null,
"summary": "This comprehensive toolkit enables the analysis of multiple spatial transcriptomics datasets, offering a wide range of analytical capabilities. It supports various types of analyses, including detailed plotting and advanced image analysis, to help you gain deeper insights into your spatial transcriptomics data.",
"version": "0.0.4",
"project_urls": null,
"split_keywords": [
"python",
" spatial transcriptomics",
" spatial",
" transcriptomics",
" image analysis",
" multiple spatial",
" image spatial transcriptomics",
" series analyses of spatial transcriptomics data",
" bioinformatics"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "62979368ee3bc17f56c98ad8aa619cf78bdaf167f5b8b99d9d5678053e956de8",
"md5": "794d9f00a76fd081c4034b9f29716a9c",
"sha256": "5415adf37852869feeadddcf04d8a3bd6d7f67b857c49abe2017d1ad6894f081"
},
"downloads": -1,
"filename": "spatools-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "794d9f00a76fd081c4034b9f29716a9c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 23151,
"upload_time": "2025-01-05T04:09:08",
"upload_time_iso_8601": "2025-01-05T04:09:08.061418Z",
"url": "https://files.pythonhosted.org/packages/62/97/9368ee3bc17f56c98ad8aa619cf78bdaf167f5b8b99d9d5678053e956de8/spatools-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-05 04:09:08",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "spatools"
}