You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ These entries are used to tell Snakemake what input files should be present befo
76
76
Implement the `generate_inputs` function, following the `omicsintegrator1.py` example.
77
77
The nodes should be any node in the dataset that has a prize set, any node that is a source, or any node that is a target.
78
78
The network should be all of the edges written in the format `<vertex1>|<vertex2>`.
79
-
`src/dataset.py` provides functions that provide access to node information and the interactome (edge list).
79
+
`Dataset.py` provides functions that provide access to node information and the interactome (edge list).
80
80
81
81
Implement the `run` function, following the Path Linker example.
82
82
The `prepare_volume` utility function is needed to prepare the network and nodes input files to be mounted and used inside the container.
@@ -89,7 +89,7 @@ Use the `run_container` utility function to run the command in the container `<u
89
89
90
90
Implement the `parse_output` function.
91
91
The edges in the Local Neighborhood output have the same format as the input, `<vertex1>|<vertex2>`.
92
-
Convert these to be tab-separated vertex pairs followed by a tab and a `1` at the end of every line, which indicates all edges have the same rank.
92
+
Convert these to be space-separated vertex pairs followed by a space and a `1` at the end of every line, which indicates all edges have the same rank.
93
93
The output should have the format `<vertex1> <vertex2> 1`.
94
94
95
95
### Step 4: Make the Local Neighborhood wrapper accessible through SPRAS
@@ -130,7 +130,7 @@ The pull request will be closed so that future contributors can practice with th
130
130
1. Add a new subdirectory to `docker-wrappers` with the name `<algorithm>`, write a `Dockerfile` to build an image for `<algorithm>`, and include any other files required to build that image in the subdirectory
131
131
1. Build and push the Docker image to the [reedcompbio](https://hub.docker.com/orgs/reedcompbio) Docker organization (SPRAS maintainer required)
132
132
1. Add a new Python file `src/<algorithm>.py` to implement the wrapper functions for `<algorithm>`: specify the list of `required_input` files and the `generate_inputs`, `run`, and `parse_output` functions
133
-
1. Import the new class in `runner.py` so the wrapper functions can be accessed
133
+
1. Import the new class in `PRRunner.py` so the wrapper functions can be accessed
134
134
1. Document the usage of the Docker wrapper and the assumptions made when implementing the wrapper
135
135
1. Add example usage for the new algorithm and its parameters to the template config file
136
136
1. Write test functions and provide example input data in a new test subdirectory `test/<algorithm>`
Copy file name to clipboardExpand all lines: README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ The Docker images are available on [DockerHub](https://hub.docker.com/orgs/reedc
62
62
**Python wrapper for calling algorithms**: Wrapper functions provide an interface between the common file formats for input and output data and the algorithm-specific file formats and reconstruction commands.
63
63
These wrappers are in the `src/` subdirectory.
64
64
65
-
**Test code**: Tests for the Docker wrappers and SPRAS code.
65
+
**Test code**: Tests for the Docker wrappers.
66
66
The tests require the conda environment in `environment.yml` and Docker.
67
67
Run the tests with `pytest -s`.
68
68
@@ -71,6 +71,10 @@ Some computing environments are unable to run Docker and prefer Singularity as t
71
71
SPRAS has limited experimental support for Singularity instead of Docker, and only for some pathway reconstruction algorithms.
72
72
SPRAS uses the spython package to interface with Singularity, which only supports Linux.
73
73
74
+
## Docker demo
75
+
The `docker-demo` subdirectory is not used by the main pathway reconstruction framework.
76
+
It serves as a reference for how to set up Dockerfiles and make Docker run calls.
77
+
74
78
## Attribution
75
79
SPRAS builds on public datasets and algorithms.
76
80
If you use SPRAS in a research project, please cite the original datasets and algorithms in addition to SPRAS.
This subdirectory contains examples of using Docker's Python API https://github.com/docker/docker-py.
4
+
It uses the SINGE [example data](https://github.com/gitter-lab/SINGE/tree/master/data1) and [Docker image](https://hub.docker.com/r/agitter/singe) with a reduced set of hyperparamters.
5
+
The docker-py API is more readable than the similar [BEELINE Docker command](https://github.com/Murali-group/Beeline/blob/7f6e07a3cb784227bf3fa889fe0c36e731c22c5c/BLRun/singeRunner.py#L110-L116) and most likely also more robust across different operating systems.
6
+
7
+
## Installation
8
+
9
+
Install docker-py with the command `pip install docker`.
10
+
11
+
The Docker client must be installed separately.
12
+
13
+
## Usage
14
+
15
+
Before running `docker-demo.py`, start the Docker client and install the `docker` Python package.
16
+
Then, from this `docker` directory run the command:
17
+
```
18
+
python docker-demo.py
19
+
```
20
+
21
+
SINGE will run inside Docker, which takes a few minutes.
22
+
The output files will be written to the `output` subdirectory.
23
+
24
+
If the Docker image `agitter/singe:0.4.1` is not already available locally, the script will automatically pull it from [DockerHub](https://hub.docker.com/r/agitter/singe).
25
+
26
+
## Activating conda inside a Docker container
27
+
28
+
By default, an installed conda environment will not be activated inside the Docker container.
29
+
Docker does not invoke Bash as a login shell.
30
+
[This blog post](https://pythonspeed.com/articles/activate-conda-dockerfile/) provides a workaround demonstrated here in `Dockerfile` and `env.yml`.
31
+
It defines a custom ENTRYPOINT that uses `conda run` to run the command inside the conda environment.
0 commit comments