Metadata-Version: 2.1
Name: ddn3
Version: 0.1.0
Summary: Dependency network analysis under two conditions
License: MIT
Author: Minta Lu
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: jupyter (>=1.0.0,<2.0.0)
Requires-Dist: matplotlib (>=3.8.2,<4.0.0)
Requires-Dist: networkx (>=3.2.1,<4.0.0)
Requires-Dist: numba (>=0.58.1,<0.59.0)
Requires-Dist: numpy (>=1.26.2,<2.0.0)
Requires-Dist: pandas (>=2.1.4,<3.0.0)
Requires-Dist: scikit-learn (>=1.3.2,<2.0.0)
Requires-Dist: scipy (>=1.11.4,<2.0.0)
Description-Content-Type: text/markdown

# DDN 3.0
We developed an efficient and accurate differential network analysis tool – Differential Dependency Networks (DDN).
DDN is capable of jointly learning sparse common and rewired network structures, which is especially useful for genomics, proteomics, and other biomedical studies.
DDN 3.0 significantly improves the speed of previous verions of DDN, and is available as a Python package.
This repository provides the source code and examples of using DDN.

## Installation
### Option 1: install into a new Conda environment using pip
One way is to install DDN into a new Conda environment. To create and activate an environment named `ddn`, run this:
```bash
conda create -n ddn python=3.11
conda activate ddn
```
Python 3.12 may have some issue with Numba.

DDN 3.0 can then be installed with the followin command.
```bash
pip install ddn3
```
<!-- ```bash
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple ddn
``` -->

### Option 2: install into an existing Conda environment
If you want to install DDN into an existing Conda environment, it is suggested to install dependencies from Conda first.

First we need to install some common dependencies.
```bash
$ conda install -c conda-forge numpy scipy numba networkx matplotlib jupyter scipy pandas scikit-learn
```

Then run
```bash
pip install ddn3
```

Alternatively, you can clone the repository, or just download or unzip it. Then we can install DDN 3.0.
```bash
$ pip install ./
```
Or you may want to install it in development mode.
```bash
$ pip install -e ./
```

## Usage

This toy example generates two random datasets, and use estimate to estimate two networks, one for each dataset.
```python
import numpy as np
from ddn import ddn
dat1 = np.random.randn(1000, 10)
dat2 = np.random.randn(1000, 10)
networks = ddn.ddn(dat1, dat2, lambda1=0.3, lambda2=0.1)
```

For more details and examples, check the [documentation](https://ddn-30.readthedocs.io/en/latest/), which includes three tutorials and the API reference.
The tutorials can also be found in the `docs/notebooks` folder.

## Contributing

Please report bugs in the issues. 
You may also email the authors directly: Yingzhou Lu (lyz66@vt.edu), Yizhi Wang (yzwang@vt.edu), or Yue Wang (yuewang@vt.edu).
If you are interested in adding features or fixing bug, feel free to contact us.

## License

The `ddn` package is licensed under the terms of the MIT license.

## Citations

[1] Zhang, Bai, and Yue Wang. "Learning structural changes of Gaussian graphical models in controlled experiments." arXiv preprint arXiv:1203.3532 (2012).

