From 5c2b2b5b2143ade6bf52d3ad8f566ba821163957 Mon Sep 17 00:00:00 2001 From: Sam Warner <30871823+sjwarner-bp@users.noreply.github.com> Date: Fri, 10 Nov 2017 11:12:21 +0000 Subject: [PATCH] protein-translation: Add canonical data. (#997) * Add protein translation canonical data as per #577. * Update properties to reflect different return types. * Update to test only one property, and fix formatting. * Update test description for clarity. * Reduced length of test descriptions. * Update tests including 'STOP' codons for consistency. * Update 'STOP' test description * Update 'STOP' codon tests to expect an empty list. * Rename 'property', add a larger range of STOP codon tests, rearrange existing stop codon tests, remove testing for invalid data. --- .../protein-translation/canonical-data.json | 153 ++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 exercises/protein-translation/canonical-data.json diff --git a/exercises/protein-translation/canonical-data.json b/exercises/protein-translation/canonical-data.json new file mode 100644 index 0000000000..0555c98488 --- /dev/null +++ b/exercises/protein-translation/canonical-data.json @@ -0,0 +1,153 @@ +{ + "exercise": "protein-translation", + "version": "1.0.0", + "cases": [ + { + "description": "Translate input RNA sequences into proteins", + "comments": [ + "Returns the name of the protein if given RNA is valid, " + , "else throws an error. " + ], + "cases": [ + { + "description": "Methionine RNA sequence", + "property": "proteins", + "strand": "AUG", + "expected": ["Methionine"] + }, + { + "description": "Phenylalanine RNA sequence 1", + "property": "proteins", + "strand": "UUU", + "expected": ["Phenylalanine"] + }, + { + "description": "Phenylalanine RNA sequence 2", + "property": "proteins", + "strand": "UUC", + "expected": ["Phenylalanine"] + }, + { + "description": "Leucine RNA sequence 1", + "property": "proteins", + "strand": "UUA", + "expected": ["Leucine"] + }, + { + "description": "Leucine RNA sequence 2", + "property": "proteins", + "strand": "UUG", + "expected": ["Leucine"] + }, + { + "description": "Serine RNA sequence 1", + "property": "proteins", + "strand": "UCU", + "expected": ["Serine"] + }, + { + "description": "Serine RNA sequence 2", + "property": "proteins", + "strand": "UCC", + "expected": ["Serine"] + }, + { + "description": "Serine RNA sequence 3", + "property": "proteins", + "strand": "UCA", + "expected": ["Serine"] + }, + { + "description": "Serine RNA sequence 4", + "property": "proteins", + "strand": "UCG", + "expected": ["Serine"] + }, + { + "description": "Tyrosine RNA sequence 1", + "property": "proteins", + "strand": "UAU", + "expected": ["Tyrosine"] + }, + { + "description": "Tyrosine RNA sequence 2", + "property": "proteins", + "strand": "UAC", + "expected": ["Tyrosine"] + }, + { + "description": "Cysteine RNA sequence 1", + "property": "proteins", + "strand": "UGU", + "expected": ["Cysteine"] + }, + { + "description": "Cysteine RNA sequence 2", + "property": "proteins", + "strand": "UGC", + "expected": ["Cysteine"] + }, + { + "description": "Tryptophan RNA sequence", + "property": "proteins", + "strand": "UGG", + "expected": ["Tryptophan"] + }, + { + "description": "STOP codon RNA sequence 1", + "property": "proteins", + "strand": "UAA", + "expected": [] + }, + { + "description": "STOP codon RNA sequence 2", + "property": "proteins", + "strand": "UAG", + "expected": [] + }, + { + "description": "STOP codon RNA sequence 3", + "property": "proteins", + "strand": "UGA", + "expected": [] + }, + { + "description": "Translate RNA strand into correct protein list", + "property": "proteins", + "strand": "AUGUUUUGG", + "expected": ["Methionine","Phenylalanine","Tryptophan"] + }, + { + "description": "Translation stops if STOP codon at beginning of sequence", + "property": "proteins", + "strand": "UAGUGG", + "expected": [] + }, + { + "description": "Translation stops if STOP codon at end of two-codon sequence", + "property": "proteins", + "strand": "UGGUAG", + "expected": ["Tryptophan"] + }, + { + "description": "Translation stops if STOP codon at end of three-codon sequence", + "property": "proteins", + "strand": "AUGUUUUAA", + "expected": ["Methionine","Phenylalanine"] + }, + { + "description": "Translation stops if STOP codon in middle of sequence of three-codon sequence", + "property": "proteins", + "strand": "UGGUAGUGG", + "expected": ["Tryptophan"] + }, + { + "description": "Translation stops if codon in middle of sequence of six-codon sequence", + "property": "proteins", + "strand": "UGGUGUUAUUAAUGGUUU", + "expected": ["Tryptophan","Cysteine","Tyrosine"] + } + ] + } + ] +} \ No newline at end of file