scprep
Project description
scprep provides an all-in-one framework for loading, preprocessing, and plotting matrices in Python, with a focus on single-cell genomics.
The philosophy of scprep:
Data shouldn’t be hidden in a complex and bespoke class object. scprep works with numpy arrays, pandas data frames, and scipy sparse matrices, all of which are popular data formats in Python and accepted as input to most common algorithms.
Your analysis pipeline shouldn’t have to change based on data format. Changing from a numpy array to a pandas data frame introduces endless technical differences (e.g. in indexing matrices). scprep provides data-agnostic methods that work the same way on all formats.
Simple analysis should mean simple code. scprep takes care of annoying edge cases and sets nice defaults so you don’t have to.
Using a framework shouldn’t be limiting. Because nothing is hidden from you, you have access to the power of numpy, scipy, pandas and matplotlib just as you would if you used them directly.
Installation
preprocessing is available on pip. Install by running the following in a terminal:
pip install --user scprep
Alternatively, scprep can be installed using Conda (most easily obtained via the Miniconda Python distribution):
conda install -c bioconda scprep
Quick Start
You can use scprep with your single cell data as follows:
import scprep # Load data data_path = "~/mydata/my_10X_data" data = scprep.io.load_10X(data_path) # Remove empty columns and rows data = scprep.filter.remove_empty_cells(data) data = scprep.filter.remove_empty_genes(data) # Filter by library size to remove background scprep.plot.plot_library_size(data, cutoff=500) data = scprep.filter.filter_library_size(data, cutoff=500) # Filter by mitochondrial expression to remove dead cells mt_genes = scprep.select.get_gene_set(data, starts_with="MT") scprep.plot.plot_gene_set_expression(data, genes=mt_genes, percentile=90) data = scprep.filter.filter_gene_set_expression(data, genes=mt_genes, percentile=90) # Library size normalize data = scprep.normalize.library_size_normalize(data) # Square root transform data = scprep.transform.sqrt(data)
Examples
Help
If you have any questions or require assistance using scprep, please read the documentation at https://scprep.readthedocs.io/ or contact us at https://krishnaswamylab.org/get-help
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 scprep-1.2.0.tar.gz
.
File metadata
- Download URL: scprep-1.2.0.tar.gz
- Upload date:
- Size: 105.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46ef48e08e95fc234e2df1b2d9a79dbea41b82a67da0a7052a110a769d2f18c2 |
|
MD5 | 9fb8200f562ff50b49608be2f42ee6e1 |
|
BLAKE2b-256 | 34be174f2605d90134c1e932d908ae6e88798c9a628b17dfad265a4f025f0a54 |
File details
Details for the file scprep-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: scprep-1.2.0-py3-none-any.whl
- Upload date:
- Size: 93.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6763b00c819e0e793dad0ac8d3b69cac0f8353cc4ae7282463041e58f0c8b94f |
|
MD5 | 2869a8424ef5d0e65af7152e87bc0393 |
|
BLAKE2b-256 | 76c4ca11391341e30292cd1f79c29ff3e6908a3ea4c03cb4bb73d20fa0e507b3 |