Skip to content

error #1

@diego-rt

Description

@diego-rt

hey there!

First of all thanks for the exciting tool! I was testing it out on this tangle that I kinda have an idea for how it should be solved, although there is a single long-ish homozygous node somewhere in the middle that kinda breaks the phasing. Not sure if that is the cause of this error?

Image
00:00:00 - INFO - [setup_logging:65] - GitHub Commit Hash: 1aa8312e42cbd60a3f2fd576eea433b40d3664cd
00:00:00 - INFO - [setup_logging:70] - Command-line arguments: /groups/tanaka/People/current/Diego/Projects/0_Global/bin/TTT//TTT.py --graph verkko_hybrid_dorado_correct_k75000/assembly.homopolymer-compressed.gfa --alignment ont_alignments.gaf --outdir TTT_results --quality-threshold 20 --boundary-nodes verkko_hybrid_dorado_correct_k75000/boundary_nodes.tsv --coverage utig4_upt.ont-coverage.csv
00:00:00 - INFO - [setup_logging:71] - Logging to file: TTT_results/traversal.log
00:00:00 - INFO - [main:126] - Reading files...
00:00:00 - INFO - [parse_gfa:113] - Tuned non-transitive junctions: 18
00:00:00 - INFO - [read_coverage_file:256] - Reading coverage from utig4_upt.ont-coverage.csv
00:00:00 - INFO - [verify_coverage:314] - Total length of missing nodes in whole graph: 0 out of 36134517, median coverage 14.4 will be used
00:00:00 - INFO - [identify_tangle_nodes:440] - Unoriented distance between boundary nodes >utig4-37 and >utig4-38: 2077351, path length: 3
00:00:00 - WARNING - [identify_tangle_nodes:465] - Boundary nodes do not isolate tangle from the rest of the component!!!
00:00:00 - INFO - [identify_tangle_nodes:466] - Original component size: 99 nodes, Tangle size: 95
00:00:00 - INFO - [calculate_median_coverage:382] - Source: <utig4-37 coverage 17.6
00:00:00 - INFO - [calculate_median_coverage:383] - Sink: >utig4-38 coverage 17.4
00:00:00 - INFO - [calculate_median_coverage:382] - Source: >utig4-65 coverage 13.4
00:00:00 - INFO - [calculate_median_coverage:383] - Sink: <utig4-69 coverage 16.4
00:00:00 - INFO - [calculate_median_coverage:395] - Using coverage range based on boundary nodes [6.7, 21.12], you can provide a better estimate with --median-unique.
00:00:00 - INFO - [__init__:39] - 368 different alignment pattern used
00:00:00 - INFO - [__init__:44] - Built automaton with 368 unique alignment patterns
00:00:00 - INFO - [main:160] - Starting multiplicity counting...
Welcome to the CBC MILP Solver 
Version: 2.10.12 
Build Date: Aug  2 2025 

command line - cbc /tmp/09b6000a89ea4f4dbfd984aebfa07be0-pulp.mps -timeMode elapsed -branch -printingOptions all -solution /tmp/09b6000a89ea4f4dbfd984aebfa07be0-pulp.sol (default strategy 1)
At line 2 NAME          MODEL
At line 3 ROWS
At line 608 COLUMNS
At line 2634 RHS
At line 3238 BOUNDS
At line 3439 ENDATA
Problem MODEL has 603 rows, 298 columns and 1534 elements
Coin0008I MODEL read with 0 errors
Option for timeMode changed from cpu to elapsed
Continuous objective value is 3.98893e+06 - 0.19 seconds
Cgl0003I 0 fixed, 123 tightened bounds, 11 strengthened rows, 0 substitutions
Cgl0003I 0 fixed, 0 tightened bounds, 9 strengthened rows, 0 substitutions
Cgl0003I 0 fixed, 0 tightened bounds, 1 strengthened rows, 0 substitutions
Cgl0004I processed model has 315 rows, 219 columns (123 integer (0 of which binary)) and 1253 elements
Cbc0012I Integer solution of 10158603 found by DiveCoefficient after 0 iterations and 0 nodes (0.04 seconds)
Cbc0038I Full problem 315 rows 219 columns, reduced to 209 rows 128 columns - too large
Cbc0031I 29 added rows had average density of 93.758621
Cbc0013I At root node, 29 cuts changed objective from 3989046.9 to 9061192.3 in 100 passes
Cbc0014I Cut generator 0 (Probing) - 0 row cuts average 0.0 elements, 2 column cuts (6 active)  in 0.095 seconds - new frequency is -100
Cbc0014I Cut generator 1 (Gomory) - 2252 row cuts average 121.5 elements, 0 column cuts (0 active)  in 0.194 seconds - new frequency is 1
Cbc0014I Cut generator 2 (Knapsack) - 0 row cuts average 0.0 elements, 0 column cuts (0 active)  in 0.035 seconds - new frequency is -100
Cbc0014I Cut generator 3 (Clique) - 0 row cuts average 0.0 elements, 0 column cuts (0 active)  in 0.002 seconds - new frequency is -100
Cbc0014I Cut generator 4 (MixedIntegerRounding2) - 63 row cuts average 3.7 elements, 0 column cuts (0 active)  in 0.048 seconds - new frequency is -100
Cbc0014I Cut generator 5 (FlowCover) - 0 row cuts average 0.0 elements, 0 column cuts (0 active)  in 0.088 seconds - new frequency is -100
Cbc0014I Cut generator 6 (TwoMirCuts) - 432 row cuts average 25.0 elements, 0 column cuts (0 active)  in 0.137 seconds - new frequency is 1
Cbc0010I After 0 nodes, 1 on tree, 10158603 best solution, best possible 9061217.6 (0.85 seconds)
Cbc0012I Integer solution of 10079407 found by DiveCoefficient after 4200 iterations and 3 nodes (1.01 seconds)
Cbc0012I Integer solution of 10063021 found by DiveCoefficient after 4243 iterations and 4 nodes (1.03 seconds)
Cbc0012I Integer solution of 10025045 found by DiveCoefficient after 4246 iterations and 5 nodes (1.04 seconds)
Cbc0038I Full problem 315 rows 219 columns, reduced to 175 rows 107 columns - too large
Cbc0001I Search completed - best objective 10025045.03896104, took 5155 iterations and 44 nodes (1.35 seconds)
Cbc0032I Strong branching done 720 times (6682 iterations), fathomed 13 nodes and fixed 47 variables
Cbc0035I Maximum depth 8, 4 variables fixed on reduced cost
Cuts at root node changed objective from 3.98905e+06 to 9.06122e+06
Probing was tried 100 times and created 2 cuts of which 4 were active after adding rounds of cuts (0.095 seconds)
Gomory was tried 149 times and created 2284 cuts of which 0 were active after adding rounds of cuts (0.207 seconds)
Knapsack was tried 100 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.035 seconds)
Clique was tried 100 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.002 seconds)
MixedIntegerRounding2 was tried 100 times and created 63 cuts of which 0 were active after adding rounds of cuts (0.048 seconds)
FlowCover was tried 100 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.088 seconds)
TwoMirCuts was tried 149 times and created 700 cuts of which 0 were active after adding rounds of cuts (0.200 seconds)
ZeroHalf was tried 1 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.018 seconds)

Result - Optimal solution found

Objective value:                10025045.03896104
Enumerated nodes:               44
Total iterations:               5155
Time (CPU seconds):             2.57
Time (Wallclock seconds):       1.37

Option for printingOptions changed from normal to all
Total time (CPU seconds):       2.70   (Wallclock seconds):       1.38

00:00:02 - INFO - [solve_MIP:110] - Found multiplicities from MIP {'>utig4-1': 1, '>utig4-2': 1, '>utig4-3': 1, '>utig4-4': 1, '>utig4-5': 0, '>utig4-6': 1, '>utig4-7': 1, '>utig4-8': 1, '>utig4-9': 0, '>utig4-10': 2, '>utig4-11': 0, '>utig4-12': 1, '>utig4-13': 1, '>utig4-14': 1, '>utig4-15': 0, '>utig4-16': 1, '>utig4-17': 1, '>utig4-18': 0, '>utig4-19': 1, '>utig4-20': 2, '>utig4-21': 0, '>utig4-22': 1, '>utig4-23': 1, '>utig4-24': 1, '>utig4-25': 0, '>utig4-26': 2, '>utig4-27': 1, '>utig4-28': 0, '>utig4-29': 1, '>utig4-30': 0, '>utig4-31': 1, '>utig4-32': 1, '>utig4-33': 0, '>utig4-34': 1, '>utig4-35': 0, '>utig4-36': 1, '>utig4-37': 0, '>utig4-38': 1, '>utig4-39': 1, '>utig4-40': 1, '>utig4-41': 0, '>utig4-42': 0, '>utig4-43': 0, '>utig4-44': 1, '>utig4-45': 0, '>utig4-0': 2, '>utig4-46': 2, '>utig4-47': 2, '>utig4-49': 0, '>utig4-50': 2, '>utig4-51': 0, '>utig4-48': 1, '>utig4-52': 0, '>utig4-53': 0, '>utig4-54': 1, '>utig4-56': 1, '>utig4-57': 1, '>utig4-58': 1, '>utig4-55': 1, '>utig4-60': 1, '>utig4-61': 1, '>utig4-59': 0, '>utig4-62': 1, '>utig4-63': 0, '>utig4-64': 0, '>utig4-66': 1, '>utig4-67': 1, '>utig4-68': 1, '>utig4-65': 1, '>utig4-69': 0, '>utig4-70': 2, '>utig4-72': 0, '>utig4-73': 2, '>utig4-74': 1, '>utig4-71': 0, '>utig4-76': 1, '>utig4-75': 1, '>utig4-77': 1, '>utig4-79': 1, '>utig4-80': 0, '>utig4-81': 1, '>utig4-82': 0, '>utig4-78': 1, '>utig4-83': 1, '>utig4-85': 1, '>utig4-86': 0, '>utig4-87': 3, '>utig4-84': 0, '>utig4-88': 1, '>utig4-90': 0, '>utig4-91': 3, '>utig4-89': 0, '>utig4-93': 2, '>utig4-94': 0, '>utig4-95': 2, '>utig4-96': 1, '>utig4-97': 1, '>utig4-98': 1, '>utig4-92': 1, '<utig4-8': 1, '<utig4-34': 0, '<utig4-98': 1, '<utig4-97': 2, '<utig4-96': 1, '<utig4-95': 1, '<utig4-94': 1, '<utig4-93': 1, '<utig4-92': 1, '<utig4-91': 2, '<utig4-90': 1, '<utig4-89': 1, '<utig4-88': 0, '<utig4-87': 3, '<utig4-86': 1, '<utig4-85': 2, '<utig4-84': 1, '<utig4-83': 0, '<utig4-82': 1, '<utig4-81': 1, '<utig4-80': 0, '<utig4-79': 1, '<utig4-78': 1, '<utig4-77': 1, '<utig4-76': 2, '<utig4-75': 0, '<utig4-74': 1, '<utig4-73': 1, '<utig4-72': 1, '<utig4-71': 2, '<utig4-70': 2, '<utig4-69': 1, '<utig4-68': 1, '<utig4-67': 0, '<utig4-66': 1, '<utig4-65': 0, '<utig4-64': 0, '<utig4-63': 1, '<utig4-62': 0, '<utig4-61': 0, '<utig4-60': 1, '<utig4-59': 0, '<utig4-58': 0, '<utig4-57': 0, '<utig4-56': 1, '<utig4-55': 0, '<utig4-54': 1, '<utig4-53': 1, '<utig4-52': 0, '<utig4-51': 1, '<utig4-50': 1, '<utig4-49': 1, '<utig4-48': 1, '<utig4-47': 1, '<utig4-46': 3, '<utig4-45': 2, '<utig4-44': 0, '<utig4-43': 0, '<utig4-42': 1, '<utig4-41': 1, '<utig4-40': 0, '<utig4-9': 1, '<utig4-38': 0, '<utig4-37': 1, '<utig4-36': 1, '<utig4-35': 0, '<utig4-39': 1, '<utig4-0': 2, '<utig4-32': 1, '<utig4-31': 0, '<utig4-30': 1, '<utig4-29': 0, '<utig4-28': 1, '<utig4-33': 1, '<utig4-26': 0, '<utig4-25': 1, '<utig4-24': 0, '<utig4-23': 1, '<utig4-27': 1, '<utig4-21': 2, '<utig4-22': 0, '<utig4-19': 0, '<utig4-18': 0, '<utig4-17': 0, '<utig4-16': 0, '<utig4-15': 2, '<utig4-14': 1, '<utig4-20': 1, '<utig4-13': 0, '<utig4-11': 2, '<utig4-1': 0, '<utig4-10': 0, '<utig4-12': 2, '<utig4-7': 2, '<utig4-6': 0, '<utig4-5': 1, '<utig4-4': 1, '<utig4-3': 1, '<utig4-2': 2}
00:00:02 - INFO - [solve_MIP:113] - Unique coverage for the best MIP solution 15.3999999846, solution score 10025045.008234287
00:00:02 - INFO - [write_multiplicities:210] - Wrote multiplicity solutions to TTT_results/traversal.multiplicities.csv
00:00:02 - INFO - [create_dual_graph:44] - Creating dual graph representation (nodes = canonical connections) using NetworkX...
00:00:02 - INFO - [create_dual_graph:79] - Total oriented nodes in original GFA structure: 198
00:00:02 - INFO - [create_dual_graph:80] - Total unique canonical edges (dual nodes): 130
00:00:02 - INFO - [create_dual_graph:81] - Total nodes in final dual graph: 130
00:00:02 - INFO - [create_dual_graph:82] - Total edges (connections through original nodes) in dual graph: 198
00:00:02 - INFO - [create_multi_dual_graph:94] - Creating multi-dual graph from dual graph and multiplicities...
00:00:02 - INFO - [create_multi_dual_graph:152] - Created multi-dual graph with 126 nodes.
00:00:02 - INFO - [create_multi_dual_graph:153] - Added 165 edges to multi-dual graph based on multiplicities (original dual graph had 198 unique edges).
00:00:02 - INFO - [optimize_paths:32] - Starting optimization with 10 initial paths, max 100000 iterations per path.
00:00:02 - INFO - [get_traversable_subgraph:170] - Start and end vertices in the graph [(0, -37), (0, 65)], [(-37, 0), (65, 0)]
00:00:02 - INFO - [get_traversable_subgraph:189] - Added auxiliary edge from >utig4-38 to >utig4-65
00:00:02 - INFO - [get_traversable_subgraph:209] - Clearing unreachable edges: iteration 0 0 present
00:00:02 - INFO - [generate_random_eulerian_path:102] - Randomized Eulerian path found with seed 0 with 166 nodes !
00:00:02 - INFO - [optimize_paths:43] - Generating initial path with seed 0.
00:00:02 - INFO - [generate_random_eulerian_path:102] - Randomized Eulerian path found with seed 0 with 166 nodes !
00:00:02 - INFO - [optimize_paths:48] - Initial path score for seed 0: 1496.8000000000002.
00:00:02 - INFO - [optimize_paths:62] - Improved score for seed 0 at iteration 4: 1496.8000000000002 -> 1507.6.
00:00:02 - INFO - [optimize_paths:62] - Improved score for seed 0 at iteration 7: 1507.6 -> 1513.6.
00:00:02 - INFO - [optimize_paths:62] - Improved score for seed 0 at iteration 11: 1513.6 -> 1537.6000000000001.
00:00:02 - INFO - [optimize_paths:62] - Improved score for seed 0 at iteration 19: 1537.6000000000001 -> 1541.2000000000005.
00:00:02 - INFO - [optimize_paths:62] - Improved score for seed 0 at iteration 26: 1541.2000000000005 -> 1549.2000000000005.
00:00:02 - INFO - [optimize_paths:62] - Improved score for seed 0 at iteration 29: 1549.2000000000005 -> 1559.2000000000005.
00:00:02 - INFO - [optimize_paths:62] - Improved score for seed 0 at iteration 65: 1559.2000000000005 -> 1569.2000000000005.
00:00:02 - INFO - [optimize_paths:62] - Improved score for seed 0 at iteration 68: 1569.2000000000005 -> 1592.0000000000005.
00:00:02 - INFO - [optimize_paths:62] - Improved score for seed 0 at iteration 79: 1592.0000000000005 -> 1597.0000000000005.
00:00:02 - INFO - [optimize_paths:62] - Improved score for seed 0 at iteration 80: 1597.0000000000005 -> 1597.2000000000005.
00:00:02 - INFO - [optimize_paths:62] - Improved score for seed 0 at iteration 90: 1597.2000000000005 -> 1597.8000000000009.
00:00:02 - INFO - [optimize_paths:62] - Improved score for seed 0 at iteration 93: 1597.8000000000009 -> 1621.000000000001.
Traceback (most recent call last):
  File "/groups/tanaka/People/current/Diego/Projects/0_Global/bin/TTT//TTT.py", line 181, in <module>
    main()
  File "/groups/tanaka/People/current/Diego/Projects/0_Global/bin/TTT//TTT.py", line 177, in main
    optimize_paths(multi_graph, boundary_nodes, original_graph, args.num_initial_paths, args.max_iterations, args.early_stopping_limit, alignment_scorer, output_fasta, output_gaf)
  File "/groups/tanaka/People/current/Diego/Projects/0_Global/bin/TTT//TTT.py", line 56, in optimize_paths
    new_path = pathOptimizer.get_random_change(seed * max_iterations + i)
  File "/groups/tanaka/People/current/Diego/Projects/0_Global/bin/TTT/src/path_optimizer.py", line 166, in get_random_change
    rc_start_v = self.rc_vertex_map[start_vertex]
KeyError: (0, -38)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions