Skip to content

Commit

Permalink
Merge pull request #24 from alexcwsmith/pr
Browse files Browse the repository at this point in the history
Ensure all empty motifs present in motif_usage.npy
  • Loading branch information
Pavol Bauer authored Feb 10, 2021
2 parents 077c187 + 812f17f commit 3ab929f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions vame/analysis/behavior_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,19 @@ def get_network(path_to_file, file, cluster_method, n_cluster):
motif_usage = np.unique(labels, return_counts=True)
cons = consecutive(motif_usage[0])
if len(cons) != 1:
used_motifs = list(motif_usage[0])
usage_list = list(motif_usage[1])
index = cons[0][-1]+1
usage_list.insert(index,0)

for i in range(n_cluster):
if i not in used_motifs:
used_motifs.insert(i, i)
usage_list.insert(i,0)

# for i in range(len(cons)):
# index = cons[i][-1]+1
# usage_list.insert(index,0)
# if index != cons[i+1][-1]+1:
# usage_list.insert(index+1,0)

usage = np.array(usage_list)

Expand Down

0 comments on commit 3ab929f

Please sign in to comment.