Skip to main content

Metacells 0.8.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.

0.8.0

  • Add inner fold factor computation for metacells quality control.

  • Add deviant fold factor computation for metacells quality control.

  • Add projection of query data onto an atlas.

  • Self-adjusting pile sizes.

  • Add convenience function for computing data for MCView.

  • Better control over filtering using absolute fold factors.

  • Fix edge case in computing noisy lonely genes.

  • Additional outliers certificates.

  • Stricter deviants detection policy

Release files for metacells 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for metacells 0.8.0
File Size Uploaded
metacells-0.8.0.tar.gz 320.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for metacells 0.8.0
File
metacells-0.8.0-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl PyPy 3.7 PyPy 3.7 7.3 Linux glibc 2.12+ x86-64 Details
metacells-0.8.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl PyPy 3.7 PyPy 3.7 7.3 macOS 10.9+ x86-64 Details
metacells-0.8.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.12+ x86-64 Details
metacells-0.8.0-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details
metacells-0.8.0-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
metacells-0.8.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.12+ x86-64 Details
metacells-0.8.0-cp38-cp38-macosx_11_0_arm64.whl CPython 3.8 CPython 3.8 macOS 11.0+ ARM64 Details
metacells-0.8.0-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details
metacells-0.8.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64 Details
metacells-0.8.0-cp37-cp37m-macosx_10_9_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 Details

Total release size: 260.2 MB

Release files / metacells-0.8.0.tar.gz

Download URL metacells-0.8.0.tar.gz
Size 320.9 kB
Tags Source
SHA-256 checksum
How to use checksums
044ba663cd4b3e2a11fa7b65799333ff9acf0db31257a1a9529f7f75077e7656
BLAKE2b-256 checksum
How to use checksums
dc5fbd74eed94e3b1ddcb65b160b50d66556698ca304bd9199954db7c5ad3a11
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / metacells-0.8.0-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL metacells-0.8.0-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 4.1 MB
Tags Linux glibc 2.12+ x86-64 PyPy 3.7 PyPy 3.7 7.3
SHA-256 checksum
How to use checksums
348f42235cde73040c4989b09150c58aa833002ac75a3d4fb92a6c1e707f2b7a
BLAKE2b-256 checksum
How to use checksums
537891279cbe8e63d8888d70555e855c38f14999c618cc2026c0964a1d0692f3
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / metacells-0.8.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl

Download URL metacells-0.8.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Size 4.4 MB
Tags PyPy 3.7 PyPy 3.7 7.3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
e8dbb7de73f47a53901c7cfa22e000d66fabaeb7847cacd669ac28c0a4d5476a
BLAKE2b-256 checksum
How to use checksums
8b98d672d18b39ac142ef34445d4596600f29db592c68e67d4b41332a23db65d
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / metacells-0.8.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL metacells-0.8.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 75.8 MB
Tags CPython 3.9 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
f4ad8ec70fad89917f0e6d20bf8f94dd8c933e1b73883f7c58f3273ad3898e6a
BLAKE2b-256 checksum
How to use checksums
5c700177b7f851679e667677e6adfd2d50db128f6c786729a820ec997df1b2bb
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / metacells-0.8.0-cp39-cp39-macosx_11_0_arm64.whl

Download URL metacells-0.8.0-cp39-cp39-macosx_11_0_arm64.whl
Size 5.1 MB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0704e8770ab6adcc2976f29e4affd853bc77ec93daacece2e2268dfaf9cb23ad
BLAKE2b-256 checksum
How to use checksums
947caecf6c3475cff5d58ab653477a89804efe97c5c97aa32b243fe6e8c6e3c5
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / metacells-0.8.0-cp39-cp39-macosx_10_9_x86_64.whl

Download URL metacells-0.8.0-cp39-cp39-macosx_10_9_x86_64.whl
Size 5.3 MB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
c39af6b821d5df546151acd2fdd69ad6975c3c8dfbcc156c14fc41fb91d790f4
BLAKE2b-256 checksum
How to use checksums
fd20abc024c537af4373060207963ff21e49fe42e7159578f802e08b924daa56
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / metacells-0.8.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL metacells-0.8.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 76.7 MB
Tags CPython 3.8 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
eb6131ee4e9b995100e0670b48569fa366bd9f43510fd5d4a058b66e7342ba28
BLAKE2b-256 checksum
How to use checksums
28e13b34baa2515efb602f3cbac3713f7be95aedb0f117b011e43f1077356b20
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / metacells-0.8.0-cp38-cp38-macosx_11_0_arm64.whl

Download URL metacells-0.8.0-cp38-cp38-macosx_11_0_arm64.whl
Size 5.1 MB
Tags CPython 3.8 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
bc2b3d46b68a1722281cc89986fc87f7fc05d67dfd4e4f9919cba2caadeb758c
BLAKE2b-256 checksum
How to use checksums
6bb5e9f13e594cc3351b81a78d425e97465a342aa0783df8c1756d1796ef5cab
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / metacells-0.8.0-cp38-cp38-macosx_10_9_x86_64.whl

Download URL metacells-0.8.0-cp38-cp38-macosx_10_9_x86_64.whl
Size 5.3 MB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
eff57de8d738b9bd5c7019cb5e15c0da760000d8cbd283fe005fe32a20a197d0
BLAKE2b-256 checksum
How to use checksums
c24a878fe2f8729f4609395a45218cf4f4dfa9de6d524721272b473049b4347c
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / metacells-0.8.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL metacells-0.8.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 73.0 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
5ff3810781511501775aeeafeddbe0e5a17e336425e697f47f67eb201f799090
BLAKE2b-256 checksum
How to use checksums
434dbcabcc5acca2c1064135acdd13b0d8ab995d1829d369a157469c8d77e060
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / metacells-0.8.0-cp37-cp37m-macosx_10_9_x86_64.whl

Download URL metacells-0.8.0-cp37-cp37m-macosx_10_9_x86_64.whl
Size 5.1 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
889434ba7e5bb78698ff0628945925a43f5d83a71a59af2c846502486d39b1fe
BLAKE2b-256 checksum
How to use checksums
dad305fcd1a23e2cbdf0351302b2cb85af2e45b6178e19e1daf8c65b7132f214
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

0.9.5

24 release files

0.9.4

24 release files

0.9.3

24 release files

0.9.1

21 release files

0.9.0

10 release files

This release

0.8.0 This release

11 release files

0.7.0

11 release files

0.6

11 release files

0.5

11 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page