We can extend the pseudocode in "2-break on genome graph1" to a 2-break defined on a genome $$P$$.

2-BreakOnGenome(G, i, j, k, l)
    GgraphBlackEdges(G) and ColoredEdges(G)
    Ggraph2-BreakOnGenomeGraph(Ggraph, i, j, k, l)
    GGraphToGenome(Ggraph)
    return G

Assignment

Add a method two_break to the class Genome that implements 2-BreakOnGenome. The method takes four integer arguments and returns the genome (an object of the class Genome) that results from applying the 2-break on the genome on which the method is called. Feel free to choose whether the method returns a new Genome object (immutable objects) or changes the state of the Genome object on which it is called (mutable objects).

Example

>>> Genome(Chromosome(+1, -2, -4, +3)).two_break(1, 6, 3, 8)
Genome(Chromosome(-2, 1), Chromosome(-3, 4))