Skip to content

Commit

Permalink
changes from pr review
Browse files Browse the repository at this point in the history
  • Loading branch information
sumedhars committed Oct 31, 2024
1 parent a09226e commit d8b8bcf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
1 change: 1 addition & 0 deletions config/egfr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ algorithms:
- 0.1
mu:
- 0.008
dummy_mode: ["file"]
-
name: omicsintegrator2
params:
Expand Down
23 changes: 3 additions & 20 deletions input/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ All other columns specify additional node attributes such as prizes.
Any nodes that are listed in a node file but are not present in one or more edges in the edge file will be removed.
For example:
```
NODEID prize sources targets active
A 1.0 True True
B 3.3 True True
NODEID prize sources targets dummy
A 1.0 True True True
B 3.3 True True
C 2.5 True True
D 1.9 True True True
```
Expand All @@ -26,23 +26,6 @@ There are 4 dummy mode possibilities:
4. file -> custom nodes - connect the dummy node to a specific list of nodes provided in a file
To support the `file` dummy node logic as part of OmicsIntegrator1, you can either add a seperate `dummy.txt` file (and add this to the `node_files` argument in `config.yaml `) or add a `dummy` column node attribute to a file that contains `NODEID`, `prize`, `source`, etc.

If adding a seperate `dummy.txt` file:
Make a file with the name `dummy.txt` and list the dummy nodes, each seperated by a new line. Example:
```
A
B
C
```

If adding the `dummy` column node attribute, then add the dummy column and specify boolean values for the `dummy` attribute:
```
NODEID prize sources targets dummy
A 1.0 True True True
B 3.3 True True
C 2.5 True True
D 1.9 True True True
```

A secondary format provides only a list of node identifiers and uses the filename as the node attribute, as in the example `sources.txt`.
This format may be deprecated.

Expand Down
9 changes: 5 additions & 4 deletions spras/omicsintegrator1.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,11 @@ def run(edges=None, prizes=None, dummy_nodes=None, dummy_mode=None, mu_squared=N
# 4. file -> custom nodes - connect the dummy node to a specific list of nodes provided in a file

# add dummy node file to the volume if dummy_mode is not None and it is 'file'
if dummy_mode is not None and dummy_mode == 'file':
# needs to use dummy node file that was put in the dataset
bind_path, dummy_file = prepare_volume(dummy_nodes, work_dir)
volumes.append(bind_path)
if dummy_mode == 'file':
if dummy_nodes is None:
raise ValueError("dummy_nodes file is required when dummy_mode is set to 'file'")
bind_path, dummy_file = prepare_volume(dummy_nodes, work_dir)
volumes.append(bind_path)

out_dir = Path(output_file).parent
# Omics Integrator 1 requires that the output directory exist
Expand Down

0 comments on commit d8b8bcf

Please sign in to comment.