(* Build all possible sequence axes *)
g =.; a =.; c =.; u =.;
s1 = Permutations [{g, a, c, u}];
(* manually pair mirrors
{g,a,c,u}{u,c,a,g}
{g,a,u,c}{c,u,a,g}
{g,c,a,u}{u,a,c,g}
{g,c,u,a}{a,u,c,g}
{g,u,a,c}{c,a,u,g}
{g,u,c,a}{g,u,c,a}
{a,g,c,u}{u,c,g,a}
{a,g,u,c}{c,u,g,a}
{a,c,g,u}{u,g,c,a}
{a,u,g,c}{c,g,u,a}
{c,g,a,u}{u,a,g,c}
{c,a,g,u}{u,g,a,c}
manually eliminate mirrors:
{g,a,c,u},
{g,a,u,c},
{g,c,a,u},
{g,c,u,a},
{g,u,a,c},
{g,u,c,a},
{a,g,c,u},
{a,g,u,c},
{a,c,g,u},
{a,u,g,c},
{c,g,a,u},
{c,a,g,u}
*)
t =.;
c1 = Tuples[{g, a, c, u}, 3];
a1 = Table[0, {ii, 64}];
For[ii = 1, ii <= 64, ii++,
If[c1[[ii]] == {g, g, g}, a1[[ii]] = g];
If[c1[[ii]] == {g, g, a}, a1[[ii]] = g];
If[c1[[ii]] == {g, g, c}, a1[[ii]] = g];
If[c1[[ii]] == {g, g, u}, a1[[ii]] = g];
If[c1[[ii]] == {g, a, g}, a1[[ii]] = e];
If[c1[[ii]] == {g, a, a}, a1[[ii]] = e];
If[c1[[ii]] == {g, a, c}, a1[[ii]] = d];
If[c1[[ii]] == {g, a, u}, a1[[ii]] = d];
If[c1[[ii]] == {g, c, g}, a1[[ii]] = a];
If[c1[[ii]] == {g, c, a}, a1[[ii]] = a];
If[c1[[ii]] == {g, c, c}, a1[[ii]] = a];
If[c1[[ii]] == {g, c, u}, a1[[ii]] = a];
If[c1[[ii]] == {g, u, g}, a1[[ii]] = v];
If[c1[[ii]] == {g, u, a}, a1[[ii]] = v];
If[c1[[ii]] == {g, u, c}, a1[[ii]] = v];
If[c1[[ii]] == {g, u, u}, a1[[ii]] = v];
If[c1[[ii]] == {a, g, g}, a1[[ii]] = r];
If[c1[[ii]] == {a, g, a}, a1[[ii]] = r];
If[c1[[ii]] == {a, g, c}, a1[[ii]] = s];
If[c1[[ii]] == {a, g, u}, a1[[ii]] = s];
If[c1[[ii]] == {a, a, g}, a1[[ii]] = k];
If[c1[[ii]] == {a, a, a}, a1[[ii]] = k];
If[c1[[ii]] == {a, a, c}, a1[[ii]] = n];
If[c1[[ii]] == {a, a, u}, a1[[ii]] = n];
If[c1[[ii]] == {a, c, g}, a1[[ii]] = t];
If[c1[[ii]] == {a, c, a}, a1[[ii]] = t];
If[c1[[ii]] == {a, c, c}, a1[[ii]] = t];
If[c1[[ii]] == {a, c, u}, a1[[ii]] = t];
If[c1[[ii]] == {a, u, g}, a1[[ii]] = m];
If[c1[[ii]] == {a, u, a}, a1[[ii]] = i];
If[c1[[ii]] == {a, u, c}, a1[[ii]] = i];
If[c1[[ii]] == {a, u, u}, a1[[ii]] = i];
If[c1[[ii]] == {c, g, g}, a1[[ii]] = r];
If[c1[[ii]] == {c, g, a}, a1[[ii]] = r];
If[c1[[ii]] == {c, g, c}, a1[[ii]] = r];
If[c1[[ii]] == {c, g, u}, a1[[ii]] = r];
If[c1[[ii]] == {c, a, g}, a1[[ii]] = q];
If[c1[[ii]] == {c, a, a}, a1[[ii]] = q];
If[c1[[ii]] == {c, a, c}, a1[[ii]] = h];
If[c1[[ii]] == {c, a, u}, a1[[ii]] = h];
If[c1[[ii]] == {c, c, g}, a1[[ii]] = p];
If[c1[[ii]] == {c, c, a}, a1[[ii]] = p];
If[c1[[ii]] == {c, c, c}, a1[[ii]] = p];
If[c1[[ii]] == {c, c, u}, a1[[ii]] = p];
If[c1[[ii]] == {c, u, g}, a1[[ii]] = l];
If[c1[[ii]] == {c, u, a}, a1[[ii]] = l];
If[c1[[ii]] == {c, u, c}, a1[[ii]] = l];
If[c1[[ii]] == {c, u, u}, a1[[ii]] = l];
If[c1[[ii]] == {u, g, g}, a1[[ii]] = w];
If[c1[[ii]] == {u, g, a}, a1[[ii]] = x];
If[c1[[ii]] == {u, g, c}, a1[[ii]] = c];
If[c1[[ii]] == {u, g, u}, a1[[ii]] = c];
If[c1[[ii]] == {u, a, g}, a1[[ii]] = x];
If[c1[[ii]] == {u, a, a}, a1[[ii]] = x];
If[c1[[ii]] == {u, a, c}, a1[[ii]] = y];
If[c1[[ii]] == {u, a, u}, a1[[ii]] = y];
If[c1[[ii]] == {u, c, g}, a1[[ii]] = s];
If[c1[[ii]] == {u, c, a}, a1[[ii]] = s];
If[c1[[ii]] == {u, c, c}, a1[[ii]] = s];
If[c1[[ii]] == {u, c, u}, a1[[ii]] = s];
If[c1[[ii]] == {u, u, g}, a1[[ii]] = l];
If[c1[[ii]] == {u, u, a}, a1[[ii]] = l];
If[c1[[ii]] == {u, u, c}, a1[[ii]] = f];
If[c1[[ii]] == {u, u, u}, a1[[ii]] = f]
]
a1
c2 = Partition[c1, 4];
a2 = Partition[a1, 4];
(* Construct an adjacency matrix from the amino acids that are now \
partitioned according to the order of the set in the Tuples call \
above. This example is the gacu sequence.
{{g,g,g,g},
{e,e,d,d},
{a,a,a,a},
{v,v,v,v},
{r,r,s,s},
{k,k,n,n},
{t,t,t,t},
{m,i,i,i},
{r,r,r,r},
{q,q,h,h},
{p,p,p,p},
{l,l,l,l},
{w,x,c,c},
{x,x,y,y},
{s,s,s,s},
{l,l,f,f}}
The mapping is from 3D to 21D (where the most compact topology is found) and then back to 3D where the elegance can be observed for particular orderings of nucleotides along the axis of the cube in 12 isotropic configurations all having mirrors.
There are 12 horizontal 12 vertical connectors per "paragraph". The paragraphs are stacked. With the g-to-v paragraph stacked on top, the order is gacu moving down into the stack. We put in the gacu cube as the first test, and this final reading of this matrix is by order g,a,c,u.
(We need to get the 3D cube into Mathematica Manipulate where sliders along each of the three axes could be used to change the 64 lattice points displaying the 20 aa's and stops. 12^3 = 1728 different cubes.)
3rd position - 3 connections left to right each line x 16 = 48 connectors
In a Flattened string, Positions: 1<->2, 2<->3<->4, skip, 5 <-> 6, 6 <-> 7, 7[TwoWayRule]8,skip,9[TwoWayRule]10,
etc.
2nd position - 3 connections top to bottom each row x 16 = 48
connectors
1[TwoWayRule]5,5[TwoWayRule]9,9[TwoWayRule]13, (break, reindex +4)
,2[TwoWayRule]6,6[TwoWayRule]10,10[TwoWayRule]14, etc.
1st position - 3 connections per line running into page with top
paragraph stacked on top.
1[TwoWayRule]17, 17[TwoWayRule]33,33<->49,skip,etc.,
16[TwoWayRule]32,32[TwoWayRule]48, 48[TwoWayRule]64 .
Now reading in the order positions: 1, 2, 3.
THIS IS THE FIRST OF 12 CUBES: "GACU Cube".
We hypothesize from the XXXW decryption key, not used here, this is
the most compact, i.e., most self-loops.
aa1 =
{a1[[1]] <-> a1[[17]], a1[[17]] <-> a1[[33]], a1[[33]] <-> a1[[49]],
a1[[2]] <-> a1[[18]], a1[[18]] <-> a1[[34]], a1[[34]] <-> a1[[50]],
a1[[3]] <-> a1[[19]], a1[[19]] <-> a1[[35]], a1[[35]] <-> a1[[51]],
a1[[4]] <-> a1[[20]], a1[[20]] <-> a1[[36]], a1[[36]] <-> a1[[52]],
a1[[5]] <-> a1[[21]], a1[[21]] <-> a1[[37]], a1[[37]] <-> a1[[53]],
a1[[6]] <-> a1[[22]], a1[[22]] <-> a1[[38]], a1[[38]] <-> a1[[54]],
a1[[7]] <-> a1[[23]], a1[[23]] <-> a1[[39]], a1[[39]] <-> a1[[55]],
a1[[8]] <-> a1[[24]], a1[[24]] <-> a1[[40]], a1[[40]] <-> a1[[56]],
a1[[9]] <-> a1[[25]], a1[[25]] <-> a1[[41]], a1[[41]] <-> a1[[57]],
a1[[10]] <-> a1[[26]], a1[[26]] <-> a1[[42]], a1[[42]] <-> a1[[58]],
a1[[11]] <-> a1[[27]], a1[[27]] <-> a1[[43]], a1[[43]] <-> a1[[59]],
a1[[12]] <-> a1[[28]], a1[[28]] <-> a1[[44]], a1[[44]] <-> a1[[60]],
a1[[13]] <-> a1[[29]], a1[[29]] <-> a1[[45]], a1[[45]] <-> a1[[61]],
a1[[14]] <-> a1[[30]], a1[[30]] <-> a1[[46]], a1[[46]] <-> a1[[62]],
a1[[15]] <-> a1[[31]], a1[[31]] <-> a1[[47]], a1[[47]] <-> a1[[63]],
a1[[16]] <-> a1[[32]], a1[[32]] <-> a1[[48]], a1[[48]] <-> a1[[64]],
a1[[1]] <-> a1[[5]], a1[[5]] <-> a1[[9]], a1[[9]] <-> a1[[13]],
a1[[2]] <-> a1[[6]], a1[[6]] <-> a1[[10]], a1[[10]] <-> a1[[14]],
a1[[3]] <-> a1[[7]], a1[[7]] <-> a1[[11]], a1[[11]] <-> a1[[15]],
a1[[4]] <-> a1[[8]], a1[[8]] <-> a1[[12]], a1[[12]] <-> a1[[16]],
a1[[17]] <-> a1[[21]], a1[[21]] <-> a1[[25]], a1[[25]] <-> a1[[29]],
a1[[18]] <-> a1[[22]], a1[[22]] <-> a1[[26]], a1[[26]] <-> a1[[30]],
a1[[19]] <-> a1[[23]], a1[[23]] <-> a1[[27]], a1[[27]] <-> a1[[31]],
a1[[20]] <-> a1[[24]], a1[[24]] <-> a1[[28]], a1[[28]] <-> a1[[32]],
a1[[33]] <-> a1[[37]], a1[[37]] <-> a1[[41]], a1[[41]] <-> a1[[45]],
a1[[34]] <-> a1[[38]], a1[[38]] <-> a1[[42]], a1[[42]] <-> a1[[46]],
a1[[35]] <-> a1[[39]], a1[[39]] <-> a1[[43]], a1[[43]] <-> a1[[47]],
a1[[36]] <-> a1[[40]], a1[[40]] <-> a1[[44]], a1[[44]] <-> a1[[48]],
a1[[49]] <-> a1[[53]], a1[[53]] <-> a1[[57]], a1[[57]] <-> a1[[61]],
a1[[50]] <-> a1[[54]], a1[[54]] <-> a1[[58]], a1[[58]] <-> a1[[62]],
a1[[51]] <-> a1[[55]], a1[[55]] <-> a1[[59]], a1[[59]] <-> a1[[63]],
a1[[52]] <-> a1[[56]], a1[[56]] <-> a1[[60]], a1[[60]] <-> a1[[64]],
a1[[1]] <-> a1[[2]], a1[[2]] <-> a1[[3]], a1[[3]] <-> a1[[4]],
a1[[5]] <-> a1[[6]], a1[[6]] <-> a1[[7]], a1[[7]] <-> a1[[8]],
a1[[9]] <-> a1[[10]], a1[[10]] <-> a1[[11]], a1[[11]] <-> a1[[12]],
a1[[13]] <-> a1[[14]], a1[[14]] <-> a1[[15]], a1[[15]] <-> a1[[16]],
a1[[17]] <-> a1[[18]], a1[[18]] <-> a1[[19]], a1[[19]] <-> a1[[20]],
a1[[21]] <-> a1[[22]], a1[[22]] <-> a1[[23]], a1[[23]] <-> a1[[24]],
a1[[25]] <-> a1[[26]], a1[[26]] <-> a1[[27]], a1[[27]] <-> a1[[28]],
a1[[29]] <-> a1[[30]], a1[[30]] <-> a1[[31]], a1[[31]] <-> a1[[32]],
a1[[33]] <-> a1[[34]], a1[[34]] <-> a1[[35]], a1[[35]] <-> a1[[36]],
a1[[37]] <-> a1[[38]], a1[[38]] <-> a1[[39]], a1[[39]] <-> a1[[40]],
a1[[41]] <-> a1[[42]], a1[[42]] <-> a1[[43]], a1[[43]] <-> a1[[44]],
a1[[45]] <-> a1[[46]], a1[[46]] <-> a1[[47]], a1[[47]] <-> a1[[48]],
a1[[49]] <-> a1[[50]], a1[[50]] <-> a1[[51]], a1[[51]] <-> a1[[52]],
a1[[53]] <-> a1[[54]], a1[[54]] <-> a1[[55]], a1[[55]] <-> a1[[56]],
a1[[57]] <-> a1[[58]], a1[[58]] <-> a1[[59]], a1[[59]] <-> a1[[60]],
a1[[61]] <-> a1[[62]], a1[[62]] <-> a1[[63]], a1[[63]] <-> a1[[64]]
}
Graph[aa1, VertexShapeFunction -> "Name"]
BioSequence[]
and related functions likeBioSequenceTranslate[]
? $\endgroup$