Skip to main content

scprep

Project description

scprep logo Latest PyPi version Latest Conda version Travis CI Build Read the Docs Coverage Status Twitter GitHub stars Code style: black

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scprep-1.0.12.tar.gz (99.1 kB view details)

Uploaded Source

Built Distribution

scprep-1.0.12-py3-none-any.whl (100.3 kB view details)

Uploaded Python 3

File details

Details for the file scprep-1.0.12.tar.gz.

File metadata

  • Download URL: scprep-1.0.12.tar.gz
  • Upload date:
  • Size: 99.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for scprep-1.0.12.tar.gz
Algorithm Hash digest
SHA256 279774d67921c419fd816d1d8f0c49c009b1d6578136fd267b6b0963ad32f778
MD5 fd1d0c902a7786be0b7dba9eafa89a87
BLAKE2b-256 f7d603adafce024bee32f2a1d9dfa6c07b8a98e1a73ce307d5ec383f622a00f9

See more details on using hashes here.

File details

Details for the file scprep-1.0.12-py3-none-any.whl.

File metadata

  • Download URL: scprep-1.0.12-py3-none-any.whl
  • Upload date:
  • Size: 100.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for scprep-1.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 614274400e7444739ee45a9000dfae4c3ed61f4f1e5cda5110252658aa9642a8
MD5 e7471a6ccce4b448bb2eae6352a88df7
BLAKE2b-256 679f883779ec2aadef51559f8a1ee039a6f5af3b5c12d1144d0890b241b7085e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page