a collection of utilities for spatial-omics analysis
Project description
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"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file spatial_utils-0.0.1.tar.gz
.
File metadata
- Download URL: spatial_utils-0.0.1.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae14b96bb39d9629061a8bd696b5ef1cebf96b5aa2b99688a6e3162f423c83bf |
|
MD5 | de6e8fedf9350b323ed28be9d8eca620 |
|
BLAKE2b-256 | 0bf29d688680c6f6db6264a4d0a15c56ec7c1111207a5c7fb8b30f8e4fae34d3 |
File details
Details for the file spatial_utils-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: spatial_utils-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8542e2188c655e4875e18bb6ee7e51cfc6723e76bcce722dcf7e8a6ef73b885f |
|
MD5 | 33ccfe4052964634f65acd8196451ff2 |
|
BLAKE2b-256 | 7542669e800ccb4e92f6ecaf52042bc072aa041a70f07f114f8ae13d55f86ccc |