Skip to content

Commit 8a03152

Browse files
author
nadiadavidson
committed
Fix for compatibility with networkx version 2
1 parent 094e176 commit 8a03152

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

BuildSuperTranscript.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ def SuperTran(fname,verbose=False):
194194

195195
except Exception as error: #Graph building failed, just take longest transcript (or concatenate all transcripts)
196196
print(error)
197+
traceback.print_exception()
197198
temp = 0
198199
seq = ''
199200
print('FAILED to construct')
@@ -499,16 +500,21 @@ def BuildGraph(fname,transcripts,verbose=True,max_edges=100):
499500

500501
### Create edges in new node and remove some from old node
501502
#Copy out edges to new node and remove from old
502-
for n1,n2,d in C.out_edges(iM,data=True):
503+
for n1,n2,d in list(C.out_edges(iM,data=True)):
503504
if(n2 not in whirl):
504-
C.add_edge(Node_index,n2,d)
505+
if d:
506+
C.add_edge(Node_index,n2,d)
507+
else:
508+
C.add_edge(Node_index,n2)
505509
C.remove_edge(iM,n2)
506-
507510

508511
#Get In edge to new node and remove from old
509-
for n1,n2,d in C.in_edges(iM,data=True):
510-
if(n1 in whirl):
511-
C.add_edge(n1,Node_index,d)
512+
for n1,n2,d in list(C.in_edges(iM,data=True)):
513+
if(n1 in whirl):
514+
if d:
515+
C.add_edge(n1,Node_index,d)
516+
else:
517+
C.add_edge(n1,Node_index)
512518
C.remove_edge(n1,iM)
513519

514520
Node_index= Node_index+1

Lace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ def Split(genome,corsetfile,ncore,maxTran,outdir,full_clean):
182182
print("( ) / _\ / )( __)")
183183
print("/ (_/\/ \( (__ ) _) ")
184184
print("\_____/\_/\_/\_____)(____)")
185-
print("Lace Version: 1.10")
186-
print("Last Editted: 04/02/19")
185+
print("Lace Version: 1.11")
186+
print("Last Editted: 05/02/19")
187187

188188

189189
#Make argument parser

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
dependencies:
55
- python=3*
66
- pandas
7-
- networkx 1.1
7+
- networkx
88
- numpy
99
- matplotlib
1010
- blat

0 commit comments

Comments
 (0)