---------------------------------------------------------------------------
UnboundLocalError Traceback (most recent call last)
in
18 [hyp_impscores, impscores, onehot_data] = pickle.load(open('modisco_input_'+model_id_list[i]+'_'+data_type_list[i]+'_'+str('all_outputs' if target_range_list[i] is None else target_range_list[i])+'.sav', 'rb'))
19
---> 20 run_modisco(hyp_impscores, impscores, onehot_data)
21
22 #zip outputfolder
in run_modisco(hyp_impscores, impscores, onehot_data)
50 contrib_scores={'task0': impscores},
51 hypothetical_contribs={'task0': hyp_impscores},
---> 52 one_hot=onehot_data)#,
53 #null_per_pos_scores={'task0': nulldist_perposimp})
54
~/.conda/envs/tf1.3env/lib/python3.6/site-packages/modisco/tfmodisco_workflow/workflow.py in __call__(self, task_names, contrib_scores, hypothetical_contribs, one_hot, null_per_pos_scores, per_position_contrib_scores, revcomp, other_tracks, just_return_seqlets, plot_save_dir)
392 other_comparison_track_names=[])
393 seqlets_to_patterns_result = seqlets_to_patterns(
--> 394 metacluster_seqlets)
395 else:
396 seqlets_to_patterns_result = None
~/.conda/envs/tf1.3env/lib/python3.6/site-packages/modisco/tfmodisco_workflow/seqlets_to_patterns.py in __call__(self, seqlets)
840 cluster_indices=cluster_results.cluster_indices,
841 sign_consistency_check=True,
--> 842 min_seqlets_in_motif=0)
843
844 #obtain unique seqlets from adjusted motifs
~/.conda/envs/tf1.3env/lib/python3.6/site-packages/modisco/tfmodisco_workflow/seqlets_to_patterns.py in get_cluster_to_aggregate_motif(self, seqlets, cluster_indices, sign_consistency_check, min_seqlets_in_motif)
651 +" seqlets due to sign disagreement")
652 cluster_to_eliminated_motif[i] = motif
--> 653 cluster_to_motif[i] = motif
654 return cluster_to_motif, cluster_to_eliminated_motif
655
UnboundLocalError: local variable 'motif' referenced before assignment
This is very strange error and Is don't know why it's happening. The input type, size of all the examples are the same which makes is even more strange.
def get_cluster_to_aggregate_motif(self, seqlets, cluster_indices,
sign_consistency_check,
min_seqlets_in_motif):
num_clusters = max(cluster_indices+1)
cluster_to_seqlets = defaultdict(list)
assert len(seqlets)==len(cluster_indices)
for seqlet,idx in zip(seqlets, cluster_indices):
cluster_to_seqlets[idx].append(seqlet)
cluster_to_motif = OrderedDict()
cluster_to_eliminated_motif = OrderedDict()
for i in range(num_clusters):
if (len(cluster_to_seqlets[i]) >= min_seqlets_in_motif):
if (self.verbose):
print("Aggregating for cluster "+str(i)+" with "
+str(len(cluster_to_seqlets[i]))+" seqlets")
print_memory_use()
sys.stdout.flush()
motifs = self.seqlet_aggregator(cluster_to_seqlets[i])
assert len(motifs)<=1
**if (len(motifs) > 0):
motif = motifs[0]**
if (sign_consistency_check==False or
self.sign_consistency_func(motif)):
cluster_to_motif[i] = motif
else:
if (self.verbose):
print("Dropping cluster "+str(i)+
" with "+str(motif.num_seqlets)
+" seqlets due to sign disagreement")
cluster_to_eliminated_motif[i] = motif
cluster_to_motif[i] = motif
return cluster_to_motif, cluster_to_eliminated_motif
MEMORY 0.725680128
On task task0
Computing windowed sums on original
Generating null dist
peak(mu)= -2.3275281772017475
Computing threshold
Thresholds from null dist were -20.881900787353516 and 12.298645496368408
Passing windows frac was 1.604938271604938e-05 , which is below 0.03 ; adjusting
Final raw thresholds are -6.489653731584548 and 6.489653731584548
Final transformed thresholds are -0.97 and 0.97
Got 21719 coords
After resolving overlaps, got 21719 seqlets
Across all tasks, the weakest transformed threshold used was: 0.9699
MEMORY 1.04849408
21719 identified in total
min_metacluster_size_frac * len(seqlets) = 217 is more than min_metacluster_size=100.
Using it as a new min_metacluster_size
2 activity patterns with support >= 217 out of 2 possible patterns
Metacluster sizes: [19485, 2234]
Idx to activities: {0: '-1', 1: '1'}
MEMORY 1.0488832
On metacluster 1
Metacluster size 2234
Relevant tasks: ('task0',)
Relevant signs: (1,)
TfModiscoSeqletsToPatternsFactory: seed=1234
(Round 1) num seqlets: 2234
(Round 1) Computing coarse affmat
MEMORY 1.0492928
Beginning embedding computation
Computing embeddings
Using TensorFlow backend.
Finished embedding computation in 23.11 s
Starting affinity matrix computations
Normalization computed in 0.97 s
Cosine similarity mat computed in 1.87 s
Normalization computed in 1.0 s
Cosine similarity mat computed in 1.89 s
Finished affinity matrix computations in 3.8 s
(Round 1) Compute nearest neighbors from coarse affmat
MEMORY 1.617543168
Computed nearest neighbors in 0.43 s
MEMORY 1.644843008
(Round 1) Computing affinity matrix on nearest neighbors
MEMORY 1.644843008
Launching nearest neighbors affmat calculation job
MEMORY 1.645068288
Parallel runs completed
MEMORY 1.679843328
Job completed in: 19.56 s
MEMORY 1.679843328
Launching nearest neighbors affmat calculation job
MEMORY 1.679843328
Parallel runs completed
MEMORY 1.693884416
Job completed in: 19.6 s
MEMORY 1.693884416
(Round 1) Computed affinity matrix on nearest neighbors in 39.7 s
MEMORY 1.693884416
Filtered down to 1428 of 2234
(Round 1) Retained 1428 rows out of 2234 after filtering
MEMORY 1.693884416
(Round 1) Computing density adapted affmat
MEMORY 1.693884416
[t-SNE] Computing 31 nearest neighbors...
[t-SNE] Indexed 1428 samples in 0.002s...
[t-SNE] Computed neighbors for 1428 samples in 0.019s...
[t-SNE] Computed conditional probabilities for sample 1000 / 1428
[t-SNE] Computed conditional probabilities for sample 1428 / 1428
[t-SNE] Mean sigma: 0.252760
(Round 1) Computing clustering
MEMORY 1.694502912
Beginning preprocessing + Leiden
0%| | 0/50 [00:00<?, ?it/s]Quality: 0.6641347090604255
4%|▍ | 2/50 [00:00<00:11, 4.12it/s]Quality: 0.6646815153647481
30%|███ | 15/50 [00:05<00:11, 3.12it/s]Quality: 0.6647057219061275
44%|████▍ | 22/50 [00:07<00:10, 2.72it/s]Quality: 0.664788009501556
46%|████▌ | 23/50 [00:08<00:10, 2.66it/s]Quality: 0.6648110658355727
54%|█████▍ | 27/50 [00:09<00:07, 2.92it/s]Quality: 0.6648135041051698
80%|████████ | 40/50 [00:14<00:03, 2.88it/s]Quality: 0.6649336606412637
100%|██████████| 50/50 [00:17<00:00, 2.88it/s]Got 19 clusters after round 1
Counts:
{10: 28, 3: 168, 12: 11, 6: 98, 1: 186, 4: 160, 2: 181, 8: 75, 9: 53, 0: 231, 5: 108, 18: 3, 7: 84, 11: 19, 14: 5, 16: 4, 15: 4, 13: 7, 17: 3}
MEMORY 1.69637888
(Round 1) Aggregating seqlets in each cluster
MEMORY 1.69637888
Aggregating for cluster 0 with 231 seqlets
MEMORY 1.69637888
Trimmed 6 out of 231
Skipped 131 seqlets
Aggregating for cluster 1 with 186 seqlets
MEMORY 1.69637888
Trimmed 14 out of 186
Skipped 85 seqlets
Aggregating for cluster 2 with 181 seqlets
MEMORY 1.69637888
Trimmed 8 out of 181
Skipped 83 seqlets
Aggregating for cluster 3 with 168 seqlets
MEMORY 1.69637888
Trimmed 8 out of 168
Skipped 79 seqlets
Aggregating for cluster 4 with 160 seqlets
MEMORY 1.696632832
Trimmed 21 out of 160
Skipped 64 seqlets
Aggregating for cluster 5 with 108 seqlets
MEMORY 1.696632832
Trimmed 14 out of 108
Skipped 35 seqlets
Aggregating for cluster 6 with 98 seqlets
MEMORY 1.696903168
Trimmed 11 out of 98
Skipped 41 seqlets
Aggregating for cluster 7 with 84 seqlets
MEMORY 1.696903168
Trimmed 5 out of 84
Skipped 38 seqlets
Aggregating for cluster 8 with 75 seqlets
MEMORY 1.696903168
Trimmed 16 out of 75
Skipped 20 seqlets
Aggregating for cluster 9 with 53 seqlets
MEMORY 1.697173504
Trimmed 1 out of 53
Skipped 24 seqlets
Aggregating for cluster 10 with 28 seqlets
MEMORY 1.697173504
Trimmed 4 out of 28
Skipped 5 seqlets
Dropping cluster 10 with 19 seqlets due to sign disagreement
Aggregating for cluster 11 with 19 seqlets
MEMORY 1.697173504
Trimmed 0 out of 19
Skipped 13 seqlets
Aggregating for cluster 12 with 11 seqlets
MEMORY 1.697173504
Trimmed 1 out of 11
Skipped 6 seqlets
Skipped 1 seqlets
Dropping cluster 12 with 3 seqlets due to sign disagreement
Aggregating for cluster 13 with 7 seqlets
MEMORY 1.697173504
Trimmed 0 out of 7
Skipped 4 seqlets
Aggregating for cluster 14 with 5 seqlets
MEMORY 1.697173504
Trimmed 0 out of 5
Skipped 4 seqlets
Aggregating for cluster 15 with 4 seqlets
MEMORY 1.697173504
Trimmed 0 out of 4
Skipped 2 seqlets
Aggregating for cluster 16 with 4 seqlets
MEMORY 1.697173504
Trimmed 0 out of 4
Skipped 3 seqlets
Aggregating for cluster 17 with 3 seqlets
MEMORY 1.697173504
Trimmed 0 out of 3
Skipped 2 seqlets
Aggregating for cluster 18 with 3 seqlets
MEMORY 1.697173504
Trimmed 0 out of 3
Skipped 1 seqlets
(Round 2) num seqlets: 678
(Round 2) Computing coarse affmat
MEMORY 1.697173504
Beginning embedding computation
Computing embeddings
Finished embedding computation in 8.51 s
Starting affinity matrix computations
Normalization computed in 0.31 s
Cosine similarity mat computed in 0.44 s
Normalization computed in 0.34 s
Cosine similarity mat computed in 0.46 s
Finished affinity matrix computations in 0.9 s
(Round 2) Compute nearest neighbors from coarse affmat
MEMORY 1.32960256
Computed nearest neighbors in 0.18 s
MEMORY 1.310908416
(Round 2) Computing affinity matrix on nearest neighbors
MEMORY 1.310908416
Launching nearest neighbors affmat calculation job
MEMORY 1.310908416
Parallel runs completed
MEMORY 1.313882112
Job completed in: 9.12 s
MEMORY 1.313882112
Launching nearest neighbors affmat calculation job
MEMORY 1.313882112
Parallel runs completed
MEMORY 1.316995072
Job completed in: 9.12 s
MEMORY 1.31678208
(Round 2) Computed affinity matrix on nearest neighbors in 18.41 s
MEMORY 1.31678208
Not applying filtering for rounds above first round
MEMORY 1.31678208
(Round 2) Computing density adapted affmat
MEMORY 1.31678208
[t-SNE] Computing 31 nearest neighbors...
[t-SNE] Indexed 678 samples in 0.000s...
[t-SNE] Computed neighbors for 678 samples in 0.005s...
[t-SNE] Computed conditional probabilities for sample 678 / 678
[t-SNE] Mean sigma: 0.239224
(Round 2) Computing clustering
MEMORY 1.31678208
Beginning preprocessing + Leiden
0%| | 0/50 [00:00<?, ?it/s]Quality: 0.5880064841766943
Quality: 0.5885924241506224
4%|▍ | 2/50 [00:00<00:05, 9.59it/s]Quality: 0.5889366171256917
6%|▌ | 3/50 [00:00<00:05, 8.94it/s]Quality: 0.5895947801572112
48%|████▊ | 24/50 [00:02<00:02, 9.23it/s]Quality: 0.589600400957549
58%|█████▊ | 29/50 [00:03<00:02, 8.15it/s]Quality: 0.5900198475942349
100%|██████████| 50/50 [00:05<00:00, 8.84it/s]Got 13 clusters after round 2
Counts:
{10: 27, 0: 148, 9: 32, 8: 35, 2: 77, 5: 51, 6: 41, 1: 99, 4: 56, 11: 4, 3: 67, 7: 38, 12: 3}
MEMORY 1.317494784
(Round 2) Aggregating seqlets in each cluster
MEMORY 1.317494784
Aggregating for cluster 0 with 148 seqlets
MEMORY 1.317494784
Trimmed 14 out of 148
Skipped 36 seqlets
Aggregating for cluster 1 with 99 seqlets
MEMORY 1.317494784
Trimmed 8 out of 99
Skipped 30 seqlets
Aggregating for cluster 2 with 77 seqlets
MEMORY 1.317494784
Trimmed 7 out of 77
Skipped 30 seqlets
Aggregating for cluster 3 with 67 seqlets
MEMORY 1.317494784
Trimmed 12 out of 67
Skipped 15 seqlets
Aggregating for cluster 4 with 56 seqlets
MEMORY 1.317494784
Trimmed 20 out of 56
Skipped 4 seqlets
Aggregating for cluster 5 with 51 seqlets
MEMORY 1.317494784
Trimmed 4 out of 51
Skipped 22 seqlets
Aggregating for cluster 6 with 41 seqlets
MEMORY 1.317494784
Trimmed 1 out of 41
Skipped 12 seqlets
Aggregating for cluster 7 with 38 seqlets
MEMORY 1.317494784
Trimmed 5 out of 38
Skipped 11 seqlets
Aggregating for cluster 8 with 35 seqlets
MEMORY 1.317494784
Trimmed 23 out of 35
Skipped 2 seqlets
Dropping cluster 8 with 10 seqlets due to sign disagreement
Aggregating for cluster 9 with 32 seqlets
MEMORY 1.317494784
Trimmed 1 out of 32
Skipped 11 seqlets
Aggregating for cluster 10 with 27 seqlets
MEMORY 1.317494784
Trimmed 4 out of 27
Skipped 8 seqlets
Aggregating for cluster 11 with 4 seqlets
MEMORY 1.317494784
Trimmed 0 out of 4
Aggregating for cluster 12 with 3 seqlets
MEMORY 1.317494784
Trimmed 0 out of 3
Got 13 clusters
Splitting into subclusters...
MEMORY 1.317494784
Inspecting for spurious merging
Wrote graph to binary file in 0.0877983570098877 seconds
Running Louvain modularity optimization
After 1 runs, maximum modularity is Q = 0.00366525
After 2 runs, maximum modularity is Q = 0.00459325
After 6 runs, maximum modularity is Q = 0.00459326
After 19 runs, maximum modularity is Q = 0.00459755
Louvain completed 39 runs in 2.8975212574005127 seconds
Similarity is 0.87047726; is_dissimilar is False
Inspecting for spurious merging
Wrote graph to binary file in 0.040494441986083984 seconds
Running Louvain modularity optimization
After 1 runs, maximum modularity is Q = 0.00184102
After 3 runs, maximum modularity is Q = 0.00196909
After 4 runs, maximum modularity is Q = 0.00199081
After 9 runs, maximum modularity is Q = 0.00201487
Louvain completed 29 runs in 1.6093993186950684 seconds
Similarity is 0.94781816; is_dissimilar is False
Inspecting for spurious merging
Wrote graph to binary file in 0.03618764877319336 seconds
Running Louvain modularity optimization
After 1 runs, maximum modularity is Q = 0.005053
Louvain completed 21 runs in 0.8584208488464355 seconds
Similarity is 0.77573985; is_dissimilar is True
Got 2 subclusters
Inspecting for spurious merging
Wrote graph to binary file in 0.03833961486816406 seconds
Running Louvain modularity optimization
After 1 runs, maximum modularity is Q = 0.00128103
After 3 runs, maximum modularity is Q = 0.00162226
After 23 runs, maximum modularity is Q = 0.00169374
After 41 runs, maximum modularity is Q = 0.00169375
Louvain completed 61 runs in 2.6738028526306152 seconds
Similarity is 0.93972546; is_dissimilar is False
Inspecting for spurious merging
Wrote graph to binary file in 0.028965473175048828 seconds
Running Louvain modularity optimization
After 1 runs, maximum modularity is Q = 0.0028314
After 16 runs, maximum modularity is Q = 0.00283141
Louvain completed 36 runs in 1.5165183544158936 seconds
Similarity is 0.8591566; is_dissimilar is False
Merging on 14 clusters
MEMORY 1.320300544
On merging iteration 1
Computing pattern to seqlet distances
Computing pattern to pattern distances
Collapsing 1 & 4 with prob 2.67478323550952e-05 and sim 0.9289754111263918
Collapsing 1 & 7 with prob 1.0721644058876706e-05 and sim 0.8732028830389162
Trimmed 0 out of 101
Skipped 9 seqlets
Trimmed 1 out of 120
Skipped 9 seqlets
On merging iteration 2
Computing pattern to seqlet distances
Computing pattern to pattern distances
Got 12 patterns after merging
MEMORY 1.32102144
Performing seqlet reassignment
MEMORY 1.32102144
Cross contin jaccard time taken: 5.29 s
Cross contin jaccard time taken: 0.03 s
Discarded 26 seqlets
Skipped 25 seqlets
Skipped 11 seqlets
Skipped 58 seqlets
Got 3 patterns after reassignment
MEMORY 1.322172416
Total time taken is 149.47s
MEMORY 1.322205184
On metacluster 0
Metacluster size 19485
Relevant tasks: ('task0',)
Relevant signs: (-1,)
TfModiscoSeqletsToPatternsFactory: seed=1234
(Round 1) num seqlets: 19485
(Round 1) Computing coarse affmat
MEMORY 1.314852864
Beginning embedding computation
Computing embeddings
Finished embedding computation in 204.75 s
Starting affinity matrix computations
Normalization computed in 8.19 s
Cosine similarity mat computed in 78.17 s
Normalization computed in 8.39 s
Cosine similarity mat computed in 80.0 s
Finished affinity matrix computations in 161.0 s
(Round 1) Compute nearest neighbors from coarse affmat
MEMORY 7.240065024
Computed nearest neighbors in 23.25 s
MEMORY 7.478202368
(Round 1) Computing affinity matrix on nearest neighbors
MEMORY 7.478202368
Launching nearest neighbors affmat calculation job
MEMORY 7.478747136
Parallel runs completed
MEMORY 7.625007104
Job completed in: 176.31 s
MEMORY 7.625007104
Launching nearest neighbors affmat calculation job
MEMORY 7.6225536
Parallel runs completed
MEMORY 7.699324928
Job completed in: 176.71 s
MEMORY 10.58056192
(Round 1) Computed affinity matrix on nearest neighbors in 358.36 s
MEMORY 10.733633536
Filtered down to 11479 of 19485
(Round 1) Retained 11479 rows out of 19485 after filtering
MEMORY 10.73389568
(Round 1) Computing density adapted affmat
MEMORY 6.177910784
[t-SNE] Computing 31 nearest neighbors...
[t-SNE] Indexed 11479 samples in 0.103s...
[t-SNE] Computed neighbors for 11479 samples in 0.605s...
[t-SNE] Computed conditional probabilities for sample 1000 / 11479
[t-SNE] Computed conditional probabilities for sample 2000 / 11479
[t-SNE] Computed conditional probabilities for sample 3000 / 11479
[t-SNE] Computed conditional probabilities for sample 4000 / 11479
[t-SNE] Computed conditional probabilities for sample 5000 / 11479
[t-SNE] Computed conditional probabilities for sample 6000 / 11479
[t-SNE] Computed conditional probabilities for sample 7000 / 11479
[t-SNE] Computed conditional probabilities for sample 8000 / 11479
[t-SNE] Computed conditional probabilities for sample 9000 / 11479
[t-SNE] Computed conditional probabilities for sample 10000 / 11479
[t-SNE] Computed conditional probabilities for sample 11000 / 11479
[t-SNE] Computed conditional probabilities for sample 11479 / 11479
[t-SNE] Mean sigma: 0.258674
(Round 1) Computing clustering
MEMORY 6.177910784
Beginning preprocessing + Leiden
0%| | 0/50 [00:00<?, ?it/s]Quality: 0.7514436404431755
2%|▏ | 1/50 [00:05<04:38, 5.68s/it]Quality: 0.7542646129977288
14%|█▍ | 7/50 [00:35<03:37, 5.06s/it]Quality: 0.7549363507610374
40%|████ | 20/50 [02:01<03:00, 6.03s/it]Quality: 0.7549657141623181
100%|██████████| 50/50 [05:06<00:00, 6.13s/it]Got 24 clusters after round 1
Counts:
{2: 1522, 1: 1875, 3: 1115, 4: 1017, 8: 524, 12: 60, 6: 883, 11: 157, 7: 822, 20: 3, 9: 208, 10: 170, 0: 2090, 17: 5, 5: 950, 13: 26, 19: 4, 21: 2, 18: 5, 14: 24, 15: 8, 22: 2, 16: 5, 23: 2}
MEMORY 6.178697216
(Round 1) Aggregating seqlets in each cluster
MEMORY 6.178697216
Aggregating for cluster 0 with 2090 seqlets
MEMORY 6.178697216
Trimmed 192 out of 2090
Skipped 1284 seqlets
Aggregating for cluster 1 with 1875 seqlets
MEMORY 6.181855232
Trimmed 40 out of 1875
Skipped 1090 seqlets
Aggregating for cluster 2 with 1522 seqlets
MEMORY 6.183706624
Trimmed 49 out of 1522
Skipped 844 seqlets
Aggregating for cluster 3 with 1115 seqlets
MEMORY 6.18489856
Trimmed 56 out of 1115
Skipped 588 seqlets
Aggregating for cluster 4 with 1017 seqlets
MEMORY 6.185091072
Trimmed 48 out of 1017
Skipped 545 seqlets
Aggregating for cluster 5 with 950 seqlets
MEMORY 6.187085824
Trimmed 58 out of 950
Skipped 507 seqlets
Aggregating for cluster 6 with 883 seqlets
MEMORY 6.187180032
Trimmed 38 out of 883
Skipped 471 seqlets
Aggregating for cluster 7 with 822 seqlets
MEMORY 6.187864064
Trimmed 35 out of 822
Skipped 431 seqlets
Aggregating for cluster 8 with 524 seqlets
MEMORY 6.18852352
Trimmed 30 out of 524
Skipped 280 seqlets
Aggregating for cluster 9 with 208 seqlets
MEMORY 6.1896704
Trimmed 8 out of 208
Skipped 109 seqlets
Aggregating for cluster 10 with 170 seqlets
MEMORY 6.1896704
Trimmed 6 out of 170
Skipped 84 seqlets
Aggregating for cluster 11 with 157 seqlets
MEMORY 6.1896704
Trimmed 7 out of 157
Skipped 65 seqlets
Aggregating for cluster 12 with 60 seqlets
MEMORY 6.1896704
Trimmed 17 out of 60
Skipped 6 seqlets
Skipped 1 seqlets
Aggregating for cluster 13 with 26 seqlets
MEMORY 6.189678592
Trimmed 0 out of 26
Skipped 17 seqlets
Aggregating for cluster 14 with 24 seqlets
MEMORY 6.189678592
Trimmed 5 out of 24
Skipped 9 seqlets
Aggregating for cluster 15 with 8 seqlets
MEMORY 6.189678592
Trimmed 0 out of 8
Skipped 4 seqlets
Aggregating for cluster 16 with 5 seqlets
MEMORY 6.189678592
Trimmed 0 out of 5
Skipped 2 seqlets
Aggregating for cluster 17 with 5 seqlets
MEMORY 6.189678592
Trimmed 0 out of 5
Skipped 2 seqlets
Aggregating for cluster 18 with 5 seqlets
MEMORY 6.189678592
Trimmed 0 out of 5
Skipped 2 seqlets
Aggregating for cluster 19 with 4 seqlets
MEMORY 6.189678592
Trimmed 0 out of 4
Skipped 2 seqlets
Aggregating for cluster 20 with 3 seqlets
MEMORY 6.189678592
Trimmed 0 out of 3
Skipped 1 seqlets
Aggregating for cluster 21 with 2 seqlets
MEMORY 6.189678592
Trimmed 0 out of 2
Aggregating for cluster 22 with 2 seqlets
MEMORY 6.189678592
Trimmed 0 out of 2
Skipped 1 seqlets
Aggregating for cluster 23 with 2 seqlets
MEMORY 6.189678592
Trimmed 0 out of 2
Skipped 1 seqlets
(Round 2) num seqlets: 4544
(Round 2) Computing coarse affmat
MEMORY 6.189678592
Beginning embedding computation
Computing embeddings
Finished embedding computation in 57.22 s
Starting affinity matrix computations
Normalization computed in 1.91 s
Cosine similarity mat computed in 5.64 s
Normalization computed in 1.96 s
Cosine similarity mat computed in 5.52 s
Finished affinity matrix computations in 11.3 s
(Round 2) Compute nearest neighbors from coarse affmat
MEMORY 6.189678592
Computed nearest neighbors in 1.9 s
MEMORY 6.007017472
(Round 2) Computing affinity matrix on nearest neighbors
MEMORY 6.007017472
Launching nearest neighbors affmat calculation job
MEMORY 6.007017472
Parallel runs completed
MEMORY 6.010351616
Job completed in: 62.09 s
MEMORY 6.010351616
Launching nearest neighbors affmat calculation job
MEMORY 6.010351616
Parallel runs completed
MEMORY 6.01032704
Job completed in: 62.31 s
MEMORY 6.0102656
(Round 2) Computed affinity matrix on nearest neighbors in 125.49 s
MEMORY 6.0102656
Not applying filtering for rounds above first round
MEMORY 6.0102656
(Round 2) Computing density adapted affmat
MEMORY 6.0102656
[t-SNE] Computing 31 nearest neighbors...
[t-SNE] Indexed 4544 samples in 0.016s...
[t-SNE] Computed neighbors for 4544 samples in 0.132s...
[t-SNE] Computed conditional probabilities for sample 1000 / 4544
[t-SNE] Computed conditional probabilities for sample 2000 / 4544
[t-SNE] Computed conditional probabilities for sample 3000 / 4544
[t-SNE] Computed conditional probabilities for sample 4000 / 4544
[t-SNE] Computed conditional probabilities for sample 4544 / 4544
[t-SNE] Mean sigma: 0.235279
(Round 2) Computing clustering
MEMORY 6.0102656
Beginning preprocessing + Leiden
0%| | 0/50 [00:00<?, ?it/s]Quality: 0.7117903305258136
70%|███████ | 35/50 [00:45<00:18, 1.24s/it]Quality: 0.7119394059910836
92%|█████████▏| 46/50 [00:59<00:04, 1.17s/it]Quality: 0.7121246762215024
100%|██████████| 50/50 [01:05<00:00, 1.31s/it]Got 12 clusters after round 2
Counts:
{0: 1096, 1: 730, 2: 675, 5: 395, 9: 65, 10: 52, 6: 306, 11: 11, 3: 582, 4: 467, 7: 88, 8: 77}
MEMORY 6.011097088
(Round 2) Aggregating seqlets in each cluster
MEMORY 6.011097088
Aggregating for cluster 0 with 1096 seqlets
MEMORY 6.011097088
Trimmed 388 out of 1096
Skipped 708 seqlets
---------------------------------------------------------------------------
UnboundLocalError Traceback (most recent call last)
in
18 [hyp_impscores, impscores, onehot_data] = pickle.load(open('modisco_input_'+model_id_list[i]+'_'+data_type_list[i]+'_'+str('all_outputs' if target_range_list[i] is None else target_range_list[i])+'.sav', 'rb'))
19
---> 20 run_modisco(hyp_impscores, impscores, onehot_data)
21
22 #zip outputfolder
in run_modisco(hyp_impscores, impscores, onehot_data)
50 contrib_scores={'task0': impscores},
51 hypothetical_contribs={'task0': hyp_impscores},
---> 52 one_hot=onehot_data)#,
53 #null_per_pos_scores={'task0': nulldist_perposimp})
54
~/.conda/envs/tf1.3env/lib/python3.6/site-packages/modisco/tfmodisco_workflow/workflow.py in __call__(self, task_names, contrib_scores, hypothetical_contribs, one_hot, null_per_pos_scores, per_position_contrib_scores, revcomp, other_tracks, just_return_seqlets, plot_save_dir)
392 other_comparison_track_names=[])
393 seqlets_to_patterns_result = seqlets_to_patterns(
--> 394 metacluster_seqlets)
395 else:
396 seqlets_to_patterns_result = None
~/.conda/envs/tf1.3env/lib/python3.6/site-packages/modisco/tfmodisco_workflow/seqlets_to_patterns.py in __call__(self, seqlets)
840 cluster_indices=cluster_results.cluster_indices,
841 sign_consistency_check=True,
--> 842 min_seqlets_in_motif=0)
843
844 #obtain unique seqlets from adjusted motifs
~/.conda/envs/tf1.3env/lib/python3.6/site-packages/modisco/tfmodisco_workflow/seqlets_to_patterns.py in get_cluster_to_aggregate_motif(self, seqlets, cluster_indices, sign_consistency_check, min_seqlets_in_motif)
651 +" seqlets due to sign disagreement")
652 cluster_to_eliminated_motif[i] = motif
--> 653 cluster_to_motif[i] = motif
654 return cluster_to_motif, cluster_to_eliminated_motif
655
UnboundLocalError: local variable 'motif' referenced before assignment