Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format files to prepare for pypi publish #10

Merged
merged 25 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a6fff2c
update readme to use full links to prepare for pypi depolyment
ajlee21 Jun 30, 2020
7cb90ea
update setup file
ajlee21 Jun 30, 2020
13551dc
add nb to exclude for linter testing
ajlee21 Jul 1, 2020
d7b694b
Merge remote-tracking branch 'upstream/master' into pypi
ajlee21 Jul 2, 2020
7777900
remove random import from files
ajlee21 Jul 2, 2020
0168f72
remove files for pytesting analysis, moved to simulate-expression-com…
ajlee21 Jul 3, 2020
38a1230
pull out functions associated with analysis and move to simulate-expr…
ajlee21 Jul 3, 2020
7be86e6
add files related to vae and simulating data
ajlee21 Jul 3, 2020
a06f542
update setup based on new scripts
ajlee21 Jul 3, 2020
44458d7
update names to be more descriptive
ajlee21 Jul 3, 2020
4e9d380
update scripts to output files for testing
ajlee21 Jul 3, 2020
df0bfcf
add test files
ajlee21 Jul 3, 2020
5b555c1
add pytest workflow
ajlee21 Jul 3, 2020
c860abf
fix name typo
ajlee21 Jul 3, 2020
514a591
add comments to simulate_expression_data.py
ajlee21 Jul 6, 2020
a320419
update test nbs
ajlee21 Jul 6, 2020
db6bd35
update readme based on refactor
ajlee21 Jul 6, 2020
877be99
fix typo in config
ajlee21 Jul 6, 2020
7a13e7b
fix another params typo
ajlee21 Jul 6, 2020
6aa2c18
update files based on PR comments
ajlee21 Jul 7, 2020
a65f1f9
remove periods
ajlee21 Jul 7, 2020
4f05aec
update files based on PR comments
ajlee21 Jul 8, 2020
df16149
fix typo for import random
ajlee21 Jul 8, 2020
3585658
add back nbval with out lax
ajlee21 Jul 8, 2020
76161bc
add check for vae reproducibility
ajlee21 Jul 8, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Test analysis notebooks
name: Test simulations

on: [push, pull_request]

jobs:
run-analysis:
name: Test analysis notebooks
name: Test simulation notebooks
runs-on: ubuntu-latest

steps:
Expand All @@ -20,16 +20,13 @@ jobs:
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
$CONDA/bin/conda env update --file environment.yml --name base
$CONDA/bin/pip install .
$CONDA/bin/pip install -e .
$CONDA/bin/pip install pytest
$CONDA/bin/pip install nbval

- name: Run analysis notebooks
- name: Run simulation notebooks
run: |
export R_HOME=`$CONDA/bin/R RHOME`
$CONDA/bin/pytest -v --nbval-lax --current-env Pseudomonas_tests/Pseudomonas_sample_limma.ipynb
$CONDA/bin/pytest -v --nbval-lax --current-env Pseudomonas_tests/Pseudomonas_sample_combat.ipynb
$CONDA/bin/pytest -v --nbval-lax --current-env Pseudomonas_tests/Pseudomonas_experiment_limma.ipynb
$CONDA/bin/pytest -v --nbval-lax --current-env Human_tests/Human_sample_limma.ipynb
$CONDA/bin/pytest -v --nbval-lax --current-env Human_tests/Human_experiment_limma.ipynb

$CONDA/bin/pytest -v --nbval-lax --current-env human_tests/Human_random_sampling_simulation.ipynb
$CONDA/bin/pytest -v --nbval-lax --current-env human_tests/Human_latent_transform_simulation.ipynb
$CONDA/bin/pytest -v --nbval-lax --current-env human_tests/Human_template_simulation.ipynb

1,112 changes: 0 additions & 1,112 deletions Human_tests/Human_experiment_limma.ipynb

This file was deleted.

1,076 changes: 0 additions & 1,076 deletions Human_tests/Human_sample_limma.ipynb

This file was deleted.

1,101 changes: 0 additions & 1,101 deletions Pseudomonas_tests/Pseudomonas_experiment_limma.ipynb

This file was deleted.

1,059 changes: 0 additions & 1,059 deletions Pseudomonas_tests/Pseudomonas_sample_combat.ipynb

This file was deleted.

1,059 changes: 0 additions & 1,059 deletions Pseudomonas_tests/Pseudomonas_sample_limma.ipynb

This file was deleted.

5,550 changes: 0 additions & 5,550 deletions Pseudomonas_tests/data/input/train_set_normalized_test.tsv

This file was deleted.

6 changes: 0 additions & 6 deletions Pseudomonas_tests/data/metadata/experiment_ids.txt

This file was deleted.

1,218 changes: 0 additions & 1,218 deletions Pseudomonas_tests/data/metadata/sample_annotations.tsv

This file was deleted.

31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,31 @@ pip install ponyo
```

## How to use
This method has been used in [simulate-expression-compendia repo](https://github.com/greenelab/simulate-expression-compendia)

Example analysis notebooks using ponyo can be found in [Human_tests](Human_tests/) and [Pseudomonas_tests](Pseudomonas_tests/).
Example notebooks using ponyo on test data can be found in [human_tests](https://github.com/greenelab/ponyo/tree/master/human_tests)

Additionally, this method has been used in [simulate-expression-compendia](https://github.com/greenelab/simulate-expression-compendia) repository.

## Configuration file

The tables lists the core parameters required to generate simulated data using modules from [ponyo](https://github.com/greenelab/ponyo). Those marked with * indicate those parameters that will vary depending on the type of approach .

| Name | Description |
| :--- | :---------- |
| local_dir| str: Parent directory on local machine to store intermediate results|
| scaler_transform_file| str: File to store mapping from normalized to raw gene expression range|
| dataset_name| str: Name for analysis directory containing notebooks using ponyo|
| simulation_type | str: Name of simulation approach directory to store results locally|
| NN_architecture | str: Name of neural network architecture to use. Format 'NN_<intermediate layer>_<latent layer>'|
| learning_rate| float: Step size used for gradient descent. In other words, it's how quickly the methods is learning|
| batch_size | str: Training is performed in batches. So this determines the number of samples to consider at a given time|
| epochs | int: Number of times to train over the entire input dataset|
| kappa | float: How fast to linearly ramp up KL loss|
| intermediate_dim| int: Size of the hidden layer|
| latent_dim | int: Size of the bottleneck layer|
| epsilon_std | float: Standard deviation of Normal distribution to sample latent space|
| validation_frac | float: Fraction of input samples to use to validate for VAE training|
| num_simulated_samples* | int: If using random sampling approach, simulate a compendia with these many samples|
| num_simulated_experiments*| int: If using latent-transformation approach, simulate a compendia with these many experiments|
| num_simulated*| int: If using template-based approach, simulate these many experiments|
| project_id*| int: If using template-based approach, experiment id to use as template experiment|
| metadata_colname | str: Column header that contains sample id that maps expression data and metadata|
20 changes: 0 additions & 20 deletions configs/config_test_Pa_experiment_limma.tsv

This file was deleted.

20 changes: 0 additions & 20 deletions configs/config_test_Pa_sample_combat.tsv

This file was deleted.

20 changes: 0 additions & 20 deletions configs/config_test_Pa_sample_limma.tsv

This file was deleted.

20 changes: 0 additions & 20 deletions configs/config_test_human_experiment_limma.tsv

This file was deleted.

20 changes: 0 additions & 20 deletions configs/config_test_human_sample_limma.tsv

This file was deleted.

11 changes: 3 additions & 8 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
name: simulate_expression_compendia
name: test_ponyo
channels:
- conda-forge
- r
- bioconda
dependencies:
- r::r-base=3.6.0
- bioconda::bioconductor-limma
- bioconda::bioconductor-sva
- conda-forge::python=3.7
- conda-forge::keras
- conda-forge::tensorflow=1
Expand All @@ -21,6 +16,7 @@ dependencies:
- conda-forge::ipykernel=5.1.1
- conda-forge::nb_conda_kernels
- conda-forge::gxx_linux-64
- conda-forge::rpy2
- conda-forge::libiconv=1.15
- conda-forge::joblib=0.13.2
- anaconda::protobuf
Expand All @@ -29,5 +25,4 @@ dependencies:
- torch>=0.4.0
- matplotlib==3.0.0
- pillow
- requests
- rpy2
- requests
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New line char needed.

Loading