Thanks a lot Pierre! Once I come up with this unique id, I could use md5 for generating a hash with it. That's a good idea!
My concern was more about generating this unique_id by translating the genotypes in the last column of the VCF (Ex. 0/0, 0/1 and 1/1) using the columns REF and ALT (Ex. G and A) to something like this G-G, G-A and A-A and combining this with the 20-14370 part.
Linking two tables, one with chr-position and another with the genotypes, its all I want to avoid because of performance issues :) This task will have to be repeated a lot of times!
About GEMINI, i checked their table and I didn't see anything like that in here http://gemini.readthedocs.org/en/latest/content/database_schema.html#the-variants-table
For me it's strange no one ever defined a unique id to express exactly the chr-pos-genotype of an individual. The only way I could imagine how to do this would be by combining some columns of the VCF.
I'm assuming there is no simple way to do this, so my algorithm will be like this:
1) Get columns CHROM (1), POS (2), REF (4), ALT (5) and columns with genotypes
2) Generate a list with REF and ALT columns Ex. [A,G,T]
3) Translate 0/0, 0/1, 1/1 to A-A, A-G, A-T
Here i have to define a way to sort the genotypes cause i want 0/1 == 1/0 == 0|1 == 1|0 in order to generate the same unique id for this genotypes. So G-A would become A-G and T-A would become A-T, just to get the same "md5" for both of them.
4) Integrate the previous string with the chr-position part (20-14370) to FINALLY get my UNIQUE ID for each genotype:
20-14370-G-A
Does it sound too complicated ? :)
Cheers!