Cody

Problem 2513. Genome decoding

Solution 1950117

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 c = "ACTG" ans = "ACTG" 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 c = "GCTG" ans = "GCTG" 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 c = "AATA" ans = "AATA" 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 c = "CTTG" ans = "CTTG" 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 c = "CATT" ans = "CATT" 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 c = "ATCA" ans = "ATCA" 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 c = "GCAC" ans = "GCAC" l = 0 0 1 0 0 0 1 1 l = 1 1 0 0 1 0 0 0 l = 0 0 1 1 0 0 1 0 l = 1 0 0 0 1 1 0 0 c = "AGAT" ans = "AGAT" l = 0 0 0 0 0 0 0 0 l = 0 0 0 0 0 0 0 0 l = 0 0 0 0 0 0 0 0 l = 0 0 0 0 0 0 0 0 c = "AAAA" ans = "AAAA" l = 1 1 1 1 1 1 0 1 l = 0 1 1 1 1 1 1 1 l = 1 1 0 1 1 1 1 1 l = 1 1 1 1 0 1 1 1 c = "GCGG" ans = "GCGG" l = 0 0 0 0 1 0 1 0 l = 1 0 0 0 0 0 1 0 l = 1 0 1 0 0 0 0 0 l = 0 0 1 0 1 0 0 0 c = "ATTA" ans = "ATTA" l = 0 0 1 1 1 1 1 0 l = 1 0 0 0 1 1 1 1 l = 1 1 1 0 0 0 1 1 l = 1 1 1 1 1 0 0 0 c = "ATGG" ans = "ATGG" l = 0 1 1 1 1 1 0 1 l = 0 1 0 1 1 1 1 1 l = 1 1 0 1 0 1 1 1 l = 1 1 1 1 0 1 0 1 c = "CCGG" ans = "CCGG" l = 0 0 0 1 1 1 1 1 l = 1 1 0 0 0 1 1 1 l = 1 1 1 1 0 0 0 1 l = 0 1 1 1 1 1 0 0 c = "AGGC" ans = "AGGC" l = 0 0 1 1 0 0 1 1 l = 1 1 0 0 1 1 0 0 l = 0 0 1 1 0 0 1 1 l = 1 1 0 0 1 1 0 0 c = "AGAG" ans = "AGAG" l = 0 0 0 0 1 0 0 1 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 c = "ACTA" ans = "ACTA" 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 l = 0 1 1 0 1 0 1 1 c = "GTTC" ans = "GTTC" 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 c = "TTTG" ans = "TTTG" l = 1 0 1 1 0 0 1 0 l = 1 0 1 0 1 1 0 0 l = 0 0 1 0 1 0 1 1 l = 1 1 0 0 1 0 1 0 c = "TTAG" ans = "TTAG" 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 l = 1 1 1 1 1 1 1 1 c = "GGGG" ans = "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 c = "GCTT" ans = "GCTT" 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 c = "CTAA" ans = "CTAA" 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 c = "CTCG" ans = "CTCG" 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 c = "GGTG" ans = "GGTG" 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 c = "CGTT" ans = "CGTT"

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 c = "CAAA" ans = "CAAA" 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 c = "TTTG" ans = "TTTG" 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 c = "ACAA" ans = "ACAA" 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 c = "TTGT" ans = "TTGT" 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 c = "AACA" ans = "AACA" 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 c = "TGTT" ans = "TGTT" 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 c = "AAAC" ans = "AAAC" 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 c = "GTTT" ans = "GTTT"

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 c = "ACTG" ans = "ACTG" 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 c = "CATG" ans = "CATG" 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 c = "ATCG" ans = "ATCG" 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 c = "TACG" ans = "TACG" 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 l = 1 1 0 0 0 1 1 0 c = "TCAG" ans = "TCAG" 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 l = 1 1 0 0 1 0 0 1 c = "CTAG" ans = "CTAG" 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 l = 1 0 1 1 0 1 0 0 c = "ACGT" ans = "ACGT" l = 0 1 1 0 1 1 0 0 l = 0 0 0 1 1 0 1 1 l = 1 1 0 0 0 1 1 0 l = 1 0 1 1 0 0 0 1 c = "CAGT" ans = "CAGT" l = 0 0 1 0 0 1 1 1 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 c = "AGCT" ans = "AGCT" l = 1 1 1 0 0 1 0 0 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 c = "GACT" ans = "GACT" 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 l = 1 0 0 0 0 1 1 1 c = "GCAT" ans = "GCAT" 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 l = 1 0 0 0 1 1 0 1 c = "CGAT" ans = "CGAT" l = 0 0 0 1 1 0 1 1 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 c = "AGTC" ans = "AGTC" l = 1 1 0 1 1 0 0 0 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 c = "GATC" ans = "GATC" 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 l = 0 1 1 1 1 0 0 0 c = "ATGC" ans = "ATGC" l = 1 0 0 1 1 1 0 0 l = 0 0 1 0 0 1 1 1 l = 1 1 0 0 1 0 0 1 l = 0 1 1 1 0 0 1 0 c = "TAGC" ans = "TAGC" 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 l = 0 1 0 0 1 1 1 0 c = "TGAC" ans = "TGAC" 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 c = "GTAC" ans = "GTAC" 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 c = "GCTA" ans = "GCTA" 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 c = "CGTA" ans = "CGTA" 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 c = "GTCA" ans = "GTCA" 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 c = "TGCA" ans = "TGCA" 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 c = "TCGA" ans = "TCGA" 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 c = "CTGA" ans = "CTGA"

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!