Skip to main content

spatial-utils

a collection of utilities to support analysis with squidpy.

installation

easy installation

You can use our environment.yaml file to create an anaconda environment with spatial-utils, squidpy, and all other dependencies. To do so, first download the environment.yaml file from this repo. Then, open a terminal, navigate to the directory you have downloaded the environment.yaml file to and run the following command

conda env create -f environment.yaml

This creates an environment called spatial-analysis. If you would like to use the environment, you can activate the environment with the following:

conda activate spatial-analysis

development installation

Create an environment for working on your squidpy projects. If you are using anaconda, you can enter the following in your terminal:

conda create -n squidpy python=3.8

Activate your newly created squidpy environment. For anaconda you can enter:

conda activate squidpy

Navigate to the directory you would like to download the squidpy-utils to. For example, if you want to clone the repository to your Documents folder, you would enter:

cd ~/Documents

Clone the squidpy-utils repository

git clone https://github.com/kevinyamauchi/spatial-utils.git

Navigate to the spatial-utils directory

cd spatial-utils

Install spatial-utiils. If you would like to be able to add/edit functionality, install in editable mode:

pip install -e .

Otherwise, perform a standard installation:

pip install .

Usage

Loading a visium dataset

You can load a dataset that was processed with Kallisto into an AnnData object using the load_visium_kallisto function:

from spatial_utils import load_visium_kallisto

adata = load_visium_kallisto(
    counts_table,
    gene_names,
    barcodes,
    tissue_positions_list,
    scale_factors,
    hires_im,
    lowres_im,
    library_id,
    chemistry_name
)

The input arguments are explained below. To see an example of the function being used, please see the notebook at /examples/load_visium_from_kallisto.ipynb

Parameters
----------
counts_table : str
        The path to the counts table output from Kallisto.
        This file usually has the extension ".mtx".
gene_names : str
    The path to the file containing the gene names for the
    Kallisto counts table. This file usually ends with "genes.txt".
barcodes : str
    The path to the file containing the spot barcodes for the
    Kallisto counts table. This file usually ends with "barcodes.txt".
tissue_positions_list : str
    The path to the file containing the coordinates of each barcode
    that is output from the 10X space ranger pipeline.
    This file is usually called: "tissue_positions_list.csv".
scale_factors : str
    The path to the file output by the 10X space ranger pipeline
    containing the scale factors that map the hires and
    lowres image to the original image.
    This file is usually called: "scalefactors_json.json"
hires_im : str
    The path to the hires image that is output from the
    10X space ranger pipeline.
    This file is usually called: tissue_hires_image.png
lowres_im : str
    The path to the lowres image that is output from the
    10X space ranger pipeline.
    This file is usually called: tissue_lowres_image.png
library_id  : str
    The unique identifier for the library that was sequenced.
chemistry_name : str
    The name of the chemistry used to create the library.
    The default value is: "Spatial 3' v1"

Metadata

Release files for spatial-utils 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spatial-utils 0.0.1
File Size Uploaded Provenance
spatial_utils-0.0.1.tar.gz 1.7 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for spatial-utils 0.0.1
File Interpreter ABI Platform
spatial_utils-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 1.7 MB

Release files / spatial_utils-0.0.1.tar.gz

Download URL spatial_utils-0.0.1.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
ae14b96bb39d9629061a8bd696b5ef1cebf96b5aa2b99688a6e3162f423c83bf
BLAKE2b-256 checksum
How to use checksums
0bf29d688680c6f6db6264a4d0a15c56ec7c1111207a5c7fb8b30f8e4fae34d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release files / spatial_utils-0.0.1-py3-none-any.whl

Download URL spatial_utils-0.0.1-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8542e2188c655e4875e18bb6ee7e51cfc6723e76bcce722dcf7e8a6ef73b885f
BLAKE2b-256 checksum
How to use checksums
7542669e800ccb4e92f6ecaf52042bc072aa041a70f07f114f8ae13d55f86ccc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Security for spatial-utils 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page