Cody

Problem 2513. Genome decoding

Solution 1950121

Submitted on 26 Sep 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
user_solution = fileread('decode_genome.m'); assert(isempty(strfind(user_solution,'regexp'))); assert(isempty(strfind(user_solution,'str2num')));

2   Fail
genome = [ 228 24 40 36 167 231 71 248 107 9 32 140 245 234 217 233 0 124 202 239 161 247 204 255 173]; sequences = { 'GTCA' 'ACTA' 'ATTA' 'ATCA' 'TTCG' 'GTCG' 'CACG' 'GGTA' 'CTTG' 'AATC' 'ATAA' 'TAGA' 'GGCC' 'GTTT' 'GCTC' 'GTTC' 'AAAA' 'CGGA' 'GATT' 'GTGG' 'TTAC' 'GGCG' 'GAGA' 'GGGG' 'TTGC'}; assert(isequal(sequences, decode_genome(genome)));

l = 0 0 1 1 1 0 0 1 l = 0 1 0 0 1 1 1 0 l = 1 0 0 1 0 0 1 1 l = 1 1 1 0 0 1 0 0 m = 'GTCA' l = 1 1 1 1 1 0 0 1 l = 0 1 1 1 1 1 1 0 l = 1 0 0 1 1 1 1 1 l = 1 1 1 0 0 1 1 1 m = 'GTCG' l = 0 0 0 0 1 0 0 0 l = 0 0 0 0 0 0 1 0 l = 1 0 0 0 0 0 0 0 l = 0 0 1 0 0 0 0 0 m = 'ATAA' l = 0 1 1 1 1 0 1 0 l = 1 0 0 1 1 1 1 0 l = 1 0 1 0 0 1 1 1 l = 1 1 1 0 1 0 0 1 m = 'GTTC' l = 0 1 1 0 1 0 0 0 l = 0 0 0 1 1 0 1 0 l = 1 0 0 0 0 1 1 0 l = 1 0 1 0 0 0 0 1 m = 'TTAC' l = 0 0 0 0 0 1 1 0 l = 1 0 0 0 0 0 0 1 l = 0 1 1 0 0 0 0 0 l = 0 0 0 1 1 0 0 0 m = 'ACTA' l = 1 1 0 1 0 0 0 1 l = 0 1 1 1 0 1 0 0 l = 0 0 0 1 1 1 0 1 l = 0 1 0 0 0 1 1 1 m = 'CACG' l = 0 0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1 1 1 1 l = 1 1 1 1 1 1 1 1 l = 1 1 1 1 1 1 1 1 l = 1 1 1 1 1 1 1 1 m = 'GGGG' l = 1 1 1 0 1 0 0 1 l = 0 1 1 1 1 0 1 0 l = 1 0 0 1 1 1 1 0 l = 1 0 1 0 0 1 1 1 m = 'TTCG' l = 0 1 0 0 0 0 1 0 l = 1 0 0 1 0 0 0 0 l = 0 0 1 0 0 1 0 0 l = 0 0 0 0 1 0 0 1 m = 'AATC' l = 0 1 1 1 0 1 1 0 l = 1 0 0 1 1 1 0 1 l = 0 1 1 0 0 1 1 1 l = 1 1 0 1 1 0 0 1 m = 'GCTC' l = 1 1 1 1 1 0 1 1 l = 1 1 1 1 1 1 1 0 l = 1 0 1 1 1 1 1 1 l = 1 1 1 0 1 1 1 1 m = 'GTGG' l = 0 1 1 0 1 0 1 1 l = 1 1 0 1 1 0 1 0 l = 1 0 1 1 0 1 1 0 l = 1 0 1 0 1 1 0 1 m = 'TTGC'

Output argument "sequences" (and maybe others) not assigned during call to "decode_genome". Error in Test2 (line 13) assert(isequal(sequences, decode_genome(genome)));

3   Fail
genome = [1 4 16 64; 234 186 174 171]; sequences = {'AAAC' 'AACA' 'ACAA' 'CAAA'; 'GTTT' 'TGTT' 'TTGT' 'TTTG'}; assert(isequal(sequences, decode_genome(genome)));

l = 0 1 0 0 0 0 0 0 l = 0 0 0 1 0 0 0 0 l = 0 0 0 0 0 1 0 0 l = 0 0 0 0 0 0 0 1 m = 'AAAC' l = 1 0 1 1 1 0 1 0 l = 1 0 1 0 1 1 1 0 l = 1 0 1 0 1 0 1 1 l = 1 1 1 0 1 0 1 0 m = 'GTTT' l = 0 0 0 0 0 0 0 1 l = 0 1 0 0 0 0 0 0 l = 0 0 0 1 0 0 0 0 l = 0 0 0 0 0 1 0 0 m = 'AACA' l = 1 0 1 0 1 1 1 0 l = 1 0 1 0 1 0 1 1 l = 1 1 1 0 1 0 1 0 l = 1 0 1 1 1 0 1 0 m = 'TGTT' l = 0 0 0 0 0 1 0 0 l = 0 0 0 0 0 0 0 1 l = 0 1 0 0 0 0 0 0 l = 0 0 0 1 0 0 0 0 m = 'ACAA' l = 1 0 1 0 1 0 1 1 l = 1 1 1 0 1 0 1 0 l = 1 0 1 1 1 0 1 0 l = 1 0 1 0 1 1 1 0 m = 'TTGT' l = 0 0 0 1 0 0 0 0 l = 0 0 0 0 0 1 0 0 l = 0 0 0 0 0 0 0 1 l = 0 1 0 0 0 0 0 0 m = 'CAAA' l = 1 1 1 0 1 0 1 0 l = 1 0 1 1 1 0 1 0 l = 1 0 1 0 1 1 1 0 l = 1 0 1 0 1 0 1 1 m = 'TTTG'

Output argument "sequences" (and maybe others) not assigned during call to "decode_genome". Error in Test3 (line 3) assert(isequal(sequences, decode_genome(genome)));

4   Fail
genome = [228 225 216 210 198 201 180 177 156 147 135 141 108 99 120 114 78 75 39 45 27 30 54 57]'; sequences = {'GTCA' 'GTAC' 'GCTA' 'GCAT' 'GACT' 'GATC' 'TGCA' 'TGAC' 'TCGA' 'TCAG' 'TACG' 'TAGC' 'CTGA' 'CTAG' 'CGTA' 'CGAT' 'CAGT' 'CATG' 'ATCG' 'ATGC' 'ACTG' 'ACGT' 'AGCT' 'AGTC'}'; assert(isequal(sequences, decode_genome(genome)));

l = 0 0 1 1 1 0 0 1 l = 0 1 0 0 1 1 1 0 l = 1 0 0 1 0 0 1 1 l = 1 1 1 0 0 1 0 0 m = 'GTCA' l = 0 1 1 1 1 0 0 0 l = 0 0 0 1 1 1 1 0 l = 1 0 0 0 0 1 1 1 l = 1 1 1 0 0 0 0 1 m = 'GTAC' l = 0 0 1 1 0 1 1 0 l = 1 0 0 0 1 1 0 1 l = 0 1 1 0 0 0 1 1 l = 1 1 0 1 1 0 0 0 m = 'GCTA' l = 1 0 1 1 0 1 0 0 l = 0 0 1 0 1 1 0 1 l = 0 1 0 0 1 0 1 1 l = 1 1 0 1 0 0 1 0 m = 'GCAT' l = 1 0 1 1 0 0 0 1 l = 0 1 1 0 1 1 0 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0 1 1 1 0 0 1 l = 0 1 0 0 1 1 1 0 m = 'CAGT' l = 1 1 0 1 0 0 1 0 l = 1 0 1 1 0 1 0 0 l = 0 0 1 0 1 1 0 1 l = 0 1 0 0 1 0 1 1 m = 'CATG' l = 1 1 0 0 1 0 0 1 l = 0 1 1 1 0 0 1 0 l = 1 0 0 1 1 1 0 0 l = 0 0 1 0 0 1 1 1 m = 'ATCG' l = 0 1 0 0 1 0 1 1 l = 1 1 0 1 0 0 1 0 l = 1 0 1 1 0 1 0 0 l = 0 0 1 0 1 1 0 1 m = 'ATGC' l = 1 1 0 0 0 1 1 0 l = 1 0 1 1 0 0 0 1 l = 0 1 1 0 1 1 0 0 l = 0 0 0 1 1 0 1 1 m = 'ACTG' l = 1 0 0 0 0 1 1 1 l = 1 1 1 0 0 0 0 1 l = 0 1 1 1 1 0 0 0 l = 0 0 0 1 1 1 1 0 m = 'ACGT' l = 1 0 0 0 1 1 0 1 l = 0 1 1 0 0 0 1 1 l = 1 1 0 1 1 0 0 0 l = 0 0 1 1 0 1 1 0 m = 'AGCT' l = 0 1 0 0 1 1 1 0 l = 1 0 0 1 0 0 1 1 l = 1 1 1 0 0 1 0 0 l = 0 0 1 1 1 0 0 1 m = 'AGTC'

Output argument "sequences" (and maybe others) not assigned during call to "decode_genome". Error in Test4 (line 3) assert(isequal(sequences, decode_genome(genome)));

Suggested Problems

More from this Author9

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!