From 17d4ed61ee33b507741ea4d0e75218a553f2bfb7 Mon Sep 17 00:00:00 2001 From: Simon Crase Date: Fri, 12 Apr 2019 16:55:51 +1200 Subject: [PATCH] Issue #13 BA6D Find a Shortest Transformation of One Genome into Another by 2-Breaks --- BA6d.py | 5 +- README.md | 2 +- rosalind.wpr | 473 ++++++++++++++++++++++++++------------------------- 3 files changed, 249 insertions(+), 231 deletions(-) diff --git a/BA6d.py b/BA6d.py index 2895dce..f47ae57 100644 --- a/BA6d.py +++ b/BA6d.py @@ -15,7 +15,8 @@ # BA6D Find a Shortest Transformation of One Genome into Another by 2-Breaks - +def FindShortestTransformation(s,t): + pass if __name__=='__main__': - pass \ No newline at end of file + FindShortestTransformation((+1 -2 -3 +4),(+1 +2 -4 -3)) \ No newline at end of file diff --git a/README.md b/README.md index 2c72c41..1fc6461 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ NB: functions generally use zero based indexing; Rosalind uses 1-based. |BA6A|BA6A.py|[Implement GreedySorting to Sort a Permutation by Reversals ](http://rosalind.info/problems/ba6a/)| |BA6B|BA6B.py|[Compute the Number of Breakpoints in a Permutation](http://rosalind.info/problems/ba6b/)| |BA6C|BA6C.py|[Compute the 2-Break Distance Between a Pair of Genomes](http://rosalind.info/problems/ba6c/)| -|BA6D|TBP|[Find a Shortest Transformation of One Genome into Another by 2-Breaks](http://rosalind.info/problems/ba6d/)| +|BA6D|BA6D.py|[Find a Shortest Transformation of One Genome into Another by 2-Breaks](http://rosalind.info/problems/ba6d/) (wip)| |BA6E|fragile.py| [Find All Shared k-mers of a Pair of Strings ](http://rosalind.info/problems/ba6e/)| |BA6F|BA6F.py|[Implement Chromosome to Cycle](http://rosalind.info/problems/ba6f/)| |BA6G|BA6G.py|[Implement Cycle to Chromosome](http://rosalind.info/problems/ba6g/)| diff --git a/rosalind.wpr b/rosalind.wpr index 3e4142f..567f251 100644 --- a/rosalind.wpr +++ b/rosalind.wpr @@ -18,6 +18,7 @@ proj.file-list = [loc('2sum.py'), loc('BA6A.py'), loc('BA6B.py'), loc('BA6C.py'), + loc('BA6D.py'), loc('BA6F.py'), loc('BA6G.py'), loc('BA6H.py'), @@ -167,7 +168,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window', 'current_pages': [0], 'full-screen': False, 'notebook_display': 'normal', - 'notebook_percent': 0.24271844660194175, + 'notebook_percent': 0.24318349299926312, 'override_title': None, 'pagelist': [('project', 'tall', @@ -175,8 +176,8 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window', {'tree-state': {'file-sort-method': 'by name', 'list-files-first': False, 'tree-states': {'deep': {'expanded-nodes': [], - 'selected-nodes': [(33,)], - 'top-node': (31,)}}, + 'selected-nodes': [(14,)], + 'top-node': (0,)}}, 'tree-style': 'deep'}}), ('source-assistant', 'tall', @@ -240,7 +241,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window', 'fMatchCase': False, 'fOmitBinary': True, 'fRegexFlags': 42, - 'fReplaceText': u'', + 'fReplaceText': '', 'fReverse': False, 'fSearchText': u'subsequence', 'fStartPos': 0, @@ -327,276 +328,270 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window', 'toolbox-tree-sel': ''})], 'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('BA9C.py'), {'attrib-starts': [], - 'first-line': 112L, + 'first-line': 83L, 'folded-linenos': [], - 'sel-line': 130L, - 'sel-line-start': 4245L, - 'selection_end': 4276L, - 'selection_start': 4257L, + 'sel-line': 121L, + 'sel-line-start': 3875L, + 'selection_end': 3942L, + 'selection_start': 3884L, 'zoom': 0L}, - 1554609404.174], - [loc('BA9C.py'), + 1554778529.66], + [loc('bfs.py'), {'attrib-starts': [], - 'first-line': 0L, + 'first-line': 15L, 'folded-linenos': [], - 'sel-line': 0L, - 'sel-line-start': 0L, - 'selection_end': 684L, - 'selection_start': 0L, + 'sel-line': 59L, + 'sel-line-start': 1723L, + 'selection_end': 1723L, + 'selection_start': 1723L, 'zoom': 0L}, - 1554678206.634], - [loc('snp.py'), + 1554778594.416], + [loc('BA9C.py'), {'attrib-starts': [], - 'first-line': 0L, + 'first-line': 156L, 'folded-linenos': [], - 'sel-line': 14L, - 'sel-line-start': 686L, - 'selection_end': 686L, - 'selection_start': 686L, + 'sel-line': 164L, + 'sel-line-start': 5468L, + 'selection_end': 5482L, + 'selection_start': 5472L, 'zoom': 0L}, - 1554678223.374], + 1554801116.986], [loc('BA9C.py'), - {'attrib-starts': [], - 'first-line': 0L, + {'attrib-starts': [('ConstructSuffixTree', + 80)], + 'first-line': 87L, 'folded-linenos': [], - 'sel-line': 16L, - 'sel-line-start': 735L, - 'selection_end': 735L, - 'selection_start': 735L, + 'sel-line': 101L, + 'sel-line-start': 3529L, + 'selection_end': 3572L, + 'selection_start': 3549L, 'zoom': 0L}, - 1554678262.733], - [loc('snp.py'), - {'attrib-starts': [], - 'first-line': 0L, + 1554846975.665], + [loc('BA9C.py'), + {'attrib-starts': [('ConstructSuffixTree', + 80), + ('ConstructSuffixTree.get_non_branching_paths', + 82), + ('ConstructSuffixTree.get_non_branching_paths.ex'\ + 'plore', + 83)], + 'first-line': 84L, 'folded-linenos': [], - 'sel-line': 14L, - 'sel-line-start': 686L, - 'selection_end': 686L, - 'selection_start': 686L, + 'sel-line': 94L, + 'sel-line-start': 3355L, + 'selection_end': 3394L, + 'selection_start': 3387L, 'zoom': 0L}, - 1554678275.618], + 1554860939.578], [loc('BA9C.py'), {'attrib-starts': [], - 'first-line': 6L, + 'first-line': 160L, 'folded-linenos': [], - 'sel-line': 15L, - 'sel-line-start': 688L, - 'selection_end': 993L, - 'selection_start': 688L, + 'sel-line': 169L, + 'sel-line-start': 5462L, + 'selection_end': 5502L, + 'selection_start': 5478L, 'zoom': 0L}, - 1554678289.159], - [loc('BA9I.py'), - {'attrib-starts': [], - 'first-line': 0L, + 1554930806.827], + [loc('BA9C.py'), + {'attrib-starts': [('ConstructSuffixTreeEdges', + 27), + ('ConstructSuffixTreeEdges.explore', + 28)], + 'first-line': 9L, 'folded-linenos': [], - 'sel-line': 15L, - 'sel-line-start': 689L, - 'selection_end': 747L, - 'selection_start': 689L, + 'sel-line': 50L, + 'sel-line-start': 2001L, + 'selection_end': 2018L, + 'selection_start': 2018L, 'zoom': 0L}, - 1554678309.392], - [loc('snp.py'), - {'attrib-starts': [], - 'first-line': 0L, + 1555028807.875], + [loc('rear.py'), + {'attrib-starts': [('GreedySorting', + 21)], + 'first-line': 22L, 'folded-linenos': [], - 'sel-line': 17L, - 'sel-line-start': 751L, - 'selection_end': 751L, - 'selection_start': 751L, + 'sel-line': 31L, + 'sel-line-start': 1109L, + 'selection_end': 1113L, + 'selection_start': 1113L, 'zoom': 0L}, - 1554678317.894], - [loc('BA9I.py'), + 1555043171.883], + [loc('README.md'), {'attrib-starts': [], - 'first-line': 11L, + 'first-line': 71L, 'folded-linenos': [], - 'sel-line': 17L, - 'sel-line-start': 751L, - 'selection_end': 751L, - 'selection_start': 751L, + 'sel-line': 101L, + 'sel-line-start': 9342L, + 'selection_end': 9433L, + 'selection_start': 9398L, 'zoom': 0L}, - 1554678343.51], - [loc('snp.py'), - {'attrib-starts': [('BurrowsWheeler', - 17)], - 'first-line': 11L, + 1555044087.155], + [loc('BA6D.py'), + {'attrib-starts': [('ConstructSuffixTreeEdges', + -1), + ('ConstructSuffixTreeEdges.explore', + -1)], + 'first-line': 0L, 'folded-linenos': [], - 'sel-line': 29L, - 'sel-line-start': 1049L, - 'selection_end': 1049L, - 'selection_start': 1049L, + 'sel-line': 50L, + 'sel-line-start': 2001L, + 'selection_end': 2018L, + 'selection_start': 2018L, 'zoom': 0L}, - 1554678351.014], - [loc('BA9I.py'), + 1555044101.679], + [loc('BA6DD.py'), {'attrib-starts': [], - 'first-line': 11L, + 'first-line': 0L, 'folded-linenos': [], - 'sel-line': 18L, - 'sel-line-start': 783L, - 'selection_end': 783L, - 'selection_start': 783L, + 'sel-line': 20L, + 'sel-line-start': 799L, + 'selection_end': 807L, + 'selection_start': 807L, 'zoom': 0L}, - 1554678454.942], + 1555044194.515], + [loc('BA6D.py'), + {'attrib-starts': [], + 'first-line': 0L, + 'folded-linenos': [], + 'sel-line': 20L, + 'sel-line-start': 799L, + 'selection_end': 807L, + 'selection_start': 807L, + 'zoom': 0L}, + 1555044204.67], [loc('README.md'), {'attrib-starts': [], - 'first-line': 95L, + 'first-line': 71L, 'folded-linenos': [], - 'sel-line': 104L, - 'sel-line-start': 9431L, - 'selection_end': 9451L, - 'selection_start': 9451L, + 'sel-line': 76L, + 'sel-line-start': 7197L, + 'selection_end': 7325L, + 'selection_start': 7325L, 'zoom': 0L}, - 1554678591.926], - [loc('BA9A.py'), + 1555044286.556], + [loc('BA6D.py'), {'attrib-starts': [], - 'first-line': 11L, + 'first-line': 0L, 'folded-linenos': [], - 'sel-line': 15L, - 'sel-line-start': 688L, - 'selection_end': 799L, - 'selection_start': 742L, + 'sel-line': 20L, + 'sel-line-start': 799L, + 'selection_end': 807L, + 'selection_start': 807L, 'zoom': 0L}, - 1554678620.631], + 1555044289.208], [loc('README.md'), {'attrib-starts': [], - 'first-line': 95L, + 'first-line': 71L, 'folded-linenos': [], - 'sel-line': 101L, - 'sel-line-start': 9145L, - 'selection_end': 9170L, - 'selection_start': 9170L, + 'sel-line': 76L, + 'sel-line-start': 7197L, + 'selection_end': 7325L, + 'selection_start': 7325L, 'zoom': 0L}, - 1554678636.777], - [loc('BA9B.py'), + 1555044575.454], + [loc('BA6D.py'), {'attrib-starts': [], - 'first-line': 14L, + 'first-line': 6L, 'folded-linenos': [], 'sel-line': 15L, 'sel-line-start': 688L, - 'selection_end': 717L, + 'selection_end': 993L, 'selection_start': 688L, 'zoom': 0L}, - 1554678658.242], - [loc('snp.py'), + 1555044588.481], + [loc('README.md'), {'attrib-starts': [], - 'first-line': 0L, + 'first-line': 71L, 'folded-linenos': [], - 'sel-line': 16L, - 'sel-line-start': 719L, - 'selection_end': 719L, - 'selection_start': 719L, + 'sel-line': 84L, + 'sel-line-start': 7925L, + 'selection_end': 7957L, + 'selection_start': 7957L, 'zoom': 0L}, - 1554678692.079], - [loc('BA9B.py'), + 1555044717.745], + [loc('BA6D.py'), {'attrib-starts': [], - 'first-line': 0L, - 'folded-linenos': [], - 'sel-line': 17L, - 'sel-line-start': 721L, - 'selection_end': 721L, - 'selection_start': 721L, - 'zoom': 0L}, - 1554678778.426], - [loc('snp.py'), - {'attrib-starts': [('MatchTries', - 54)], - 'first-line': 37L, + 'first-line': 6L, 'folded-linenos': [], - 'sel-line': 56L, - 'sel-line-start': 1614L, - 'selection_end': 1614L, - 'selection_start': 1614L, + 'sel-line': 15L, + 'sel-line-start': 688L, + 'selection_end': 807L, + 'selection_start': 688L, 'zoom': 0L}, - 1554678788.316], - [loc('BA9B.py'), + 1555044721.286], + [loc('README.md'), {'attrib-starts': [], - 'first-line': 9L, + 'first-line': 71L, 'folded-linenos': [], - 'sel-line': 21L, - 'sel-line-start': 824L, - 'selection_end': 824L, - 'selection_start': 824L, + 'sel-line': 84L, + 'sel-line-start': 7925L, + 'selection_end': 7957L, + 'selection_start': 7957L, 'zoom': 0L}, - 1554678879.784], - [loc('snp.py'), - {'attrib-starts': [], - 'first-line': 11L, + 1555044777.201], + [loc('BA6D.py'), + {'attrib-starts': [('FindShortestTransformation', + 17)], + 'first-line': 6L, 'folded-linenos': [], - 'sel-line': 17L, - 'sel-line-start': 721L, - 'selection_end': 721L, - 'selection_start': 721L, + 'sel-line': 18L, + 'sel-line-start': 807L, + 'selection_end': 816L, + 'selection_start': 816L, 'zoom': 0L}, - 1554678898.285]], + 1555044875.7]], 20), - 'current-loc': loc('BA9B.py'), - 'editor-state-list': [(loc('BA9A.py'), - {'attrib-starts': [], - 'first-line': 11L, - 'folded-linenos': [], - 'sel-line': 15L, - 'sel-line-start': 688L, - 'selection_end': 799L, - 'selection_start': 742L, - 'zoom': 0L}), - (loc('BA9B.py'), - {'attrib-starts': [], - 'first-line': 9L, - 'folded-linenos': [], - 'sel-line': 19L, - 'sel-line-start': 776L, - 'selection_end': 776L, - 'selection_start': 776L, - 'zoom': 0L}), - (loc('BA9C.py'), - {'attrib-starts': [], + 'current-loc': loc('README.md'), + 'editor-state-list': [(loc('BA6D.py'), + {'attrib-starts': [('FindShortestTransformati'\ + 'on', + 17)], 'first-line': 6L, 'folded-linenos': [], - 'sel-line': 15L, - 'sel-line-start': 688L, - 'selection_end': 993L, - 'selection_start': 688L, + 'sel-line': 18L, + 'sel-line-start': 807L, + 'selection_end': 816L, + 'selection_start': 816L, 'zoom': 0L}), - (loc('BA9I.py'), + (loc('bfs.py'), {'attrib-starts': [], - 'first-line': 11L, + 'first-line': 15L, 'folded-linenos': [], - 'sel-line': 18L, - 'sel-line-start': 783L, - 'selection_end': 783L, - 'selection_start': 783L, + 'sel-line': 59L, + 'sel-line-start': 1723L, + 'selection_end': 1723L, + 'selection_start': 1723L, 'zoom': 0L}), (loc('README.md'), {'attrib-starts': [], - 'first-line': 95L, + 'first-line': 71L, 'folded-linenos': [], - 'sel-line': 101L, - 'sel-line-start': 9145L, - 'selection_end': 9170L, - 'selection_start': 9170L, + 'sel-line': 76L, + 'sel-line-start': 7197L, + 'selection_end': 7325L, + 'selection_start': 7325L, 'zoom': 0L}), - (loc('snp.py'), - {'attrib-starts': [], - 'first-line': 11L, + (loc('rear.py'), + {'attrib-starts': [('GreedySorting', + 21)], + 'first-line': 22L, 'folded-linenos': [], - 'sel-line': 17L, - 'sel-line-start': 721L, - 'selection_end': 721L, - 'selection_start': 721L, + 'sel-line': 30L, + 'sel-line-start': 1103L, + 'selection_end': 1113L, + 'selection_start': 1113L, 'zoom': 0L})], 'has-focus': True, 'locked': False}, - [loc('BA9A.py'), - loc('BA9B.py'), - loc('BA9C.py'), - loc('BA9I.py'), + [loc('BA6D.py'), + loc('bfs.py'), loc('README.md'), - loc('snp.py')]), - 'open_files': [u'BA9C.py', - u'BA9I.py', - u'BA9A.py', - u'README.md', - u'snp.py', - u'BA9B.py']}, + loc('rear.py')]), + 'open_files': [u'bfs.py', + u'rear.py', + u'BA6D.py', + u'README.md']}, 'saved_notebook_display': None, 'split_percents': {0: 0.5}, 'splits': 2, @@ -608,15 +603,13 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window', 'tab_location': 'left', 'user_data': {}}, 'window-alloc': (1, - 1, - 1378, - 749)}]} -guimgr.recent-documents = [loc('BA9B.py'), - loc('snp.py'), - loc('README.md'), - loc('BA9A.py'), - loc('BA9I.py'), - loc('BA9C.py')] + 4, + 1364, + 733)}]} +guimgr.recent-documents = [loc('README.md'), + loc('BA6D.py'), + loc('rear.py'), + loc('bfs.py')] guimgr.visual-state = {loc('../../../Anaconda3/lib/site-packages/Bio/File.py'): {'a'\ 'ttrib-starts': [('as_handle', 57)], @@ -828,6 +821,14 @@ guimgr.visual-state = {loc('../../../Anaconda3/lib/site-packages/Bio/File.py'): 'sel-line-start': 822L, 'selection_end': 822L, 'selection_start': 822L, + 'zoom': 0L}, + loc('BA6D.py'): {'attrib-starts': [], + 'first-line': 6L, + 'folded-linenos': [], + 'sel-line': 15L, + 'sel-line-start': 688L, + 'selection_end': 807L, + 'selection_start': 688L, 'zoom': 0L}, loc('BA6F.py'): {'attrib-starts': [], 'first-line': 9L, @@ -987,26 +988,34 @@ guimgr.visual-state = {loc('../../../Anaconda3/lib/site-packages/Bio/File.py'): loc('BA9A.py'): {'attrib-starts': [], 'first-line': 11L, 'folded-linenos': [], - 'sel-line': 17L, - 'sel-line-start': 746L, - 'selection_end': 771L, - 'selection_start': 746L, + 'sel-line': 15L, + 'sel-line-start': 688L, + 'selection_end': 799L, + 'selection_start': 742L, 'zoom': 0L}, loc('BA9B.py'): {'attrib-starts': [], - 'first-line': 0L, + 'first-line': 9L, + 'folded-linenos': [], + 'sel-line': 19L, + 'sel-line-start': 776L, + 'selection_end': 776L, + 'selection_start': 776L, + 'zoom': 0L}, + loc('BA9C.py'): {'attrib-starts': [], + 'first-line': 6L, 'folded-linenos': [], - 'sel-line': 57L, - 'sel-line-start': 1632L, - 'selection_end': 1656L, - 'selection_start': 1656L, + 'sel-line': 15L, + 'sel-line-start': 688L, + 'selection_end': 993L, + 'selection_start': 688L, 'zoom': 0L}, loc('BA9I.py'): {'attrib-starts': [], 'first-line': 0L, 'folded-linenos': [], - 'sel-line': 33L, - 'sel-line-start': 2149L, - 'selection_end': 3017L, - 'selection_start': 3017L, + 'sel-line': 18L, + 'sel-line-start': 783L, + 'selection_end': 783L, + 'selection_start': 783L, 'zoom': 0L}, loc('BINS.py'): {'attrib-starts': [], 'first-line': 0L, @@ -1182,12 +1191,12 @@ guimgr.visual-state = {loc('../../../Anaconda3/lib/site-packages/Bio/File.py'): 'selection_start': 686L, 'zoom': 0L}, loc('README.md'): {'attrib-starts': [], - 'first-line': 61L, + 'first-line': 178L, 'folded-linenos': [], - 'sel-line': 71L, - 'sel-line-start': 6490L, - 'selection_end': 6504L, - 'selection_start': 6504L, + 'sel-line': 213L, + 'sel-line-start': 18283L, + 'selection_end': 18354L, + 'selection_start': 18354L, 'zoom': 0L}, loc('align.py'): {'attrib-starts': [('longest_manhatt'\ 'an_path', @@ -1637,6 +1646,14 @@ guimgr.visual-state = {loc('../../../Anaconda3/lib/site-packages/Bio/File.py'): 'selection_end': 1584L, 'selection_start': 1584L, 'zoom': 0L}, + loc('snp.py'): {'attrib-starts': [], + 'first-line': 25L, + 'folded-linenos': [], + 'sel-line': 17L, + 'sel-line-start': 721L, + 'selection_end': 721L, + 'selection_start': 721L, + 'zoom': 0L}, loc('spectrum.py'): {'attrib-starts': [], 'first-line': 0L, 'folded-linenos': [],