VoyagerPy
This repo manages the VoyagerPy Python package, a Python implementation of the R package Voyager
Installation
To install the latest release of VoyagerPy, you can install it via pip:
pip install voyagerpy
Clone the repo
Clone this repo either using SSH:
git clone git@github.com:pmelsted/voyagerpy.git
or HTTPS:
git clone https://github.com/pmelsted/voyagerpy.git.
To get the bleeding edge version, change your branch to dev by running
git checkout dev
once inside the voyagerpy directory.
Install using pip
To install VoyagerPy, run
pip install .
Some users may experince problems with installing GeoPandas, which VoyagerPy depends on. We refer to the GeoPandas installation page if this is the case.
Structure of VoyagerPy
VoyagerPy uses AnnData as its internal datastructure. An AnnData object, adata, holds the following attributes:
-
adata.X: the main data matrix of size $N_{obs} \times N_{vars}$. It holds the count data for each observation and feature (e.g. barcodes x genes), which may have gone under some transformation. Data type may be ascipy.sparse.csr_matrix,numpy.ndarray, ornumpy.matrix. This is yet to be set in stone. -
adata.layers: A dictionary-like data structure with the values being matrices of the same shape asadata.X. These can hold transformations ofadata.X, such as log-normalized counts. -
adata.obs: Apandas.DataFrameobject where the rows represent the barcodes, and the columns are features of the barcodes. -
adata.obsp: This is a dictionary-based object, where each value is apandas.DataFrameof size $N_{obs}\times N_{obs}$, representing a pairwise metric on the observation. For instance,adata.obsp["distances"]can hold the pairwise distances between the positions of origin for the barcodes. This can be handy to store graphs over the barcodes. -
adata.obsm: This is a dictionary-based object where each value is apandas.DataFrameorgeopandas.GeoDataFrame. The number of rows in these data frames must be $N_{obs}$. Example of data frames to be stored here:geometry: ageopandas.GeoDataFramewhere each column is ofgeopandas.GeoSeriesorpandas.Series, used for plotting spatial objects, such as points or polygons. To use GeoPandas for plotting a column, it must be ageopandas.GeoSeries. These will represent the geometries of the barcodes.local_*: apandas.DataFramewhich contains spatial results over features inobs. These can be e.g. local Moran's I, local spatial heteroscedasticity (LOSH) over some featuresx, y, z. The columns oflocal_moranandlocal_loshwould then bex, y, z.
-
adata.var: Apandas.DataFrameobject where the rows represent the features from the columns ofX(e.g. genes), and the columns are features of the genes (or whatever the columns ofXrepresent). -
adata.varp,adata.varm: These are not used for the time being, but these objects can be used similarly toadata.obspandadata.obsmbut for feature (gene) data. -
adata.uns: This is a dictionary containing data that cannot be stored in the above objects:config: These can contain config or metadata about this object. By using VoyagerPy to read the scRNA-seq data, this dictionary has the following items by default:"var_names": "gene_ids", meaning that the index of the variables (genes) are the standardized ENSG gene IDs."secondary_var_names": "symbol", meaning that the column"symbol"inadata.varcontains the symbol names for the genes.
spatial: This dictionary contains various spatial data, including:img: a dictionary with key-values as resolution-imagescale: a dictionary describing the scales of the images.transform: metadata that describes the transforms applied to the images (rotation, mirror) such that the originals can be recovered.local_results: This is a dictionary which can contain Monte-Carlo simulations of spatial autocorrelation statistics, such as for local Moran statistics.
Release files for voyagerpy 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| voyagerpy-0.1.1.tar.gz | 60.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| voyagerpy-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 125.1 kB
Release files / voyagerpy-0.1.1.tar.gz
| Download URL | voyagerpy-0.1.1.tar.gz |
|---|---|
| Size | 60.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a6fce4c19d1c8520820464aa5a8d40e82ed7fabad240988f7bfd9c26f7199dce
|
|
BLAKE2b-256 checksum How to use checksums |
f7e8b0453e7aabffca9bc77e8a027c7f2268b716b3f736af7c3c9e37c0dd1999
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.9.16 Darwin/22.5.0
|
Release files / voyagerpy-0.1.1-py3-none-any.whl
| Download URL | voyagerpy-0.1.1-py3-none-any.whl |
|---|---|
| Size | 64.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
400dda5b42e9a8fb3003b107de5e6e71d11e8829381f9240707b8df369b6244c
|
|
BLAKE2b-256 checksum How to use checksums |
d98623d207b5ea5143e32c965a5bec2dcc3439332a329a6a893d52eb94409b91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.9.16 Darwin/22.5.0
|