Skip to main content

Single-cell RNA Sequencing Analysis

Project description

Metacells 0.7.0 - Single-cell RNA Sequencing Analysis

Documentation Status

The metacells package implements the improved metacell algorithm [1] for single-cell RNA sequencing (scRNA-seq) data analysis within the scipy https://www.scipy.org/ framework. The original metacell algorithm [2] was implemented in R. The python package contains various algorithmic improvements and is scalable for larger data sets (millions of cells).

Metacell Analysis

Naively, scRNA_seq data is a set of cell profiles, where for each one, for each gene, we get a count of the mRNA molecules that existed in the cell for that gene. This serves as an indicator of how “expressed” or “active” the gene is.

As in any real world technology, the raw data may suffer from technical artifacts (counting the molecules of two cells in one profile, counting the molecules from a ruptured cells, counting only the molecules from the cell nucleus, etc.). This requires pruning the raw data to exclude such artifacts.

The current technology scRNA-seq data is also very sparse (typically <<10% the RNA molecules are counted). This introduces large sampling variance on top of the original signal, which itself contains significant inherent biological noise.

Analyzing scRNA-seq data therefore requires processing the profiles in bulk. Classically, this has been done by directly clustering the cells using various methods.

In contrast, the metacell approach groups together profiles of the “same” biological state into groups of cells of the “same” biological state, with the minimal number of profiles needed for computing robust statistics (in particular, mean gene expression). Each such group is a single “metacell”.

By summing profiles of cells of the “same” state together, each metacell greatly reduces the sampling variance, and provides a more robust estimation of the transcription state. Note a metacell is not a cell type (multiple metacells may belong to the same “type”, or even have the “same” state, if the data sufficiently over-samples this state). Also, a metacell is not a parametric model of the cell state. It is merely a more robust description of some cell state.

The metacells should therefore be further analyzed as if they were cells, using additional methods to classify cell types, detect cell trajectories and/or lineage, build parametric models for cell behavior, etc. Using metacells as input for such analysis techniques should benefit both from the more robust, less noisy input; and also from the (~100-fold) reduction in the number of cells to analyze when dealing with large data (e.g. analyzing millions of individual cells).

Installation

In short: pip install metacells. Note that metacells requires many “heavy” dependencies, most notably numpy, pandas, scipy, scanpy, which pip should automatically install for you. If you are running inside a conda environment, you might prefer to use it to first install these dependencies, instead of having pip install them from PyPI.

Note that metacells only runs natively on Linux and MacOS. To run it on a Windows computer, you must activate Windows Subsystem for Linux and install metacells within it.

The metacells package contains extensions written in C++. The metacells distribution provides pre-compiled Python wheels for both Linux and MacOS, so installing it using pip should not require a C++ compilation step.

Note that for X86 CPUs, these pre-compiled wheels were built to use AVX2 (Haswell/Excavator CPUs or newer), and will not work on older CPUs which are limited to SSE. Also, these wheels will not make use of any newer instructions (such as AVX512), even if available. While these wheels may not the perfect match for the machine you are running on, they are expected to work well for most machines.

To see the native capabilities of your machine, you can grep flags /proc/cpuinfo | head -1 which will give you a long list of supported CPU features in an arbitrary order, which may include sse, avx2, avx512, etc. You can therefore simply grep avx2 /proc/cpuinfo | head -1 to test whether AVX2 is/not supported by your machine.

You can avoid installing the pre-compiled wheel by running pip install metacells --install-option='--native'. This will force pip to compile the C++ extensions locally on your machine, optimizing for its native capabilities, whatever these may be. This will take much longer but may give you faster results (note: the results will not be exactly the same as when running the precompiled wheel due to differences in floating-point rounding). Also, this requires you to have a C++ compiler which supports C++14 installed (either g++ or clang). Installing a C++ compiler depends on your specific system (using conda may make this less painful).

Vignettes

The generated documentation contains the following vignettes: Basic Metacells Vignette, Manual Analysis Vignette, and Seurat Analysis Vignette.

You can also access their very latest version in the Github repository.

References

Please cite the references appropriately in case they are used:

License (MIT)

Copyright © 2020, 2021 Weizmann Institute of Science

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

History

0.5

  • First published version.

0.6

  • More robust graph partition.

  • Allow forcing feature genes.

  • Rename “project” to “convey” to prepare for addition of atlas projection functionality.

0.7.0

  • Switch to new project template.

  • Fix some edge cases in the pipeline.

  • Switch to using psutil for detecting system resources.

  • Fix binary wheel issues.

  • Give up on using travis-ci.

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

metacells-0.7.0.tar.gz (287.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

metacells-0.7.0-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (4.1 MB view details)

Uploaded PyPymanylinux: glibc 2.12+ x86-64

metacells-0.7.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (4.5 MB view details)

Uploaded PyPymacOS 10.9+ x86-64

metacells-0.7.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (77.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.12+ x86-64

metacells-0.7.0-cp39-cp39-macosx_11_0_arm64.whl (5.2 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

metacells-0.7.0-cp39-cp39-macosx_10_9_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

metacells-0.7.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (78.0 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

metacells-0.7.0-cp38-cp38-macosx_11_0_arm64.whl (5.2 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

metacells-0.7.0-cp38-cp38-macosx_10_9_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

metacells-0.7.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (74.0 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

metacells-0.7.0-cp37-cp37m-macosx_10_9_x86_64.whl (5.2 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

File details

Details for the file metacells-0.7.0.tar.gz.

File metadata

  • Download URL: metacells-0.7.0.tar.gz
  • Upload date:
  • Size: 287.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.2.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for metacells-0.7.0.tar.gz
Algorithm Hash digest
SHA256 4e2bb7453e2148652aeff54b643637bacce634bdcdb4ae1ec0f7a5ca58fde4d4
MD5 7b1cc62055833c6439ba89a892370a14
BLAKE2b-256 6100f0520979856ab3eacae62e2f0e926f352ccf9f4c652432082654c60fb2c7

See more details on using hashes here.

File details

Details for the file metacells-0.7.0-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for metacells-0.7.0-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 c1b05802e392b72ef93e30fd50a34ca193eae7a72f0d8a338c498b7f20569c2e
MD5 7bce4a65daeed6c7a3f26c7326243fe6
BLAKE2b-256 a0d12ee73b97039f8b7a71d0fdb806ca5bc87beb28d349366c9488032aa83862

See more details on using hashes here.

File details

Details for the file metacells-0.7.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: metacells-0.7.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: PyPy, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.2.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for metacells-0.7.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e4cc2557605341249fcea3a8b97f727efdb56ae3fb6593fd393941c482718f19
MD5 76e383d5a8234eb1f5b6fa6756ead12f
BLAKE2b-256 1f8eb36276c2c7828a5fc363fb47db5f97c7c92a56ce034c0c0595ba646fd17a

See more details on using hashes here.

File details

Details for the file metacells-0.7.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for metacells-0.7.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 d4fd867d1d2681c7e453dae1f4a23932dd64f837133e8c941058e4a9bae994cc
MD5 5432d1c1e62accbe6b2f7a222d1b2c70
BLAKE2b-256 304dde534ff50a7dc9f007499be7cee7a660072b2af38afe0640a3f1b01cfba1

See more details on using hashes here.

File details

Details for the file metacells-0.7.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

  • Download URL: metacells-0.7.0-cp39-cp39-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 5.2 MB
  • Tags: CPython 3.9, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.2.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for metacells-0.7.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ac5df571ab331a0cb5d83b10860322ee6d216419846666350ee5679da7264760
MD5 00686bdecf2c92d691a1e0ad22501670
BLAKE2b-256 7486a08d8d4404a45f305291dac84810b81e873232e8e597d2059236a6671213

See more details on using hashes here.

File details

Details for the file metacells-0.7.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: metacells-0.7.0-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 5.4 MB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.2.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for metacells-0.7.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6fca461ba4af61c13de42f6a4a29bde0e68b1594b9f8e295ff9a508ccde4def1
MD5 64e35999a27386c731850d309412d6ba
BLAKE2b-256 28383d32f3a8beeb062738ff7559bdd2f0e37e43bc87cb337db83dd3a265957d

See more details on using hashes here.

File details

Details for the file metacells-0.7.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for metacells-0.7.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 4708c488208b493ba1a9b24b990c3ac37c102f742c6e1a6bc93de478b6a02993
MD5 c99b78e97da652679442432e968bab9b
BLAKE2b-256 33ea38c2a354e5a60e2f506f901594f838a923f1624c4369904b410f0c860d4e

See more details on using hashes here.

File details

Details for the file metacells-0.7.0-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

  • Download URL: metacells-0.7.0-cp38-cp38-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 5.2 MB
  • Tags: CPython 3.8, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.2.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for metacells-0.7.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 63bd11a30e452d0fc2509968cc56fde32a414251a6b5e8ced024c5e28001cdbe
MD5 9b2e5ce91c7f7c6938b14c459e52b28d
BLAKE2b-256 4a79ce9a02a1ad66ee672830b7c8c844c409fa54206d83edccdc18354bffe61a

See more details on using hashes here.

File details

Details for the file metacells-0.7.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: metacells-0.7.0-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 5.4 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.2.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for metacells-0.7.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3d144225c0b4db30113a5e4b1fbfd1db966dda8ac474e6ba0a5791d6242718a4
MD5 63284df70efadfd2fdceee7fcdfb5b12
BLAKE2b-256 454938399314e85fcd4739f6e3ff92ddacd0ddc06cae3d1e4f55812584daf402

See more details on using hashes here.

File details

Details for the file metacells-0.7.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for metacells-0.7.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 3216f1111f8f23ddaeb8a642504ae465cdd61aa09174e7212cc10478d8334d5b
MD5 6a31e9933c4f68a77e80740c4a22ae00
BLAKE2b-256 f34df7fc0ce816a355297c4642933933a4b1bcb4a26b60fec2142fd27376dd0c

See more details on using hashes here.

File details

Details for the file metacells-0.7.0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: metacells-0.7.0-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 5.2 MB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.2.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for metacells-0.7.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 83c362ff5c52ccffd221bda4c2bf49577cda6521dcd12186235b8de1a13288c7
MD5 f2cbefe22b85b822da7e8a4821e53417
BLAKE2b-256 c76f896204eab97eeac6646aa310c31a63c21b7b9fa3df539e9c5d6447dc6d28

See more details on using hashes here.

Supported by

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