Skip to content

Commit

Permalink
added simple test data
Browse files Browse the repository at this point in the history
  • Loading branch information
jjc2718 committed Dec 20, 2016
1 parent aefa89f commit a507dbf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 6 additions & 0 deletions testdata/test_network.ppi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0 1 .25
0 2 .25
1 2 .25
2 3 .80
3 4 .85
1 4 .50
2 changes: 2 additions & 0 deletions testdata/test_seed.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
1
12 changes: 4 additions & 8 deletions walker.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,11 @@ def _build_og(self, original_ppi):
# parse network input
for line in graph_fp.readlines():
split_line = line.rstrip().split('\t')
if len(split_line) > 2:
if len(split_line) > 3:
# assume input graph is in the form of HIPPIE network
try:
edge_list.append((split_line[1], split_line[3],
float(split_line[4])))
except ValueError:
print line
exit()
elif len(split_line) < 2:
edge_list.append((split_line[1], split_line[3],
float(split_line[4])))
elif len(split_line) < 3:
# assume input graph is a simple edgelist without weights
edge_list.append((split_line[0], split_line[1], float(1)))
else:
Expand Down

0 comments on commit a507dbf

Please sign in to comment.