I have a very elementary question. In Mathematica, I want to convert A,C,G,T letters from GenomeData to base-4 (or for that matter any 4 different integers). How do I do that? Actually, I want to 2dplot the sequence as a random walk. I know how to do this for integer sequence, but my try of it directly from ACGT letters does not work. Perhaps, there is a command to do so?
Thanks for your help! This is quite close to what I need. One more technical help to ask. Is there any way to rainbow color decorate the first graph along the sequence? i.e. starting from red and then progressing toward violet?
A word of advice, it is considered impolite and generally against forum rules to just bluntly solicit help without showing your own attempts. Documentation is very detailed and full of examples, for instance: ColorFunction. You should read about how to post properly .
So is this what you wanted?
ListPlot[seq, Joined -> True, Mesh -> Full, PlotStyle -> Thick,
ColorFunction -> Function[{x, y}, ColorData[{"Rainbow", "Reverse"}][x]]]
ListPlot[seq, Joined -> True, Mesh -> Full, PlotStyle -> Thick, Filling -> Bottom,
ColorFunction -> Function[{x, y}, ColorData[{"Rainbow", "Reverse"}][x]]]
Also the Demonstrations Project has a lot of free relevant examples, for instance:
A different way to go about this is to use the “Chaos Game Representation”. Please see this post:



