Skip to main content

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

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


Download files

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

Source Distribution

bipca-1.1.0.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

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

bipca-1.1.0-py3-none-any.whl (657.8 kB view details)

Uploaded Python 3

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

Hashes for bipca-1.1.0.tar.gz
Algorithm Hash digest
SHA256 f77f95b9dbd8ecfb9461098a149cf70d95dd691f22037358fed6e7d6874884bb
MD5 887ea4ca634ef8ed46a95c603b74ce49
BLAKE2b-256 6bf6dbdf131f1149f944217c2f74882553078931cbfb76b5d4c1b011086ab9df

See more details on using hashes here.

Provenance

The following attestation bundles were made for bipca-1.1.0.tar.gz:

Publisher: python-publish.yml on KlugerLab/bipca

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for bipca-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67cdc880e080ffb34f11228e938b1dc9adc7c9afef7af895cd6eed125c1e445a
MD5 1cbb1afa50e6a69a6ef0551f0fa75340
BLAKE2b-256 8a72e81e8c72696ae04dbed55d6e66efe3d1a57ce555f9ac219374b25cafd344

See more details on using hashes here.

Provenance

The following attestation bundles were made for bipca-1.1.0-py3-none-any.whl:

Publisher: python-publish.yml on KlugerLab/bipca

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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