|
2 | 2 |
|
3 | 3 | Requires modules `networkx`, `numpy`, `scikit-learn`, and `argparse`.
|
4 | 4 |
|
5 |
| -For a description of the Random Walk with Restart (RWR) algorithm, see the paper by Kohler et al. at [http://www.sciencedirect.com/science/article/pii/S0002929708001729](http://www.sciencedirect.com/science/article/pii/S0002929708001729). |
| 5 | +For a description of the Random Walk with Restart (RWR) algorithm, which |
| 6 | +this module implements, see the paper by Kohler et al. at |
| 7 | +[http://www.sciencedirect.com/science/article/pii/S0002929708001729](http://www.sciencedirect.com/science/article/pii/S0002929708001729). |
6 | 8 |
|
7 |
| -This module was initially created to run node removal experiments with two separate graphs, but the code in matrix\_main.py can easily be used to run the standard RWR algorithm on a single graph of any sort. |
| 9 | +## Overview |
| 10 | + |
| 11 | +This module can be used to run two types of experiments: |
| 12 | + |
| 13 | +- A standard random walk with restart from a set of seed nodes, as in the |
| 14 | + Kohler et al. paper referenced above. |
| 15 | +- A random walk with restart, from a set of seed nodes, on a "tissue-specific" |
| 16 | + network. The network is defined by a "low list" of nodes (i.e. genes) that |
| 17 | + are not expressed in the tissue of interest. This is described in more |
| 18 | + detail in our paper, which is currently in review. |
| 19 | + |
| 20 | +Examples of both experiments are described in more detail below. |
8 | 21 |
|
9 | 22 | ## Running a random walk
|
10 | 23 |
|
11 |
| -The matrix\_main.py script can be used to run a random walk. The syntax looks like: |
| 24 | +The run\_walker.py script can be used to run a random walk. The syntax looks like: |
12 | 25 |
|
13 |
| -`python matrix_main.py <input_graph> <seed> [-l <low_list>] [-r <remove_nodes>]` |
| 26 | +`python run_walker.py <input_graph> <seed> [-l <low_list>] [-r <remove_nodes>]` |
14 | 27 |
|
15 | 28 | where the input graph is in edge list format, the seed is a list of nodes to
|
16 | 29 | start the random walk at, the optional low list is a list of nodes to down-weight
|
17 |
| -for node removal experiments (as in the tissue-specific networks paper), and the |
18 |
| -optional node removal list is a list of nodes to remove completely from the graph. |
| 30 | +for node removal experiments, and the optional node removal list is a list of nodes |
| 31 | +to remove completely from the network. |
| 32 | + |
| 33 | +The script will write a tab-separated list of nodes and probabilities to stdout, |
| 34 | +where the probability number represents the probability that a random walk |
| 35 | +starting at the seed nodes will terminate at the given node. |
| 36 | + |
| 37 | +For more detail about the expected arguments, run `python run_walker.py -h`. |
| 38 | + |
| 39 | +## Examples |
| 40 | + |
| 41 | +To help you get up and running, a few simple examples are included in the `testdata` |
| 42 | +folder. To run a standard random walk experiment on a simple example network, run |
| 43 | +this command: |
| 44 | + |
| 45 | +`python run_walker.py testdata/test_network.ppi testdata/test_seed.txt` |
| 46 | + |
| 47 | +Or, to run a "tissue-specific" random walk experiment using the same |
| 48 | +simple example network, try: |
19 | 49 |
|
20 |
| -More thorough documentation to come. |
| 50 | +`python run_walker.py testdata/test_network.ppi testdata/test_seed.txt -l testdata/test_low_list.txt` |
21 | 51 |
|
22 | 52 | ## Using the module
|
23 | 53 |
|
|
0 commit comments