-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Andrea Vandin edited this page Jul 28, 2022
·
26 revisions
This repository contains code to process weighted graphs from Netzschleuder to export them in a CSV format supported by the ERODE tool
Please open the following jupyter lab notebook on Google colab and run it.
After following the link:
-
Click on 'Copy to Drive' to create your own copy of this file on your Google drive
- highly suggested, otherwise you will loose any change applied and file created
- If you decide to copy the notebook, the next time open your local copy by accessing it from here, navigating to Colab Notebooks
-
Add all graphs of interest in the list
model_names
model_names=["blumenau_drug"]
- In most of the cases, you shall use the identifiers in the first column here
- For some models you might need to use a different ID, as specified in the repository page
- E.g.,
ambassador
actually consist of 15 graphs, each of which shall be named asambassador/model_name1
,ambassador/model_name2
...
- In the notebook you find a list of all weighted graphs found on 21/07/22 sorted from smallest number of nodes to largest
- E.g.:
model_names=["blumenau_drug","cattle"]
-
Set flags
download_file
andstore_on_gdrive
toTrue
orFalse
-
store_on_gdrive=True
implies that exported CSV files will be stored in your google drive -
store_on_gdrive=True
(and at the same timestore_on_gdrive=False
) implies that exported CSV files will be downloaded
-
-
Run all cells.
- All installation steps will be performed
- The weighted graphs specified in list
model_names
will be processed- Colab might fail if you try to process all weighted graphs due to excessive usage of RAM (just split the list in two or more, and run again)
- Certain models are just too big for colab (e.g.
bag_of_words/pubmed
)
- Certain models are just too big for colab (e.g.
- Colab might fail if you try to process all weighted graphs due to excessive usage of RAM (just split the list in two or more, and run again)
Output
- You will get in output:
- model_nameA.csv: a compact representation of the edges: source,target,weight
- model_nameB.csv: a file necessary to ERODE. It contains value 0 for each node
- import_model_name.ode: an ERODE file able to process the CSV files. It will create a file containing the ODEs corresponding to the system of equations Ax=B.
- You shall:
- Download and run ERODE
- Create a new project
- Drag&drop the three files there. Open import_model_name.ode, and click on the button with the ERODE logo to run the ERODE file
- Please find manual and installation instructions here
Beware: not all graphs classified as weighted actually come with weights.
- E.g., hens does not actually come with weights.
- In these cases, we
- set all weights to 1
- add 'defaultWeights' to the name of every created file
- Other models have custom names for the 'weights' column in the source files
- In the jupyter file you will find this handled for some classes of models (dictionary
prefix_to_weight
)