I am looking to develop an app that generates a single identicon image that summarizes the genome information in visual form.

Identicons are essentially a visual hash of of data. usually string data such as an IP address or name. In this case, rather than generating an identicon from a single piece of string data. I want to use the entirety of the genotype information (the 4th column) to summarize this data into a graphical representation as a way to visually identify someone from their partial genome.

The input file is a tab-separated file consisting of 600,000 rows. Each row contains the chromosome identifier (There are 23 in total: 1-20, X, Y or MT), the position of the single nucleotide polymorphism (SNP) and the genotype (a two character variation of G,A,T or C). Below is a two line excerpt from the file.

#RSID        Chromosome   Position  Genotype
rs7537756       1         854250    AG
rs13302982      1         861808    GG

Using the Chromasome, Position and Genotype columns. I would like to generate an abstract identifying image from this data. Since there is far too much data, this image does not need to capture the data, only summarize it in a visual fashion. The goal is to setup a service that analyzes anyone's genome file and generates an identicon that is unique to them.

For more information on identicons See the wiki page

  • 1
    $\begingroup$ I can't tell what you're trying to do at all. What is the icon supposed to represent? Do you want one icon per line? One per file? Imagine how many lines of code it might take to do what you want. Now, ask yourself if your description of the problem (essentially, the first sentence of your post) is even remotely adequate to describe that task to somebody who's never met you. $\endgroup$ – David Richerby Mar 24 '15 at 21:17
  • $\begingroup$ My apologies. I added some more clarification. $\endgroup$ – Andrew Munro Mar 24 '15 at 22:31
  • $\begingroup$ 1. I'm still not clear on what properties you want the image to have. Can you edit the question to specify that? 2. An identicon is one specific scheme, but there might be other very different schemes you could consider. If you frame your question as "I'm looking for an identicon for my data", then the only answer is "OK, then, use an identicon". But if you frame your question as "I'm looking for a visualization with properties X, Y, and Z; I've looked at identicons and they provide X but not Y or Z", then you open things up to a solution that might meet your needs. $\endgroup$ – D.W. Mar 24 '15 at 22:33
  • $\begingroup$ 3. Also, can you please clarify what you mean by "visually identify someone from their partial genome"? What properties do you need from the visual hash? Are you aware that if you sequence Alice's genome twice, you'll probably get two slightly different answers (genome sequencing is noisy)? And what if the two partial genomes from the same person start at different offsets/positions? I suspect nothing achievable is going to be very useful in practice, for visualizing when two genomes come from the same person. $\endgroup$ – D.W. Mar 24 '15 at 22:35

If all you want is uniqueness, you could use a visual hash. Hash all of the data (say, with SHA256), then apply a visual hash.

A visual hash is a function $H$. Given a short binary string $x$ (say, 256 bits long), the visual hash computes $H(x)$, a random picture that is a visualization of $x$. The output of the hash is a visualization of the string -- a picture or image of some form -- with the property that different binary strings will lead to different images. Also, $H$ is a deterministic algorithm, so if you hash the same binary string twice, you'll get the same picture both times.

Below I list some visual hash schemes that have been proposed, along with sample images produced by each scheme.

Random Art for PGP keys

Random Art example


(As you'll notice, this is actually a visualization of multiple different schemes at once.)

See also the following research paper:

Hash Visualization: a New Technique to improve Real-World Security. Adrian Perrig and Dawn Song. Proceedings of the International Workshop on Cryptographic Techniques and E-Commerce (CrypTEC), Hong Kong, July 1999.

VizHash GD

VizHash GD example



Snowflake example


Older: README, source

OpenSSH's Visual Host Key

+--[ RSA 2048]----+
|   .+            |
|   + o           |
|  o o +          |
|   + o +         |
|  . o E S        |
|   + * .         |
|    X o .        |
|   . * o         |
|   .o .          |



Use the Edinburgh Genome Foundry

This answer is rather late to the party but may be useful to others seeking a library.

The Edinburgh Genome Foundry provides a range of useful DNA manipulation tools and releases their code under the MIT licence.

In the case of the genome identicon, they provide the sequenticon project which provides a standard set of colours and patterns for use in laboratories.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.