Biwhitened Principal Components Analysis
Project description
BiPCA is a Python package for processing high-dimensional omics count data, such as scRNAseq, spatial transcriptomics, scATAC-seq, and many others. BiPCA first scales the rows and columns of the data to make the noise approximately homoscedastic (biwhitening step), which reveals the underlying rank of the data (based on MP distribution). Then, BiPCA performs optimal shrinkage of singular values to recover the biological signal (denoising step).
Installation
Pip installation
You can install BiPCA from PyPI:
pip install biPCA
To install with optional experiment dependencies:
pip install biPCA[experiments]
Alternatively, to install from source:
pip install 'git+https://github.com/KlugerLab/bipca.git#subdirectory=python'
Or from source with experiment dependencies:
pip install 'biPCA[experiments] @ git+https://github.com/KlugerLab/bipca.git#subdirectory=python'
Docker installation
Alternatively, we recommend installing BiPCA with the accompanied bipca-experiment Docker environment. This image reproduces the environment we used to make the BiPCA manuscript. The pre-built docker image can be downloaded using:
docker pull jyc34/bipca-experiment:lastest
and to run the Docker container:
docker run -it --rm -e USER=john -e USERID=$(id -u) --name bipca -p 8080:8080 -p 8029:8787 \
-v /data/:/data/ docker.io/jyc34/bipca-experiment:lastest /bin/bash
Here, change /data/:/data to <your_local_data_directory>:/data. A JupyterLab will be launched on host port 8080 and an RStudio will be on port 8029. If you would like to link a local bipca installation (for package development, for instance), you can use -v <your_local_bipca_directory>:/bipca.
See detailed descriptions regarding the Docker image usage and information on the corresponding Dockerfile.
Getting Started
Running BiPCA with a built-in dataset: tutorial-0-quick_start.ipynb
Running BiPCA with an unfiltered dataset from scanpy: tutorial-1-pbmc_scrna_scanpy.ipynb
Reproducing figures
Codes for generating the figures used in the manuscript are documented as individual functions in figure.py. For example, run the following to reproduce the marker gene figure:
from bipca.experiments.figures import Figure_marker_genes
fig_obj = Figure_marker_genes(base_plot_directory="./result/",
output_dir="./data/",
formatstr="png")
fig_obj.plot_figure(save=True)
Figure1_Suppfig1.ipynb regenerates Fig1 and Supplemental Fig1 used in the manuscript.
Reference
If you use BiPCA for your research, please cite accordingly.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bipca-1.1.0.tar.gz.
File metadata
- Download URL: bipca-1.1.0.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f77f95b9dbd8ecfb9461098a149cf70d95dd691f22037358fed6e7d6874884bb
|
|
| MD5 |
887ea4ca634ef8ed46a95c603b74ce49
|
|
| BLAKE2b-256 |
6bf6dbdf131f1149f944217c2f74882553078931cbfb76b5d4c1b011086ab9df
|
Provenance
The following attestation bundles were made for bipca-1.1.0.tar.gz:
Publisher:
python-publish.yml on KlugerLab/bipca
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bipca-1.1.0.tar.gz -
Subject digest:
f77f95b9dbd8ecfb9461098a149cf70d95dd691f22037358fed6e7d6874884bb - Sigstore transparency entry: 909215523
- Sigstore integration time:
-
Permalink:
KlugerLab/bipca@8062b78b81ca0993df94c5f636f64377e8135414 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/KlugerLab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@8062b78b81ca0993df94c5f636f64377e8135414 -
Trigger Event:
release
-
Statement type:
File details
Details for the file bipca-1.1.0-py3-none-any.whl.
File metadata
- Download URL: bipca-1.1.0-py3-none-any.whl
- Upload date:
- Size: 657.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67cdc880e080ffb34f11228e938b1dc9adc7c9afef7af895cd6eed125c1e445a
|
|
| MD5 |
1cbb1afa50e6a69a6ef0551f0fa75340
|
|
| BLAKE2b-256 |
8a72e81e8c72696ae04dbed55d6e66efe3d1a57ce555f9ac219374b25cafd344
|
Provenance
The following attestation bundles were made for bipca-1.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on KlugerLab/bipca
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bipca-1.1.0-py3-none-any.whl -
Subject digest:
67cdc880e080ffb34f11228e938b1dc9adc7c9afef7af895cd6eed125c1e445a - Sigstore transparency entry: 909215524
- Sigstore integration time:
-
Permalink:
KlugerLab/bipca@8062b78b81ca0993df94c5f636f64377e8135414 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/KlugerLab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@8062b78b81ca0993df94c5f636f64377e8135414 -
Trigger Event:
release
-
Statement type: