Skip to content

Commit

Permalink
Tidied up
Browse files Browse the repository at this point in the history
  • Loading branch information
weka511 committed Jul 27, 2018
1 parent 3350246 commit b4dd703
Show file tree
Hide file tree
Showing 11 changed files with 226 additions and 80 deletions.
2 changes: 1 addition & 1 deletion 2sum.py
Expand Up @@ -46,7 +46,7 @@ def best(pairs):
k = -1
As=[]

with open (r'C:\Users\Simon\Downloads\rosalind_2sum(5).txt') as f:
with open (r'data\rosalind_2sum(5).txt') as f:
for line in f:
if k==-1:
values=line.strip().split()
Expand Down
2 changes: 1 addition & 1 deletion count-kmer-occurrences.py
Expand Up @@ -47,7 +47,7 @@ def generate_stats(dna,k):
# Computer reverse complement

def reverse_complement(string):
return ''.join([dna_pairing[x] for x in string[::-1]])
return ''.join([dna_pairing[x] for x in string[::-1]])

# Find d-neighbours of kmer
# FIXME: the repeated joins are ugle
Expand Down
16 changes: 16 additions & 0 deletions data/rosalind_2sum(1).txt

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions data/rosalind_2sum(2).txt

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions data/rosalind_2sum(3).txt

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions data/rosalind_2sum(4).txt

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions data/rosalind_2sum(5).txt

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions data/rosalind_2sum.txt

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions data/rosalind_maj.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion maj.py
Expand Up @@ -34,7 +34,7 @@ def maj(A):
k = -1
As=[]

with open (r'C:\Users\Simon\Downloads\rosalind_maj.txt') as f:
with open (r'data\rosalind_maj.txt') as f:
for line in f:
if k==-1:
values=line.strip().split()
Expand Down
193 changes: 116 additions & 77 deletions rosalind.wpr
Expand Up @@ -100,8 +100,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': [(45,)],
'top-node': (0,)}},
'selected-nodes': [(32,)],
'top-node': (5,)}},
'tree-style': 'deep'}}),
('source-assistant',
'tall',
Expand Down Expand Up @@ -147,7 +147,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
{})],
'primary_view_state': {'area': 'wide',
'constraint': None,
'current_pages': [1,
'current_pages': [0,
0],
'notebook_display': 'normal',
'notebook_percent': 0.30000000000000004,
Expand All @@ -165,9 +165,9 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
'fMatchCase': False,
'fOmitBinary': True,
'fRegexFlags': 46,
'fReplaceText': '',
'fReplaceText': u'',
'fReverse': False,
'fSearchText': '',
'fSearchText': u'median',
'fStartPos': 0,
'fStyle': 'text',
'fWholeWords': False,
Expand Down Expand Up @@ -198,7 +198,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
'fRegexFlags': 46,
'fReplaceText': u'p',
'fReverse': True,
'fSearchText': u'last',
'fSearchText': u'median',
'fStartPos': 0,
'fStyle': 'text',
'fWholeWords': False,
Expand All @@ -211,7 +211,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
'fReplaceOnDisk': False,
'fShowFirstMatch': False,
'fShowLineno': True,
'fShowReplaceWidgets': True}}),
'fShowReplaceWidgets': False}}),
('debug-data',
'wide',
0,
Expand All @@ -235,10 +235,10 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
'folded-linenos': [],
'history': {},
'launch-id': None,
'sel-line': 0L,
'sel-line-start': 0L,
'selection_end': 0L,
'selection_start': 0L,
'sel-line': 2L,
'sel-line-start': 171L,
'selection_end': 171L,
'selection_start': 171L,
'zoom': 0L}),
('messages',
'wide',
Expand All @@ -252,54 +252,14 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
'toolbox-tree-sel': ''})],
'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('bfs.py'),
{'attrib-starts': [],
'first-line': 0L,
'first-line': 43L,
'folded-linenos': [],
'sel-line': 22L,
'sel-line-start': 830L,
'selection_end': 830L,
'selection_start': 830L,
'sel-line': 59L,
'sel-line-start': 1723L,
'selection_end': 1723L,
'selection_start': 1723L,
'zoom': 0L},
1507343991.663],
[loc('bfs.py'),
{'attrib-starts': [],
'first-line': 49L,
'folded-linenos': [],
'sel-line': 15L,
'sel-line-start': 725L,
'selection_end': 754L,
'selection_start': 729L,
'zoom': 0L},
1507347544.352],
[loc('BA8E.py'),
{'attrib-starts': [],
'first-line': 67L,
'folded-linenos': [],
'sel-line': 76L,
'sel-line-start': 2039L,
'selection_end': 2108L,
'selection_start': 2062L,
'zoom': 0L},
1507347554.582],
[loc('bfs.py'),
{'attrib-starts': [],
'first-line': 77L,
'folded-linenos': [],
'sel-line': 97L,
'sel-line-start': 3010L,
'selection_end': 3042L,
'selection_start': 3025L,
'zoom': 0L},
1507357329.419],
[loc('bfs.py'),
{'attrib-starts': [],
'first-line': 43L,
'folded-linenos': [],
'sel-line': 59L,
'sel-line-start': 1723L,
'selection_end': 1723L,
'selection_start': 1723L,
'zoom': 0L},
1532491376.658],
1532491376.658],
[loc('unknown:<untitled> #2'),
{'attrib-starts': [],
'first-line': 0L,
Expand Down Expand Up @@ -452,18 +412,59 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
'selection_end': 1096L,
'selection_start': 1092L,
'zoom': 0L},
1532575873.129]],
1532575873.129],
[loc('2sum.py'),
{'attrib-starts': [('f2sum',
17)],
'first-line': 20L,
'folded-linenos': [],
'sel-line': 34L,
'sel-line-start': 1269L,
'selection_end': 1273L,
'selection_start': 1273L,
'zoom': 0L},
1532643050.182],
[loc('MED.py'),
{'attrib-starts': [],
'first-line': 26L,
'folded-linenos': [],
'sel-line': 14L,
'sel-line-start': 686L,
'selection_end': 686L,
'selection_start': 686L,
'zoom': 0L},
1532643746.724],
[loc('count-kmer-occurrences.py'),
{'attrib-starts': [('reverse_complement',
48)],
'first-line': 0L,
'folded-linenos': [],
'sel-line': 49L,
'sel-line-start': 1402L,
'selection_end': 1406L,
'selection_start': 1406L,
'zoom': 0L},
1532661996.569],
[loc('maj.py'),
{'attrib-starts': [],
'first-line': 28L,
'folded-linenos': [],
'sel-line': 36L,
'sel-line-start': 1133L,
'selection_end': 1154L,
'selection_start': 1154L,
'zoom': 0L},
1532662033.621]],
20),
'current-loc': loc('2sum.py'),
'editor-state-list': [(loc('2sum.py'),
{'attrib-starts': [('f2sum',
17)],
'first-line': 20L,
{'attrib-starts': [],
'first-line': 38L,
'folded-linenos': [],
'sel-line': 34L,
'sel-line-start': 1257L,
'selection_end': 1273L,
'selection_start': 1273L,
'sel-line': 48L,
'sel-line-start': 1563L,
'selection_end': 1584L,
'selection_start': 1584L,
'zoom': 0L}),
(loc('BA8A.py'),
{'attrib-starts': [],
Expand Down Expand Up @@ -492,6 +493,34 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
'selection_end': 789L,
'selection_start': 789L,
'zoom': 0L}),
(loc('count-kmer-occurrences.py'),
{'attrib-starts': [('reverse_complement',
48)],
'first-line': 0L,
'folded-linenos': [],
'sel-line': 49L,
'sel-line-start': 1402L,
'selection_end': 1406L,
'selection_start': 1406L,
'zoom': 0L}),
(loc('maj.py'),
{'attrib-starts': [],
'first-line': 28L,
'folded-linenos': [],
'sel-line': 36L,
'sel-line-start': 1133L,
'selection_end': 1154L,
'selection_start': 1154L,
'zoom': 0L}),
(loc('MED.py'),
{'attrib-starts': [],
'first-line': 26L,
'folded-linenos': [],
'sel-line': 14L,
'sel-line-start': 686L,
'selection_end': 686L,
'selection_start': 686L,
'zoom': 0L}),
(loc('pmch.py'),
{'attrib-starts': [],
'first-line': 0L,
Expand Down Expand Up @@ -527,6 +556,9 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
loc('BA8A.py'),
loc('bfs.py'),
loc('cat.py'),
loc('count-kmer-occurrences.py'),
loc('maj.py'),
loc('MED.py'),
loc('pmch.py'),
loc('README.md'),
loc('rosalind.py')]),
Expand All @@ -536,6 +568,9 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
u'cat.py',
u'pmch.py',
u'rosalind.py',
u'MED.py',
u'count-kmer-occurrences.py',
u'maj.py',
u'2sum.py']},
'saved_notebook_display': None,
'split_percents': {0: 0.5},
Expand All @@ -552,23 +587,16 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1380,
749)}]}
guimgr.recent-documents = [loc('2sum.py'),
loc('maj.py'),
loc('count-kmer-occurrences.py'),
loc('MED.py'),
loc('rosalind.py'),
loc('README.md'),
loc('BA8A.py'),
loc('pmch.py'),
loc('cat.py'),
loc('bfs.py')]
guimgr.visual-state = {loc('../../../Anaconda3/lib/site-packages/Bio/File.py'): {'a'\
'ttrib-starts': [('as_handle',
45)],
'first-line': 64L,
'folded-linenos': [],
'sel-line': 86L,
'sel-line-start': 2689L,
'selection_end': 2689L,
'selection_start': 2689L,
'zoom': 0L},
loc('../../../Anaconda3/lib/sre_parse.py'): {'attrib-'\
guimgr.visual-state = {loc('../../../Anaconda3/lib/sre_parse.py'): {'attrib-'\
'starts': [('_parse',
490)],
'first-line': 762L,
Expand All @@ -587,6 +615,16 @@ guimgr.visual-state = {loc('../../../Anaconda3/lib/site-packages/Bio/File.py'):
'sel-line-start': 86688L,
'selection_end': 86697L,
'selection_start': 86692L,
'zoom': 0L},
loc('../../../Anaconda3/lib/site-packages/Bio/File.py'): {'a'\
'ttrib-starts': [('as_handle',
45)],
'first-line': 64L,
'folded-linenos': [],
'sel-line': 86L,
'sel-line-start': 2689L,
'selection_end': 2689L,
'selection_start': 2689L,
'zoom': 0L},
loc('ASMQ.py'): {'attrib-starts': [],
'first-line': 27L,
Expand Down Expand Up @@ -984,7 +1022,8 @@ search.replace-history = [u'link',
u'weight',
u',',
u'reconstruction']
search.search-history = [u'print',
search.search-history = [u'median',
u'print',
u'hamm',
u'add',
u'distance',
Expand Down

0 comments on commit b4dd703

Please sign in to comment.