 # variation_id  - foreign key ref variation
 # allele        - string representing an allele.  E.g. 'A', 'T'
 # frequency     - the frequency of this allele in population 
-# population_id - foreign key ref population
+# sample_id     - foreign key ref population
 
 create table allele(
 	allele_id int not null auto_increment,
 	variation_id int not null,
 	allele text,
 	frequency float,
-	population_id int,
+	sample_id int,
 
 	primary key( allele_id ),
 	key variation_idx( variation_id,allele(10) )
 );
 
+#
+# sample
+#
+# A base class to merge the individual and population or assay in a more general]
+# concept, basically to have a unique sample_id
+
+# sample_id      - primary key, internal identifier
+# name           - name or identifier of the sample
+# size           - if the size is NULL its not known or not relevant for this sample
+#                  eg. "european" would not have a size 
+# description    - free text that describes the sample
+
+create table sample(
+	sample_id int not null auto_increment,
+	name varchar(255) not null,
+	size int,
+	description text,
+
+	primary key( sample_id ),
+  unique name_idx( name )
+);
 
 #
 # population

# allele_1 - first allele in the genotype
# allele_2 - second allele in the genotype
# frequency - frequency of the genotype in the population
# population_id - foreign key, references population table
#

create table population_genotype (



#
# sample_synonym
#
# Table containing alternate identifiers for the same sample.
# For example this might be pop_id identifiers for the population in dbSNP
# or individual id identifiers for the individual in dbSNP.
#
#

create table sample_synonym (
  sample_synonym_id int not null auto_increment,
  sample_id int not null,
  source_id int not null,
  name varchar(255),

  primary key(sample_synonym_id),
  key sample_idx (sample_id),
  key (name, source_id)
);


