Skip to main content

OncoBLADE - extended version of BLADE tailored for cancer application

Project description

OncoBLADE: Malignant cell fraction-informed deconvolution

OncoBLADE is a Bayesian deconvolution method designed to estimate cell type-specific gene expression profiles and fractions from bulk RNA profiles of tumor specimens by integrating prior knowledge on cell fractions

Demo notebook is currently under construction

System Requirements

Hardware Requirements

OncoBLADE can run on the minimal computer spec, such as Binder (1 CPU, 2GB RAM on Google Cloud), when data size is small. However, OncoBLADE can significantly benefit from the larger amount of CPUs and RAM.

OS Requirements

The package development version is tested on Linux operating systems. (CentOS 7 and Ubuntu 16.04).

Installation

Using pip

The python package of BLADE is available on pip. You can simply (takes only <1min):

pip install OncoBLADE

We tested BLADE with python => 3.6.

Using Conda

One can create a conda environment contains BLADE and also other dependencies to run Demo. The environment definition is in environment.yml.

Step 1: Installing Miniconda 3

First, please open a terminal or make sure you are logged into your Linux VM. Assuming that you have a 64-bit system, on Linux, download and install Miniconda 3 with:

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh

On MacOS X, download and install with:

curl https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o Miniconda3-latest-MacOSX-x86_64.sh
bash Miniconda3-latest-MacOSX-x86_64.sh

Step 2: Create a conda environment

You can install all the necessary dependency using the following command (may takes few minutes).

conda env create --file environment.yml

Then, the BLADE environment can be activate by:

conda activate BLADE

Overview of OncoBLADE (WIP)

In the OncoBLADE package, you can load the following functions and modules.

  • BLADE: A class object contains core algorithms of BLADE. Users can reach internal variables (Nu, Omega, and Beta) and functions for calculating objective functions (ELBO function) and gradients with respect to the variational parameters. There also is an optimization function (BLADE.Optimize()) for performing L-BFGS optimization. Though this is the core, we also provide a more accessible function (BLADE_framework) that performs deconvolution. See below to obtain the current estimate of cellualr fractions, gene expression profiles per cell type and per sample:

    • ExpF(self.Beta) : returns a Nsample by Ngene matrix contains estimated fraction of each cell type in each sample.
    • self.Nu: a Nsample by Ngene by Ncell multidimensional array contains estimated gene expression levels of each gene in each cell type for each sample.
    • numpy.mean(self.Nu,0): To obtain a estimated gene expression profile per cell type, we can simply take an average across the samples.
  • Framework_Iterative: A framework based on the BLADE class module above. Users need to provide the following input/output arguments.

    • Input arguments
      • X: a Ngene by Ncell matrix contains average gene expression profiles per cell type (a signature matrix) in log-scale.
      • stdX: a Ngene by Ncell matrix contains standard deviation per gene per cell type (a signature matrix of gene expression variability).
      • Y: a Ngene by Nsample matrix contains bulk gene expression data. This should be in linear-scale data without log-transformation.
      • Expectation: a Nsample by Ncell matrix contains the expected cell fraction used to inform OncoBLADE [Optional]
      • Ind_Marker: Index for marker genes. By default, [True]*Ngene (all genes used without filtering). For the genes with False they are excluded in the first phase (Empirical Bayes) for finidng the best hyperparameters.
      • Ind_sample: Index for the samples used in the first phase (Empirical Bayes). By default, [True]*Nsample (all samples used).
      • Alphas, Alpha0s, Kappa0s and SYs: all possible hyperparameters considered in the phase of Empirical Bayes. A default parameters are offered as described in the manuscript (to appear): Alphas=[1,10], Alpha0s=[0.1, 1, 5], Kappa0s=[1,0.5,0.1] and SYs=[1,0.3,0.5].
      • Nrep: Number of repeat for evaluating each parameter configuration in Empirical Bayes phase. By default, Nrep=3.
      • Nrepfinal: Number of repeated optimizations for the final parameter set. By default, Nrepfinal=10.
      • Njob: Number of jobs executed in parallel. By default, Njob=10.
    • Output values
      • final_obj: A final BLADE object with optimized variational parameters and hyperparameters.
      • best_obj: The best object form Empirical Bayes step. If no genes and samples are filtered, best_obj is the same as final_obj.
      • best_set: A list contains the hyperparameters selected in the Empirical Bayes step.
      • All_out: A list of BLADE objects from the Empirical Bayes step.
  • BLADE_job/Optimize: Internal functions used by Framework.

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

OncoBLADE-1.0.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

OncoBLADE-1.0.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file OncoBLADE-1.0.0.tar.gz.

File metadata

  • Download URL: OncoBLADE-1.0.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for OncoBLADE-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fdd2d22d95f328f8982242a0284d57c3b4901f0a1fd44a9149981b33e3a05ddf
MD5 f2ddbc9c9054e0c413065536bab7007c
BLAKE2b-256 a1be92b20e9de63d865df59be7fe1268738aa97a8aa754eb18bde6500c889810

See more details on using hashes here.

File details

Details for the file OncoBLADE-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: OncoBLADE-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for OncoBLADE-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3669432558ebcb3e177ae2ef4257be00dfec99ca0b84ebaf488e349d1873d967
MD5 ebfc805418354c4dff1f44202480807d
BLAKE2b-256 0e6b01d2700450bb84b24fff51f35b7c1e909db8ea1a70f6bef607c4a86d392d

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