Skip to content

Commit

Permalink
migrating local repository
Browse files Browse the repository at this point in the history
svn path=/bioperl-pedigree/trunk/; revision=12081
  • Loading branch information
hyphaltip committed Nov 23, 2002
1 parent a9ea6e3 commit 4fcc828
Showing 1 changed file with 33 additions and 6 deletions.
39 changes: 33 additions & 6 deletions sql/pedgeno.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ CREATE TABLE person (
KEY i_id ( display_id )
);

CREATE TABLE family (
family_id integer(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
CREATE TABLE group (
group_id integer(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
center char(12) NOT NULL,
number integer(8) NOT NULL,
type char(8) NULL DEFAULT 'FAMILY',

UNIQUE KEY i_ctr_num ( center, number )
);

CREATE TABLE family_person (
family_id integer(11) NOT NULL REFERENCES family ( family_id ),
CREATE TABLE group_person_rel (
group_id integer(11) NOT NULL REFERENCES group ( group_id ),
person_id integer(11) NOT NULL REFERENCES person ( person_id ),
PRIMARY KEY pk_fam_person ( family_id, person_id)
PRIMARY KEY pk_gp_person ( group_id, person_id)
);

-- take this from map tables for pedmaps
Expand Down Expand Up @@ -63,14 +63,17 @@ create table variation_marker (
UNIQUE KEY i_primers ( upstreamflank, dnstreamflank )
);

-- for creating a collection of people who may not be related
-- such as a white caucasian control group, etc

CREATE TABLE population (
population_id integer(9) NOT NULL AUTO_INCREMENT PRIMARY KEY,
name varchar(32) NOT NULL,
description varchar(128) NOT NULL,
UNIQUE KEY (name)
);

CREATE TABLE population_assignment (
CREATE TABLE population_person_rel (
population_id integer(9) NOT NULL REFERENCES population (population_id),
person_id integer(11) NOT NULL REFERENCES person (person_id),
PRIMARY KEY pk_pop_person ( population_id, person_id)
Expand All @@ -85,6 +88,8 @@ CREATE TABLE allele (
);


-- calculated frequency of an allele in a given population

CREATE TABLE allele_frequency (
population_id integer(9) NOT NULL REFERENCES population (population_id),
allele_id integer(11) NOT NULL REFERENCES allele ( allele_id ),
Expand All @@ -93,6 +98,28 @@ CREATE TABLE allele_frequency (
PRIMARY KEY pk_allele_freq (population_id, allele_id)
);

CREATE TABLE pedigree_set (
pedigree_id integer(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
name varchar(128) NOT NULL,
date_updated date NULL,
UNIQUE KEY i_name (name)
);

-- a group can be in more than one pedigree file

CREATE TABLE pedigree_groups_rel (
pedigree_id integer(11) NOT NULL REFERENCES pedigree_set (pedigree_id),
group_id integer(11) NOT NULL REFERENCES group (group_id),
PRIMARY KEY pk_ped_grp (pedigree_id, group_id)
);

-- The relavent markers for this pedigree_set

CREATE TABLE pedigree_groups_rel (
pedigree_id integer(11) NOT NULL REFERENCES pedigree_set (pedigree_id),
marker_id integer(11) NOT NULL REFERENCES marker (marker_id),
PRIMARY KEY pk_ped_mkr (pedigree_id, marker_id)
);

INSERT INTO markertype ( type, name, description )
VALUES ( 1, 'DX', 'Disease Marker');
Expand Down

0 comments on commit 4fcc828

Please sign in to comment.