# Description of Schema

## Tables
phenotype
phenotype_cvterm
feature_phenotype

### phenotype | Top

Comments:
$Id: phenotype.sql,v 1.6 2007-04-27 16:09:46 emmert Exp $
==========================================
Chado phenotype module
05-31-2011
added 'name' column to phenotype. non-unique human readable field.
=================================================================
Dependencies:
:import cvterm from cv
:import feature from sequence
=================================================================
================================================
TABLE: phenotype
================================================
A phenotypic statement, or a single atomic phenotypic observation, is a controlled sentence describing observable effects of non-wild type function. E.g. Obs=eye, attribute=color, cvalue=red.

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
phenotype_id | integer | 11 |  | PRIMARY KEY, NOT NULL |
uniquename | text | 64000 |  | UNIQUE, NOT NULL |
name | text | 64000 | null |  |
observable_id | integer | 10 |  | The entity: e.g. anatomy_part, biological_process. | cvterm.cvterm_id
attr_id | integer | 10 |  | Phenotypic attribute (quality, property, attribute, character) - drawn from PATO. | cvterm.cvterm_id
value | text | 64000 |  | Value of attribute - unconstrained free text. Used only if cvalue_id is not appropriate. |
cvalue_id | integer | 10 |  | Phenotype attribute value (state). | cvterm.cvterm_id
assay_id | integer | 10 |  | Evidence type. | cvterm.cvterm_id

### Indices

Name | Fields
--- | ---
phenotype_idx1 | cvalue_id
phenotype_idx2 | observable_id
phenotype_idx3 | attr_id

### Constraints

Type | Fields
--- | ---
NOT NULL | phenotype_id
NOT NULL | uniquename
FOREIGN KEY | observable_id
FOREIGN KEY | attr_id
FOREIGN KEY | cvalue_id
FOREIGN KEY | assay_id
UNIQUE | uniquename

### phenotype_cvterm | Top

Comments:
================================================
TABLE: phenotype_cvterm
================================================
NULL

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
phenotype_cvterm_id | integer | 11 |  | PRIMARY KEY, NOT NULL |
phenotype_id | integer | 10 |  | UNIQUE, NOT NULL | phenotype.phenotype_id
cvterm_id | integer | 10 |  | UNIQUE, NOT NULL | cvterm.cvterm_id
rank | integer | 10 | 0 | UNIQUE, NOT NULL |

### Indices

Name | Fields
--- | ---
phenotype_cvterm_idx1 | phenotype_id
phenotype_cvterm_idx2 | cvterm_id

### Constraints

Type | Fields
--- | ---
NOT NULL | phenotype_cvterm_id
NOT NULL | phenotype_id
FOREIGN KEY | phenotype_id
NOT NULL | cvterm_id
FOREIGN KEY | cvterm_id
NOT NULL | rank
UNIQUE | phenotype_id, cvterm_id, rank

### feature_phenotype | Top

Comments:
================================================
TABLE: feature_phenotype
================================================
NULL

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
feature_phenotype_id | integer | 11 |  | PRIMARY KEY, NOT NULL |
feature_id | integer | 10 |  | UNIQUE, NOT NULL | feature.feature_id
phenotype_id | integer | 10 |  | UNIQUE, NOT NULL | phenotype.phenotype_id

### Indices

Name | Fields
--- | ---
feature_phenotype_idx1 | feature_id
feature_phenotype_idx2 | phenotype_id

### Constraints

Type | Fields
--- | ---
NOT NULL | feature_phenotype_id
NOT NULL | feature_id
FOREIGN KEY | feature_id
NOT NULL | phenotype_id
FOREIGN KEY | phenotype_id
UNIQUE | feature_id, phenotype_id

Created by SQL::Translator 0.11003