Skip to content

Commit

Permalink
code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
marakeby committed Sep 22, 2021
1 parent fa04fa5 commit 65da302
Show file tree
Hide file tree
Showing 113 changed files with 2,673 additions and 3,221 deletions.
73 changes: 48 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ SOFTWARE.
<img src="_plots/logo.png" alt="Logo" width="80" height="80">
</a>

<h2 align="center">P-NET</h2>
<h2 align="center">P-NET</h2>

<p align="center">
P-NET, Biologically informed deep neural network for prostate cancer classification and discovery
Expand Down Expand Up @@ -100,26 +100,27 @@ SOFTWARE.


<!-- ABOUT THE PROJECT -->

## About The Project

<p align="center">
<a href="https://github.com/marakeby/pnet_prostate_paper">
<img src="_plots/screenshot.png" alt="Logo" width="900" height="400">
</a>
</p>


Biologically informed deep neural network for prostate cancer classification and discovery

<!-- GETTING STARTED -->

## Getting Started

To get a local copy up and running follow these simple steps.

### Prerequisites

* python 2.7, check environments.yml for list of needed packages


### Installation

Expand All @@ -131,92 +132,114 @@ To get a local copy up and running follow these simple steps.
```sh
conda env create --name pnet_env --file=environment.yml
```
3. Based on your use, you may need to download one or more of the following
3. Based on your use, you may need to download one or more of the following

a. [Data files](https://drive.google.com/uc?id=1yejDBzGlxuQVPFcFBvZC4KQcPw59xaq3&export=download) (needed to retrain
models and generate figures). Extract the files under ```_database``` directory. If you like to store it somewhere
else, you may need to set the ```DATA_PATH``` variable in ```config_path.py``` accordingly.

a. [Data files](https://drive.google.com/uc?id=1yejDBzGlxuQVPFcFBvZC4KQcPw59xaq3&export=download) (needed to retrain models and generate figures). Extract the files under ```_database``` directory. If you like to store it somewhere else, you may need to set the ```DATA_PATH``` variable in ```config_path.py``` accordingly.

b. [Log files](https://drive.google.com/uc?id=1n1HDb4ZVXeedlhC-9lIBikMDzWHmImZi&export=download) (needed to regenerate paper figures). Extract the files under ```_logs``` directory. If you like to store it somewhere else, you may need to set the ```LOG_PATH``` variable in ```config_path.py``` accordingly.

c. [Plots files](https://drive.google.com/uc?id=1cMsMXgD6I3BZ1fc3CHM7CpSGxHBsqK7X&export=download) (a copy of the paper images). Extract the files under ```_plots``` directory. If you like to store it somewhere else, you may need to set the ```PLOTS_PATH``` variable in ```config_path.py``` accordingly.
b. [Log files](https://drive.google.com/uc?id=1n1HDb4ZVXeedlhC-9lIBikMDzWHmImZi&export=download) (needed to
regenerate paper figures). Extract the files under ```_logs``` directory. If you like to store it somewhere else, you
may need to set the ```LOG_PATH``` variable in ```config_path.py``` accordingly.

c. [Plots files](https://drive.google.com/uc?id=1cMsMXgD6I3BZ1fc3CHM7CpSGxHBsqK7X&export=download) (a copy of the
paper images). Extract the files under ```_plots``` directory. If you like to store it somewhere else, you may need
to set the ```PLOTS_PATH``` variable in ```config_path.py``` accordingly.

<!-- USAGE EXAMPLES -->

## Usage

1. Activate the created conda environment
```sh
source activate pnet_env
```
2. Add the current diretory to PYTHONPATH, e.g.
2. Add the current diretory to PYTHONPATH, e.g.

```sh
export PYTHONPATH=~/pnet_prostate_paper:$PYTHONPATH
```
3. To generate all paper figures, run

3. To generate all paper figures, run
```sh
cd ./analysis
python run_it_all.py
```
4. To generate individual paper figure run the different files under the 'analysis' directory, e.g.

4. To generate individual paper figure run the different files under the 'analysis' directory, e.g.
```sh
cd ./analysis
python figure_1_d_auc_prc.py
```
For ```Figure3``` , make sure you run ```prepare_data.py``` before running other files
5. To re-train a model from scratch run
For ```Figure3``` , make sure you run ```prepare_data.py``` before running other files
5. To re-train a model from scratch run
```sh
cd ./train
python run_me.py
```
This will run an experiment 'pnet/onsplit_average_reg_10_tanh_large_testing' which trains a P-NET model on a training-testing data split of Armenia et al data set and compare it to a simple logistic regression model.
The results of the experiment will be stored under ```_logs```in a directory with the same name as the experiment.
To run another experiment, you may uncomment one of the lines in the run_me.py to run the corresponding experiment. Note that some models especially cross validation experiments may be time consuming.
This will run an experiment 'pnet/onsplit_average_reg_10_tanh_large_testing' which trains a P-NET model on a
training-testing data split of Armenia et al data set and compare it to a simple logistic regression model. The
results of the experiment will be stored under ```_logs```in a directory with the same name as the experiment.
To run another experiment, you may uncomment one of the lines in the run_me.py to run the corresponding experiment.
Note that some models especially cross validation experiments may be time consuming.

<!-- LICENSE -->

## License

Distributed under the GPL-2.0 License License. See `LICENSE` for more information.



<!-- CONTACT -->

## Contact

Haitham - [@HMarakeby](https://twitter.com/HMarakeby)
Haitham - [@HMarakeby](https://twitter.com/HMarakeby)

Project Link: [https://github.com/marakeby/pnet_prostate_paper](https://github.com/marakeby/pnet_prostate_paper)


<!-- References -->

## References

* Armenia, Joshua, et al. "The long tail of oncogenic drivers in prostate cancer." Nature genetics 50.5 (2018): 645-651.
* Robinson, Dan R., et al. "Integrative clinical genomics of metastatic cancer." Nature 548.7667 (2017): 297-303.
* Fraser, Michael, et al. "Genomic hallmarks of localized, non-indolent prostate cancer." Nature 541.7637 (2017): 359-364.
* Fraser, Michael, et al. "Genomic hallmarks of localized, non-indolent prostate cancer." Nature 541.7637 (2017):
359-364.

<!-- ACKNOWLEDGEMENTS -->

## Acknowledgements

* []()
* []()
* []()





<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->

[contributors-shield]: https://img.shields.io/github/contributors/marakeby/pnet_prostate_paper.svg?style=for-the-badge

[contributors-url]: https://github.com/marakeby/pnet_prostate_paper/graphs/contributors

[forks-shield]: https://img.shields.io/github/forks/marakeby/pnet_prostate_paper.svg?style=for-the-badge

[forks-url]: https://github.com/marakeby/pnet_prostate_paper/network/members

[stars-shield]: https://img.shields.io/github/stars/marakeby/pnet_prostate_paper.svg?style=for-the-badge

[stars-url]: https://github.com/marakeby/pnet_prostate_paper/stargazers

[issues-shield]: https://img.shields.io/github/issues/marakeby/pnet_prostate_paper.svg?style=for-the-badge

[issues-url]: https://github.com/marakeby/pnet_prostate_paper/issues

[license-shield]: https://img.shields.io/github/license/marakeby/pnet_prostate_paper.svg?style=for-the-badge

[license-url]: https://github.com/marakeby/pnet_prostate_paper/blob/master/LICENSE.txt

[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555

[linkedin-url]: https://linkedin.com/in/haitham-elmarakeby-29030119
Loading

0 comments on commit 65da302

Please sign in to comment.