Implement 2-BreakOnGenome solved by 187

Sept. 7, 2015, 4:12 p.m. by Rosalind Team

We can extend the pseudocode in “Implement 2-BreakOnGenomeGraph” to a 2-break defined on genome P.

2-BreakOnGenome(P, i, i′, j, j′)
     GenomeGraphBlackEdges(P) and ColoredEdges(P)
     GenomeGraph2-BreakOnGenomeGraph(GenomeGraph, i, i′, j, j′)
     P ← GraphToGenome(GenomeGraph)
     return P

Implement 2-BreakOnGenome

Solve the 2-Break On Genome Graph Problem.

Given: A genome P, followed by indices i, i', j, and j'.

Return: The genome P' resulting from applying the 2-break operation.

Sample Dataset

(+1 -2 -4 +3)
1, 6, 3, 8

Sample Output

(+2 -1) (-3 +4)

Extra Dataset

Please login to solve this problem.