Skip to content

Commit

Permalink
fix unexpected behavior of get_terminal_structures with {} structures
Browse files Browse the repository at this point in the history
  • Loading branch information
Bribak committed Jun 30, 2023
1 parent 656e37d commit eaef2bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/lib/glycowork/motif/annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def get_terminal_structures(glycan, libr = None):
libr = lib
ggraph = ensure_graph(glycan, libr = libr)
nodeDict = dict(ggraph.nodes(data = True))
return [nodeDict[k]['string_labels']+'('+nodeDict[k+1]['string_labels']+')' for k in ggraph.nodes() if ggraph.degree[k] == 1 and k != max(list(ggraph.nodes()))]
return [nodeDict[k]['string_labels']+'('+nodeDict[k+1]['string_labels']+')' for k in list(ggraph.nodes())[:-1] if ggraph.degree[k] == 1 and k+1 in nodeDict.keys()]


def create_correlation_network(df, correlation_threshold):
Expand Down
2 changes: 1 addition & 1 deletion glycowork/motif/annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def get_terminal_structures(glycan, libr = None):
libr = lib
ggraph = ensure_graph(glycan, libr = libr)
nodeDict = dict(ggraph.nodes(data = True))
return [nodeDict[k]['string_labels']+'('+nodeDict[k+1]['string_labels']+')' for k in ggraph.nodes() if ggraph.degree[k] == 1 and k != max(list(ggraph.nodes()))]
return [nodeDict[k]['string_labels']+'('+nodeDict[k+1]['string_labels']+')' for k in list(ggraph.nodes())[:-1] if ggraph.degree[k] == 1 and k+1 in nodeDict.keys()]


def create_correlation_network(df, correlation_threshold):
Expand Down

0 comments on commit eaef2bd

Please sign in to comment.