@pytest.fixture
def right_triple_fork_structure(request, right_double_fork_structure, random_sequence):
 (graph, core_sequence, L, HDN, R, top_sequence) = right_double_fork_structure
 bottom_branch = random_sequence(exclude=(core_sequence + top_sequence))
 print(len(core_sequence), len(top_sequence), len(bottom_branch))
 bases = {'A', 'C', 'G', 'T'}
 mutated = random.choice(list((bases - {R[(-1)], top_sequence[((R.pos + K) - 1)]})))
 bottom_sequence = ((core_sequence[:(HDN.pos + K)] + mutated) + bottom_branch)
 graph.consume(bottom_sequence)
 core_hdns = hdn_counts(core_sequence, graph)
 top_hdns = hdn_counts(top_sequence, graph)
 bottom_hdns = hdn_counts(bottom_sequence, graph)
 if (not (core_hdns == top_hdns == bottom_hdns == {4: 1})):
  print(core_hdns, top_hdns, bottom_hdns)
  request.applymarker(pytest.mark.xfail)
 return (graph, core_sequence, L, HDN, R, top_sequence, bottom_sequence)

@ pytest . fixture def right_triple_fork_structure ( request , right_double_fork_structure , random_sequence ) : ( graph , core_sequence , L , HDN , R , top_sequence ) = right_double_fork_structure bottom_branch = random_sequence ( exclude = ( core_sequence + top_sequence ) ) print ( len ( core_sequence ) , len ( top_sequence ) , len ( bottom_branch ) ) bases = { 'A' , 'C' , 'G' , 'T' } mutated = random . choice ( list ( ( bases - { R [ ( - 1 ) ] , top_sequence [ ( ( R . pos + K ) - 1 ) ] } ) ) ) bottom_sequence = ( ( core_sequence [ : ( HDN . pos + K ) ] + mutated ) + bottom_branch ) graph . consume ( bottom_sequence ) core_hdns = hdn_counts ( core_sequence , graph ) top_hdns = hdn_counts ( top_sequence , graph ) bottom_hdns = hdn_counts ( bottom_sequence , graph ) if ( not ( core_hdns == top_hdns == bottom_hdns == { 4 : 1 } ) ) : print ( core_hdns , top_hdns , bottom_hdns ) request . applymarker ( pytest . mark . xfail ) return ( graph , core_sequence , L , HDN , R , top_sequence , bottom_sequence )
sets up a graph structure like so: top_branch →o~~o→o core_sequence ↗ [0]→o→o~~o→(l)→→(r)→o→o→o~~o→[-1] →o~~o→o bottom_branch where s is the start position of the high degreen node .