Skip to content

Commit b6d05b7

Browse files
authored
added bonobo to docs and small readme fix. Added LIONESS examples (#337)
Co-authored-by: violafanfani <[email protected]>
1 parent 39df60c commit b6d05b7

File tree

6 files changed

+292
-181
lines changed

6 files changed

+292
-181
lines changed

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ netZooPy is tested on: (OS: Ubuntu + Macos) X (Language: Python v3.7 + Python v3
1414

1515
## Description
1616

17-
netZooPy is an R package to reconstruct, analyse, and plot biological networks.
17+
netZooPy is a python package to reconstruct, analyse, and plot biological networks.
1818

1919
## Features
2020

@@ -36,12 +36,6 @@ netZooPy currently integrates
3636
* **COBRA** (Co-expression Batch Reduction Adjustment). Batch effects and other covariates are known to induce spurious associations in co-expression networks and confound differential gene expression analyses. These effects are corrected for using various methods prior to downstream analyses such as the inference of co-expression networks and computing differences between them. In differential co-expression analysis, the pairwise joint distribution of genes is considered rather than independently analyzing the distribution of expression levels for each individual gene. Computing co-expression matrices after standard batch correction on gene expression data is not sufficient to account for the possibility of batch-induced changes in the correlation between genes as existing batch correction methods act solely on the marginal distribution of each gene. Consequently, uncorrected, artifactual differential co-expression can skew the correlation structure such that network-based methods that use gene co-expression can produce false, nonbiological associations even using data corrected using standard batch correction. Co-expression Batch Reduction Adjustment (COBRA) addresses this question by computing a batch-corrected gene co-expression matrix based on estimating a conditional covariance matrix. COBRA estimates a reduced set of parameters that express the co-expression matrix as a function of the sample covariates and can be used to control for continuous and categorical covariates. The method is computationally fast and makes use of the inherently modular structure of genomic data to estimate accurate gene regulatory associations and enable functional analysis for high-dimensional genomic data.
3737

3838

39-
40-
41-
42-
43-
44-
4539
* **BONOBO** (Bayesian Optimized Networks Obtained By assimilating Omics data) is a scalable Bayesian model for deriving individual sample-specific co-expression networks by recognizing variations in molecular interactions across individuals. For every sample, BONOBO assumes a Gaussian distribution on the log-transformed centered gene expression and a conjugate prior distribution on the sample-specific co-expression matrix constructed from all other samples in the data. Combining the sample-specific gene expression with the prior distribution, BONOBO yields a closed-form solution for the posterior distribution of the sample-specific co-expression matrices
4640

4741

docs/changelog.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Changelog
33
==========
44

5+
0.10.1
6+
-------------------------
7+
8+
- Added BONOBO to docs.
9+
- Added LIONESS examples to docs.
10+
- Fixed mistake in README.
511

612
0.10.0
713
-------------------------

docs/functions/api.rst

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
11
The Animals (API)
22
-------------------
33

4+
Animals listed in alphabetical order.
45

5-
Panda
6+
BONOBO
67
======
78

8-
.. autoclass:: netZooPy.panda.panda.Panda
9+
To run BONOBO you can first initialize the class with the expression data,
10+
and then run the compute_bonobo function to get the results:
11+
12+
.. code-block::
13+
14+
bonobo_obj_sparse = Bonobo(expression_file)
15+
bonobo_obj_sparse.run_bonobo(keep_in_memory=True, output_fmt='.hdf', sparsify=True, output_folder='../data/processed/bonobo_sparse_pvals/', save_pvals=False)
16+
17+
Here are the main functions and classes in the BONOBO module:
18+
19+
.. autoclass:: netZooPy.ligress.bonobo.Bonobo
920
:members:
1021
:undoc-members:
1122
:inherited-members:
1223
:private-members:
1324

14-
.. autoclass:: netZooPy.panda.analyze_panda.AnalyzePanda
15-
:members:
16-
:undoc-members:
17-
:private-members:
25+
Other functions
26+
~~~~~~~~~~~~~~~
27+
28+
.. autofunction:: netZooPy.ligress.bonobo.compute_bonobo
29+
30+
.. autofunction:: netZooPy.ligress.io.prepare_expression
1831

19-
Condor
32+
CONDOR
2033
======
2134

2235
.. autoclass:: netZooPy.condor.condor.condor_object
@@ -29,7 +42,7 @@ Other function
2942
~~~~~~~~~~~~~~~
3043
.. autofunction:: netZooPy.condor.run_condor
3144

32-
Lioness
45+
LIONESS
3346
=========
3447

3548

@@ -44,7 +57,26 @@ Lioness
4457
:undoc-members:
4558
:private-members:
4659

47-
Puma
60+
61+
62+
63+
64+
PANDA
65+
======
66+
67+
.. autoclass:: netZooPy.panda.panda.Panda
68+
:members:
69+
:undoc-members:
70+
:inherited-members:
71+
:private-members:
72+
73+
.. autoclass:: netZooPy.panda.analyze_panda.AnalyzePanda
74+
:members:
75+
:undoc-members:
76+
:private-members:
77+
78+
79+
PUMA
4880
=====
4981

5082
.. autoclass:: netZooPy.puma.puma.Puma
@@ -53,7 +85,7 @@ Puma
5385
:inherited-members:
5486
:private-members:
5587

56-
Sambar
88+
SAMBAR
5789
======
5890

5991
.. autofunction:: netZooPy.sambar.sambar
@@ -70,4 +102,3 @@ Extra sambar functions
70102
.. autofunction:: netZooPy.sambar.binomial_dist
71103

72104
.. autofunction:: netZooPy.sambar.clustering
73-

docs/functions/cli.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@ Lioness
3939
~~~~~~~~~
4040

4141
.. autofunction:: netZooPy.lioness.run_lioness.main
42+
43+
Common usage

netZooPy/command_line.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,22 @@ def lioness(expression, motif, ppi, output_panda, output_lioness, el, fmt, compu
167167
168168
netzoopy lioness -e tests/puma/ToyData/ToyExpressionData.txt -m tests/puma/ToyData/ToyMotifData.txt -p tests/puma/ToyData/ToyPPIData.txt -op test_panda.txt -ol lioness/
169169
170+
**Example for GPU computing**. Here the biggest limitation is GPU size, hence we need to optimize the precision and make
171+
sure we don't use all genes, but only the intersection with the PANDA priors. We also save the single lioness
172+
networks as they are computed:
173+
174+
netzoopy lioness -e <expression_file> -m <motif_file> -p <ppi_file> -op output_panda.txt -ol output_lioness_folder/ --computing gpu --precision single --mode_process intersection --save_single_lioness --ignore_final
175+
176+
**LIONESS on a subset of samples**. This is especially useful if you need to test whether your data is suitable for
177+
LIONESS/you have enough resources. By specifying --panda_start and --panda_end the number of samples are restricted
178+
and only the samples in the subset are used for LIONESS. The background is the one specified by panda_start and
179+
panda_end. Alternatively you can use the --subset_numbers and --subset_names flags to specify the samples to use. In this case
180+
the PANDA will be computed on all samples, but then LIONESS will be computed and saved only for a subset of samples:
181+
182+
netzoopy lioness -e <expression_file> -m <motif_file> -p <ppi_file> -op output_panda.txt -ol output_lioness_folder/ --computing <gpu|cpu> --panda_start 1 --panda_end 5 --precision single --mode_process intersection --save_single_lioness --ignore_final
183+
184+
185+
170186
Reference:
171187
Kuijjer, Marieke Lydia, et al. "Estimating sample-specific regulatory networks." Iscience 14 (2019): 226-240.
172188

0 commit comments

Comments
 (0)