-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathas_domains.sql
48 lines (40 loc) · 1.75 KB
/
as_domains.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
CREATE TABLE antismash.as_domains (
as_domain_id serial NOT NULL,
detection text,
score float8,
evalue float8,
translation text,
pks_signature text,
minowa text,
nrps_predictor text,
stachelhaus text,
consensus text,
kr_activity bool,
kr_stereochemistry text,
as_domain_profile_id int4,
location text NOT NULL,
cds_id int4,
module_id int4 REFERENCES antismash.modules ON DELETE SET NULL,
function_id int4 REFERENCES antismash.module_domain_functions ON DELETE SET NULL,
follows int4 REFERENCES antismash.as_domains ON DELETE SET NULL,
CONSTRAINT as_domains_pkey PRIMARY KEY (as_domain_id),
CONSTRAINT as_domains_as_domain_profile_id_fkey FOREIGN KEY (as_domain_profile_id) REFERENCES antismash.as_domain_profiles (as_domain_profile_id) ON DELETE CASCADE,
CONSTRAINT as_domains_cds_id_fkey FOREIGN KEY (cds_id) REFERENCES antismash.cdss (cds_id) ON DELETE CASCADE
);
COMMENT ON TABLE antismash.as_domains IS
'A functional domain on a gene as predicted by antiSMASH';
CREATE INDEX as_domains_cds_id_idx ON antismash.as_domains (cds_id);
CREATE INDEX as_domains_follows_idx ON antismash.as_domains (follows);
CREATE TABLE antismash.as_domain_subtypes (
subtype text PRIMARY KEY,
description text
);
COMMENT ON TABLE antismash.as_domain_subtypes IS
'Possible subtypes of domains predicted by antiSMASH, e.g. TransAT-KS';
CREATE TABLE antismash.rel_as_domain_to_subtype (
as_domain_id int4 NOT NULL REFERENCES antismash.as_domains,
subtype text NOT NULL REFERENCES antismash.as_domain_subtypes,
CONSTRAINT rel_as_domain_to_subtype_pkey PRIMARY KEY (as_domain_id, subtype)
);
COMMENT ON TABLE antismash.as_domain_subtypes IS
'Relationships between a specific aSDomain and subtypes';