I want to pack a giant DNA sequence with an iOS app (about 3,000,000,000 base pairs). Each base pair can have a value A
, C
, T
or G
consider this, how many different combinations can you get? out of 4 (i think its about 16 )
actg = 1 atcg = 2 atgc = 3 and so on, so that
you can create an array like [1,2,3] then you can go one step further,
check if 1 is follow by 2, convert 12 to a, 13 = b and so on... if I understand DNA a bit it means that you cannot get a certain value
as a must be match with c, and t with g or something like that which reduces your options, so basically you can look for a sequence and give it a something you can also convert back...