Commit 8aae8e79 authored by Nicolas  MAILLET's avatar Nicolas MAILLET
Browse files

Correct some typos

parent 5f43174f
......@@ -6,7 +6,7 @@ User Guide
Overview
========
You can use **Rapide Peptide Generator** using the standalone called::
You can run **Rapide Peptide Generator** using the standalone called::
rpg
......
......@@ -231,7 +231,7 @@ def main():
"sequential or concurrent (-d"
" option). Resulting peptides"
" are outputted in a file (-o"
" option) if fasta, csv or ts"
" option) in fasta, csv or ts"
"v format (-f option). Classi"
"cal enzymes are included (-l"
" option to print available e"
......
......@@ -205,7 +205,7 @@ class Rule:
# First comment
else:
ret_com += "Always" if self.cut else "Never"
ret_com += " cut "
ret_com += " cleaves "
ret_com += "after " if self.pos > 0 else "before "
ret_com += self.letter
ret_com += ", except..."
......
......@@ -49,14 +49,16 @@ def test_enzyme(tmpdir):
all_rules = rule.create_rules(dict_rule)
new_enz = enzyme.Enzyme(-1, "fake_enzyme", all_rules)
new_enz.write_enzyme_in_user_file(str(output_file))
assert output_file.read() == '\n\n\n# User-defined enzyme fake_enzyme\nENZ = []\n'\
'\nE_1 = rule.Rule(0, "E", False, 1) # Never cut '\
'after E, except...\nD_E_1M1 = rule.Rule(-1, "D", '\
'True, -1) # Always cut after E, preceded by D, '\
'except...\nE_1.rules.append(D_E_1M1)\nENZ.append('\
'E_1)\n\nENZYME = enzyme.Enzyme(CPT_ENZ, "fake_enzym'\
'e", ENZ, 0)\n# Add it to available enzymes\nAVAILAB'\
'LE_ENZYMES_USER.append(ENZYME)\nCPT_ENZ += 1\n'
assert output_file.read() == '\n\n\n# User-defined enzyme fake_enzyme\nEN'\
'Z = []\n\nE_1 = rule.Rule(0, "E", False, 1)'\
' # Never cleaves after E, except...\nD_E_1M'\
'1 = rule.Rule(-1, "D", True, -1) # Always c'\
'leaves after E, preceded by D, except...\nE'\
'_1.rules.append(D_E_1M1)\nENZ.append(E_1)\n'\
'\nENZYME = enzyme.Enzyme(CPT_ENZ, "fake_enz'\
'yme", ENZ, 0)\n# Add it to available enzyme'\
's\nAVAILABLE_ENZYMES_USER.append(ENZYME)\nC'\
'PT_ENZ += 1\n'
def test_check_enzyme_name():
"""Test function 'check_enzyme_name(name_new_enz, all_name_enz)'."""
......
......@@ -71,18 +71,18 @@ def test_rule():
prev_com = " # "
# Test function 'format_a_rule(prev_name, prev_com)'
res = rule2.format_a_rule(prev_name, prev_com)
assert res == ['D_0', ' # Always cut before D, except...',
'D_0 = rule.Rule(0, "D", True, 0) # Always cut before D, '
assert res == ['D_0', ' # Always cleaves before D, except...',
'D_0 = rule.Rule(0, "D", True, 0) # Always cleaves before D, '
'except...']
res = rule1.format_a_rule(prev_name, prev_com)
assert res == ['1Q2', ' # Never cut after Q, except...',
'1Q2 = rule.Rule(2, "Q", False, 1) # Never cut after Q, '
assert res == ['1Q2', ' # Never cleaves after Q, except...',
'1Q2 = rule.Rule(2, "Q", False, 1) # Never cleaves after Q, '
'except...']
# Test function 'format_rule()'
res = rule2.format_rule()
assert res == 'D_0 = rule.Rule(0, "D", True, 0) # Always cut before D, ex'\
'cept...\nD_0Q2 = rule.Rule(2, "Q", False, 1) # Never cut b'\
assert res == 'D_0 = rule.Rule(0, "D", True, 0) # Always cleaves before D, ex'\
'cept...\nD_0Q2 = rule.Rule(2, "Q", False, 1) # Never cleaves b'\
'efore D, followed by Q, except...\nD_0.rules.append(D_0Q2)'\
'\nENZ.append(D_0)\n\n'
......@@ -328,15 +328,15 @@ def test_create_rules():
assert len(res) == 3
# Other complexe rule
# Don't cut after E if there is a D before
# But cut after E otherwise
# Don't cleaves after E if there is a D before
# But cleaves after E otherwise
rule3 = "(E,)"
all_rules[rule3] = True
exc3 = "(D)(E,)"
all_rules[exc3] = False
# Truth for rule3
truth3_1 = rule.Rule(-1, "D", False, -1)
truth3 = rule.Rule(0, "E", True, 1) # Cut after E
truth3 = rule.Rule(0, "E", True, 1) # cleaves after E
truth3.rules.append(truth3_1)
res = rule.create_rules(all_rules)
assert truth1 in res
......@@ -346,13 +346,13 @@ def test_create_rules():
assert len(res) == 4
# Similar complexe rule
# Cut after G if there is a F before
# But don't cut after G otherwise
# Cleaves after G if there is a F before
# But don't cleaves after G otherwise
rule4 = "(F)(G,)"
all_rules[rule4] = True
# Truth for rule4
truth4_1 = rule.Rule(-1, "F", True, -1)
truth4 = rule.Rule(0, "G", False, 1) # Don't cut after G
truth4 = rule.Rule(0, "G", False, 1) # Don't cleaves after G
truth4.rules.append(truth4_1)
res = rule.create_rules(all_rules)
assert truth1 in res
......@@ -374,7 +374,7 @@ def test_create_rules():
assert len(res) == 7
# Double comma and 'or'
# Cut after I or J, except if a K is after, but cut if a L is before
# Cleaves after I or J, except if a K is after, but cleaves if a L is before
all_rules = {}
rule6 = "(,I or J,)"
all_rules[rule6] = True
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment