Skip to main content

No project description provided

Project description

💻 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

🧬 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:

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

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

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)

correlation tutorial ...

Licence

This package is licensed under the MIT License.

... DOI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spatools-0.2.tar.gz (42.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spatools-0.2.0-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

Details for the file spatools-0.2.tar.gz.

File metadata

  • Download URL: spatools-0.2.tar.gz
  • Upload date:
  • Size: 42.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for spatools-0.2.tar.gz
Algorithm Hash digest
SHA256 c72d4a0247e496430fd8e3e8177499102f37fc5ae966037492d1355dc0f6596f
MD5 8dd68c406eb93eec83f12b87b963972a
BLAKE2b-256 c285cf58999d41a2924c0ff4c7b9dd77988f958389dcafd73009cee5b1273202

See more details on using hashes here.

File details

Details for the file spatools-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: spatools-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 43.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for spatools-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd9a7f436faafdabf75d2856d56d7daf4b72f1d1f796b8cd7ffcd7153738f98c
MD5 eed33939769ddb694a36ca8df8c94c51
BLAKE2b-256 efaae0ecdb3fbd603eb5ec2fb771bc669ddc37a7fa5286badd7b3c74d8a9d0fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page