-
Notifications
You must be signed in to change notification settings - Fork 3
/
gather_experiment_metadata.py
29 lines (27 loc) · 1.06 KB
/
gather_experiment_metadata.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import os
import pandas as pd
import pereggrn.experimenter as experimenter
import pereggrn_networks
import pereggrn_perturbations
pereggrn_networks.set_grn_location("../network_collection/networks")
pereggrn_perturbations.set_data_path("../perturbation_data/perturbations")
all_active_experiments = []
for experiment in os.listdir("experiments"):
try:
all_active_experiments.append(pd.DataFrame(
{
k:experimenter.validate_metadata(experiment, input_folder = "experiments")[k]
for k in ["nickname", "refers_to", "readme"]
},
index = [experiment]
))
except:
all_active_experiments.append(pd.DataFrame(
{
k:"Could not validate the metadata -- likely an inactive experiment."
for k in ["nickname", "refers_to", "readme"]
},
index = [experiment]
))
pd.concat(all_active_experiments).sort_index().to_csv("all_experiments.tsv", sep = "\t", index = True)
print("Done. See results in all_experiments.tsv.")