Analyze multi-modal single-cell data!
Project description
scran, in Python
Overview
The scranpy package provides Python bindings to the single-cell analysis methods in libscran and related C++ libraries. It performs the standard steps in a typical single-cell analysis including quality control, normalization, feature selection, dimensionality reduction, clustering and marker detection. scranpy makes heavy use of the BiocPy data structures in its user interface, while it uses the mattress package to provide a C++ representation of the underlying matrix data. This package is effectively a mirror of its counterparts in Javascript (scran.js) and R (scran.chan), which are based on the same underlying C++ libraries and concepts.
Quick start
🚧🚧🚧 Under construction 🚧🚧🚧
Currently, it's anything but quick... at least it runs. More to come soon.
# TODO: streamline the loader:
path = "pbmc4k-tenx.h5"
import h5py as h5
fhandle = h5.File(path)
import scipy.sparse as sp
mat = sp.csc_matrix(
(fhandle["matrix"]["data"], fhandle["matrix"]["indices"], fhandle["matrix"]["indptr"]),
fhandle["matrix"]["shape"]
)
features = [x.decode("ascii") for x in fhandle["matrix"]["features"]["name"]]
import scranpy
results = scranpy.analyze(mat, features)
Developer Notes
Steps to setup dependencies -
-
initialize git submodules in
extern/libscran
. -
run
cmake .
inside theextern/knncolle
to download the annoy library. a future version of this will use a cmake to setup the extern directory.
First one needs to build the extern library, this would generate a shared object file to src/scranpy/core-[*].so
python setup.py build_ext --inplace
For typical development workflows, run this for tests
python setup.py build_ext --inplace && tox
To rebuild the ctypes bindings with the wrap.py
helper
wrap.py src/scranpy/lib --py src/scranpy/cpphelpers.py --cpp src/scranpy/lib/bindings.cpp
Note
This project has been set up using PyScaffold 4.5. For details and usage information on PyScaffold see https://pyscaffold.org/.
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 Distributions
Hashes for scranpy-0.0.4-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8de62a52857f2dce8b43371e52ac8b9f8236c0c2c8e9129a056ea29de177b410 |
|
MD5 | 6416d1a8d3cd4c4f8794bdf6e84562a4 |
|
BLAKE2b-256 | 3d196ad0e5595560ed869ea85f233bf29b546f9e85fd4eb0be83fad6cf2fe306 |
Hashes for scranpy-0.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4581173ee9da4f51ef98a452b8e599df3f4497843d1b6412ec2d65b4ace791a5 |
|
MD5 | 4eca33d7b68bbb13f6c3bdd4c13e66c4 |
|
BLAKE2b-256 | 2c0d8d7e764bc349bcdb45e5d92d8c9eb96fff9963219a6a1a4798ee2ae3db3b |
Hashes for scranpy-0.0.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4705db0aad58154b7ee0c467bc63b920a0f9c53833dbe3ed8312d6c8c56adc81 |
|
MD5 | 2e1fca4a84352f2c30933e46cba59336 |
|
BLAKE2b-256 | 5f1893c4d80965946243743cb229a89811b2cf36fb5cf7c6538e704c260c5583 |
Hashes for scranpy-0.0.4-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2760f28a04b11f9a405eca99101bba16230600691c7d1cd15363277ea84b592d |
|
MD5 | 9edba264c54cd8fa09067456b6587c1a |
|
BLAKE2b-256 | 1ebb9970249d4687933ed9bf8742af252b0fb9b9c1b72371b5275ae2aa05004a |
Hashes for scranpy-0.0.4-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e730855a93987d8d03138e54ccc7be4dc47c018cd81809ccf9a0d3c0587f9e01 |
|
MD5 | e24fb63f894a88ca5257a24c91f69807 |
|
BLAKE2b-256 | 318ac76735a0f635c33105d9ff3bcd56435a177aabfdfdf89391cc5e0a31afaa |
Hashes for scranpy-0.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecfb7e9057bfb9bfea0a50a7b8ae84167603eb6deda86929ee5d26a5aea35d9d |
|
MD5 | 046bdf536b1ce9ae7c54fff3f4790187 |
|
BLAKE2b-256 | 377337735f21f52fa7c8c4dae536e57807700095d14c1c16683295c2c41d4d73 |
Hashes for scranpy-0.0.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 501a77dbf9bba7bcef9402d6f0fabe5bc8a8d7896ec4c27ea1eaef744e777915 |
|
MD5 | 7f8a22cfa3c5051a59fcc70d0cbaf026 |
|
BLAKE2b-256 | e442d5080cc58f2c522d8f7d66dc40888debcf846b05c3706bc126af39ddf6e8 |
Hashes for scranpy-0.0.4-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95121e3855330fdc87bcc290e8125c80a558970b5218e33526a1664089c1cd87 |
|
MD5 | d30ef436141ea4f8ff668153bf70447b |
|
BLAKE2b-256 | dcffe3c072f553031c3ca50f4095d027f9c3a6e657b77bc51507e7d138cbf028 |
Hashes for scranpy-0.0.4-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1493fbd710e9de632550047392173e518e7073d144f9dc252b6c31fe9f175e4 |
|
MD5 | 341ff72cac2f896e30764eed9115f586 |
|
BLAKE2b-256 | c0aaeefeff3469f0e0828a85114d2e09fadf311fd109ee3c4163f35be2ccb262 |
Hashes for scranpy-0.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a33e772af27eaf345a9906008008250fb36cde7b7f7a5aebc7a550c272d99443 |
|
MD5 | 92369ab9a777ac96c133fd81983b61bb |
|
BLAKE2b-256 | 9b3a4e97bd4883fae59a2721d061a9266d42c5a15d9c556590e9aba3c73c9c89 |
Hashes for scranpy-0.0.4-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b612e573e31aef1c334c52757224f153bd148ed0f68d9a38476896bd2191fdb |
|
MD5 | 40097e5b5d6c250034e42756ea571c6b |
|
BLAKE2b-256 | 2bdc5f100221f8f63735924146b16d48c69af7f2a46596f634a700430a807178 |
Hashes for scranpy-0.0.4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69216d135485000fe2657f723078fef93d92e1d9f6cd780c77c26533327db8ba |
|
MD5 | 4cbb5938120560745d1d4070d84cd48c |
|
BLAKE2b-256 | fde5950420e189e3a48e45ad6040fe75c6f6928fed99c2fa040e4290c872edfa |