Mercurial > repos > earlhaminst > gafa
comparison schema/gafa.sql @ 6:c15476d4271c draft
planemo upload for repository https://github.com/TGAC/earlham-galaxytools/tree/master/tools/GAFA/ commit af1fd308dde99cf40a9422c53dc680932be3765d
author | earlhaminst |
---|---|
date | Tue, 20 Mar 2018 11:06:51 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
5:c388666f58e0 | 6:c15476d4271c |
---|---|
1 CREATE TABLE meta ( | |
2 version VARCHAR PRIMARY KEY NOT NULL); | |
3 CREATE TABLE gene ( | |
4 gene_id VARCHAR PRIMARY KEY NOT NULL, | |
5 gene_symbol VARCHAR, | |
6 species VARCHAR NOT NULL, | |
7 gene_json VARCHAR NOT NULL); | |
8 CREATE INDEX gene_symbol_index ON gene (gene_symbol); | |
9 CREATE TABLE transcript ( | |
10 transcript_id VARCHAR PRIMARY KEY NOT NULL, | |
11 protein_id VARCHAR UNIQUE, | |
12 protein_sequence VARCHAR, | |
13 gene_id VARCHAR NOT NULL REFERENCES gene(gene_id)); | |
14 CREATE VIEW transcript_species as | |
15 SELECT transcript_id, species | |
16 FROM transcript JOIN gene | |
17 ON transcript.gene_id = gene.gene_id; | |
18 CREATE TABLE gene_family ( | |
19 gene_family_id INTEGER PRIMARY KEY, | |
20 gene_tree VARCHAR NOT NULL); | |
21 CREATE TABLE gene_family_member ( | |
22 gene_family_id INTEGER NOT NULL REFERENCES gene_family(gene_family_id), | |
23 protein_id VARCHAR KEY NOT NULL REFERENCES transcript(protein_id), | |
24 protein_alignment VARCHAR NOT NULL, | |
25 PRIMARY KEY (gene_family_id, protein_id)); |