GO Database Schema Autodoc

This is the GO Database Schema documentation, in Autodoc format. Everything on this page has been automatically generated from the schema metadata. For more background on the schema, please read GO Database documentation.

note on modules: The tables are partitioned into modules for the purposes of Autodoc. These modules are invisible in the actual instantiations of the database, so the table "go_graph.term" is just simply "term"

This documentation was generated on 2008-04-11


Schema go_annotation_reports


View: go_annotation_reports.annotated_publication_total

ungrouped: single number

go_annotation_reports.annotated_publication_total Structure
F-Key Name Type Description
total bigint
SELECT count
(DISTINCT evidence.dbxref_id) AS total 
FROM go_associations.evidence;

Index - Schema go_annotation_reports


View: go_annotation_reports.annotated_publication_total_by_evidence_code_non_additive

non-additive: summing the totals does not give the total number of publications; this is because a publication may describe two or more distinct pieces of evidence

go_annotation_reports.annotated_publication_total_by_evidence_code_non_additive Structure
F-Key Name Type Description
code character varying(8)
total bigint
SELECT evidence.code
, count
(DISTINCT evidence.dbxref_id) AS total 
FROM go_associations.evidence 
GROUP BY evidence.code;

Index - Schema go_annotation_reports


View: go_annotation_reports.annotated_total_gps_by_evidence_code_non_additive

non-additive: summing the totals does not give the total number of gene products; this is because they are double counted through distinct annotations using different codes

go_annotation_reports.annotated_total_gps_by_evidence_code_non_additive Structure
F-Key Name Type Description
code character varying(8)
total bigint
SELECT evidence.code
, count
(DISTINCT association.gene_product_id) AS total 
FROM (go_associations.association 
  JOIN go_associations.evidence 
    ON (
           (evidence.association_id = association.id)
     )
)
GROUP BY evidence.code;

Index - Schema go_annotation_reports


View: go_annotation_reports.association_contradiction

go_annotation_reports.association_contradiction Structure
F-Key Name Type Description
term_pos_id integer
term_pos_acc character varying(255)
term_pos_name character varying(255)
term_pos_term_type character varying(55)
term_neg_id integer
term_neg_acc character varying(255)
term_neg_name character varying(255)
term_neg_term_type character varying(55)
a_pos_id integer
gp_id integer
gp_symbol character varying(128)
gp_dbxref_id integer
gp_species_id integer
a_neg_id integer
SELECT term_pos.id AS term_pos_id
, term_pos.acc AS term_pos_acc
, term_pos.name AS term_pos_name
, term_pos.term_type AS term_pos_term_type
, term_neg.id AS term_neg_id
, term_neg.acc AS term_neg_acc
, term_neg.name AS term_neg_name
, term_neg.term_type AS term_neg_term_type
, a_pos.id AS a_pos_id
, gp.id AS gp_id
, gp.symbol AS gp_symbol
, gp.dbxref_id AS gp_dbxref_id
, gp.species_id AS gp_species_id
, a_neg.id AS a_neg_id 
FROM (
     (
           (
                 (
                       (go_graph.term term_pos 
                          JOIN go_associations.association a_pos 
                            ON (
                                   (term_pos.id = a_pos.term_id)
                             )
                       )
                    JOIN go_optimisations.graph_path 
                      ON (
                             (term_pos.id = graph_path.term2_id)
                       )
                 )
              JOIN go_associations.association a_neg 
                ON (
                       (graph_path.term1_id = a_neg.term_id)
                 )
           )
        JOIN go_associations.gene_product gp 
          ON (
                 (
                       (a_neg.gene_product_id = gp.id)
                     AND (a_pos.gene_product_id = gp.id)
                 )
           )
     )
  JOIN go_graph.term term_neg 
    ON (
           (term_neg.id = a_neg.term_id)
     )
)
WHERE (
     (a_pos.is_not = 0)
   AND (a_neg.is_not = 1)
);

Index - Schema go_annotation_reports


View: go_annotation_reports.association_contradiction_count_by_ontology

summary of association_contradiction, grouped by ontology

go_annotation_reports.association_contradiction_count_by_ontology Structure
F-Key Name Type Description
term_pos_term_type character varying(55)
count bigint
SELECT association_contradiction.term_pos_term_type
, count
(DISTINCT association_contradiction.gp_id) AS count 
FROM go_annotation_reports.association_contradiction 
GROUP BY association_contradiction.term_pos_term_type;

Index - Schema go_annotation_reports


View: go_annotation_reports.association_contradiction_direct

APPARENT contradictions in associations, based on the NOT column. note that these do not genuinely contradict as annotation is context-specific

go_annotation_reports.association_contradiction_direct Structure
F-Key Name Type Description
id integer
name character varying(255)
term_type character varying(55)
acc character varying(255)
is_obsolete integer
is_root integer
a_pos_id integer
gp_id integer
gp_symbol character varying(128)
gp_dbxref_id integer
gp_species_id integer
a_neg_id integer
SELECT term.id
, term.name
, term.term_type
, term.acc
, term.is_obsolete
, term.is_root
, a_pos.id AS a_pos_id
, gp.id AS gp_id
, gp.symbol AS gp_symbol
, gp.dbxref_id AS gp_dbxref_id
, gp.species_id AS gp_species_id
, a_neg.id AS a_neg_id 
FROM (
     (
           (go_graph.term 
              JOIN go_associations.association a_pos 
                ON (
                       (term.id = a_pos.term_id)
                 )
           )
        JOIN go_associations.gene_product gp 
          ON (
                 (a_pos.gene_product_id = gp.id)
           )
     )
  JOIN go_associations.association a_neg 
    ON (
           (
                 (term.id = a_neg.term_id)
               AND (a_neg.gene_product_id = gp.id)
           )
     )
)
WHERE (
     (a_pos.is_not = 0)
   AND (a_neg.is_not = 1)
);

Index - Schema go_annotation_reports


View: go_annotation_reports.association_contradiction_direct_count_by_ontology

go_annotation_reports.association_contradiction_direct_count_by_ontology Structure
F-Key Name Type Description
term_type character varying(55)
count bigint
SELECT association_contradiction_direct.term_type
, count
(DISTINCT association_contradiction_direct.gp_id) AS count 
FROM go_annotation_reports.association_contradiction_direct 
GROUP BY association_contradiction_direct.term_type;

Index - Schema go_annotation_reports


View: go_annotation_reports.association_count_by_association_qualifier

go_annotation_reports.association_count_by_association_qualifier Structure
F-Key Name Type Description
qualifier character varying(255)
n_associations bigint
SELECT qterm.acc AS qualifier
, count
(DISTINCT aq.association_id) AS n_associations 
FROM (go_associations.association_qualifier aq 
  JOIN go_graph.term qterm 
    ON (
           (aq.term_id = qterm.id)
     )
)
GROUP BY qterm.acc;

Index - Schema go_annotation_reports


View: go_annotation_reports.association_total_by_evidence_code

this total IS additive

go_annotation_reports.association_total_by_evidence_code Structure
F-Key Name Type Description
code character varying(8)
total bigint
SELECT evidence.code
, count
(DISTINCT evidence.association_id) AS total 
FROM go_associations.evidence 
GROUP BY evidence.code;

Index - Schema go_annotation_reports


View: go_annotation_reports.association_total_by_evidence_code_and_species

go_annotation_reports.association_total_by_evidence_code_and_species Structure
F-Key Name Type Description
ncbi_taxa_id integer
genus character varying(55)
species character varying(255)
common_name character varying(255)
code character varying(8)
total_associations bigint
SELECT species.ncbi_taxa_id
, species.genus
, species.species
, species.common_name
, evidence.code
, count
(DISTINCT evidence.association_id) AS total_associations 
FROM (
     (
           (go_associations.evidence 
              JOIN go_associations.association 
                ON (
                       (evidence.association_id = association.id)
                 )
           )
        JOIN go_associations.gene_product 
          ON (
                 (association.gene_product_id = gene_product.id)
           )
     )
  JOIN go_associations.species 
    ON (
           (gene_product.species_id = species.id)
     )
)
GROUP BY species.ncbi_taxa_id
, species.genus
, species.species
, species.common_name
, evidence.code;

Index - Schema go_annotation_reports


View: go_annotation_reports.avg_total_annotations_per_gp_by_db

go_annotation_reports.avg_total_annotations_per_gp_by_db Structure
F-Key Name Type Description
xref_dbname character varying(55)
avg_total_annotations numeric
SELECT dbxref.xref_dbname
, avg
(aa.total_annotations) AS avg_total_annotations 
FROM (
     (go_general.dbxref 
        JOIN go_associations.gene_product 
          ON (
                 (dbxref.id = gene_product.dbxref_id)
           )
     )
  JOIN go_annotation_reports.total_annotations_per_gp aa 
    ON (
           (aa.gene_product_id = gene_product.id)
     )
)
GROUP BY dbxref.xref_dbname;

Index - Schema go_annotation_reports


View: go_annotation_reports.avg_total_nonroot_annotations_per_gp_by_db

go_annotation_reports.avg_total_nonroot_annotations_per_gp_by_db Structure
F-Key Name Type Description
xref_dbname character varying(55)
avg_total_annotations numeric
SELECT dbxref.xref_dbname
, avg
(aa.total_annotations) AS avg_total_annotations 
FROM (
     (go_general.dbxref 
        JOIN go_associations.gene_product 
          ON (
                 (dbxref.id = gene_product.dbxref_id)
           )
     )
  JOIN go_annotation_reports.total_nonroot_annotations_per_gp aa 
    ON (
           (aa.gene_product_id = gene_product.id)
     )
)
GROUP BY dbxref.xref_dbname;

Index - Schema go_annotation_reports


View: go_annotation_reports.avg_total_nonroot_pubs_per_gp_by_db

go_annotation_reports.avg_total_nonroot_pubs_per_gp_by_db Structure
F-Key Name Type Description
xref_dbname character varying(55)
avg_total_pubs numeric
SELECT dbxref.xref_dbname
, avg
(aa.total_pubs) AS avg_total_pubs 
FROM (
     (go_general.dbxref 
        JOIN go_associations.gene_product 
          ON (
                 (dbxref.id = gene_product.dbxref_id)
           )
     )
  JOIN go_annotation_reports.total_nonroot_pubs_per_gp aa 
    ON (
           (aa.gene_product_id = gene_product.id)
     )
)
GROUP BY dbxref.xref_dbname;

Index - Schema go_annotation_reports


View: go_annotation_reports.avg_total_nonroot_terms_per_gp_by_db

as avg_total_terms_per_gp_by_db, excluding direct annotations to root

go_annotation_reports.avg_total_nonroot_terms_per_gp_by_db Structure
F-Key Name Type Description
xref_dbname character varying(55)
avg_total_terms numeric
SELECT dbxref.xref_dbname
, avg
(aa.total_terms) AS avg_total_terms 
FROM (
     (go_general.dbxref 
        JOIN go_associations.gene_product 
          ON (
                 (dbxref.id = gene_product.dbxref_id)
           )
     )
  JOIN go_annotation_reports.total_nonroot_terms_per_gp aa 
    ON (
           (aa.gene_product_id = gene_product.id)
     )
)
GROUP BY dbxref.xref_dbname;

Index - Schema go_annotation_reports


View: go_annotation_reports.avg_total_nonroot_transitive_terms_per_gp_by_db

go_annotation_reports.avg_total_nonroot_transitive_terms_per_gp_by_db Structure
F-Key Name Type Description
xref_dbname character varying(55)
avg_total_transitive_terms numeric
SELECT dbxref.xref_dbname
, avg
(aa.total_transitive_terms) AS avg_total_transitive_terms 
FROM (
     (go_general.dbxref 
        JOIN go_associations.gene_product 
          ON (
                 (dbxref.id = gene_product.dbxref_id)
           )
     )
  JOIN go_annotation_reports.total_nonroot_transitive_terms_per_gp aa 
    ON (
           (aa.gene_product_id = gene_product.id)
     )
)
GROUP BY dbxref.xref_dbname;

Index - Schema go_annotation_reports


View: go_annotation_reports.avg_total_pubs_per_gp_by_db

go_annotation_reports.avg_total_pubs_per_gp_by_db Structure
F-Key Name Type Description
xref_dbname character varying(55)
avg_total_pubs numeric
SELECT dbxref.xref_dbname
, avg
(aa.total_pubs) AS avg_total_pubs 
FROM (
     (go_general.dbxref 
        JOIN go_associations.gene_product 
          ON (
                 (dbxref.id = gene_product.dbxref_id)
           )
     )
  JOIN go_annotation_reports.total_pubs_per_gp aa 
    ON (
           (aa.gene_product_id = gene_product.id)
     )
)
GROUP BY dbxref.xref_dbname;

Index - Schema go_annotation_reports


View: go_annotation_reports.avg_total_terms_per_gp_by_db

average term coverage broken down by annotation DB here, term coverage is the DIRECT term count for that gene product see also: avg_total_transitive_terms_per_gp_by_db

go_annotation_reports.avg_total_terms_per_gp_by_db Structure
F-Key Name Type Description
xref_dbname character varying(55)
avg_total_terms numeric
SELECT dbxref.xref_dbname
, avg
(aa.total_terms) AS avg_total_terms 
FROM (
     (go_general.dbxref 
        JOIN go_associations.gene_product 
          ON (
                 (dbxref.id = gene_product.dbxref_id)
           )
     )
  JOIN go_annotation_reports.total_terms_per_gp aa 
    ON (
           (aa.gene_product_id = gene_product.id)
     )
)
GROUP BY dbxref.xref_dbname;

Index - Schema go_annotation_reports


View: go_annotation_reports.avg_total_transitive_terms_per_gp_by_db

go_annotation_reports.avg_total_transitive_terms_per_gp_by_db Structure
F-Key Name Type Description
xref_dbname character varying(55)
avg_total_transitive_terms numeric
SELECT dbxref.xref_dbname
, avg
(aa.total_transitive_terms) AS avg_total_transitive_terms 
FROM (
     (go_general.dbxref 
        JOIN go_associations.gene_product 
          ON (
                 (dbxref.id = gene_product.dbxref_id)
           )
     )
  JOIN go_annotation_reports.total_transitive_terms_per_gp aa 
    ON (
           (aa.gene_product_id = gene_product.id)
     )
)
GROUP BY dbxref.xref_dbname;

Index - Schema go_annotation_reports


View: go_annotation_reports.evidence_dbxref_summary

what kind of dbxrefs links to evidences on with WITH field: grouped by database type Many different tables link to the general purpose dbxref table. This summarises one kind of link

go_annotation_reports.evidence_dbxref_summary Structure
F-Key Name Type Description
xref_dbname character varying(55)
num_evidence_dbxrefs bigint
SELECT d.xref_dbname
, count
(*) AS num_evidence_dbxrefs 
FROM (go_associations.evidence_dbxref x 
  JOIN go_general.dbxref d 
    ON (
           (x.dbxref_id = d.id)
     )
)
GROUP BY d.xref_dbname;

Index - Schema go_annotation_reports


View: go_annotation_reports.evidence_pub_dbxref_summary

what kind of dbxrefs links to evidence as the primary publication: grouped by database type Many different tables link to the general purpose dbxref table. This summarises one kind of link

go_annotation_reports.evidence_pub_dbxref_summary Structure
F-Key Name Type Description
xref_dbname character varying(55)
num_evidence_dbxrefs bigint
SELECT d.xref_dbname
, count
(*) AS num_evidence_dbxrefs 
FROM (go_associations.evidence x 
  JOIN go_general.dbxref d 
    ON (
           (x.dbxref_id = d.id)
     )
)
GROUP BY d.xref_dbname;

Index - Schema go_annotation_reports


View: go_annotation_reports.gene_product_dbxref_summary

what kind of dbxrefs links to gene_products: grouped by database type Many different tables link to the general purpose dbxref table. This summarises one kind of link

go_annotation_reports.gene_product_dbxref_summary Structure
F-Key Name Type Description
xref_dbname character varying(55)
num_gene_product_dbxrefs bigint
SELECT d.xref_dbname
, count
(*) AS num_gene_product_dbxrefs 
FROM (go_associations.gene_product x 
  JOIN go_general.dbxref d 
    ON (
           (x.dbxref_id = d.id)
     )
)
GROUP BY d.xref_dbname;

Index - Schema go_annotation_reports


View: go_annotation_reports.iea_annotated_total_gps

ungrouped: single number

go_annotation_reports.iea_annotated_total_gps Structure
F-Key Name Type Description
total bigint
SELECT count
(DISTINCT association.gene_product_id) AS total 
FROM (go_associations.association 
  JOIN go_associations.evidence 
    ON (
           (evidence.association_id = association.id)
     )
)
WHERE (
     (evidence.code)::text = 'IEA'::text
);

Index - Schema go_annotation_reports


View: go_annotation_reports.iea_or_iss_annotated_total_gps

ungrouped: single number

go_annotation_reports.iea_or_iss_annotated_total_gps Structure
F-Key Name Type Description
total bigint
SELECT count
(DISTINCT association.gene_product_id) AS total 
FROM (go_associations.association 
  JOIN go_associations.evidence 
    ON (
           (evidence.association_id = association.id)
     )
)
WHERE (
     (
           (evidence.code)::text = 'IEA'::text
     )
    OR (
           (evidence.code)::text = 'ISS'::text
     )
);

Index - Schema go_annotation_reports


View: go_annotation_reports.non_iea_annotated_total_gps

ungrouped: single number

go_annotation_reports.non_iea_annotated_total_gps Structure
F-Key Name Type Description
total bigint
SELECT count
(DISTINCT association.gene_product_id) AS total 
FROM (go_associations.association 
  JOIN go_associations.evidence 
    ON (
           (evidence.association_id = association.id)
     )
)
WHERE (
     (evidence.code)::text <> 'IEA'::text
);

Index - Schema go_annotation_reports


View: go_annotation_reports.non_iea_annotated_total_gps_by_dbname

slow in mysql5.0

go_annotation_reports.non_iea_annotated_total_gps_by_dbname Structure
F-Key Name Type Description
xref_dbname character varying(55)
total bigint
SELECT dbxref.xref_dbname
, count
(DISTINCT gene_product.id) AS total 
FROM (
     (
           (go_associations.gene_product 
              JOIN go_general.dbxref 
                ON (
                       (dbxref.id = gene_product.dbxref_id)
                 )
           )
        JOIN go_associations.association 
          ON (
                 (gene_product.id = association.gene_product_id)
           )
     )
  JOIN go_associations.evidence 
    ON (
           (evidence.association_id = association.id)
     )
)
WHERE (
     (evidence.code)::text <> 'IEA'::text
)
GROUP BY dbxref.xref_dbname 
ORDER BY count
(DISTINCT gene_product.id);

Index - Schema go_annotation_reports


View: go_annotation_reports.non_iea_or_iss_annotated_total_gps

ungrouped: single number

go_annotation_reports.non_iea_or_iss_annotated_total_gps Structure
F-Key Name Type Description
total bigint
SELECT count
(DISTINCT association.gene_product_id) AS total 
FROM (go_associations.association 
  JOIN go_associations.evidence 
    ON (
           (evidence.association_id = association.id)
     )
)
WHERE (
     (
           (evidence.code)::text <> 'IEA'::text
     )
   AND (
           (evidence.code)::text <> 'ISS'::text
     )
);

Index - Schema go_annotation_reports


View: go_annotation_reports.seq_dbxref_summary

what kind of dbxrefs links to seqs: grouped by database type Many different tables link to the general purpose dbxref table. This summarises one kind of link

go_annotation_reports.seq_dbxref_summary Structure
F-Key Name Type Description
xref_dbname character varying(55)
num_seq_dbxrefs bigint
SELECT d.xref_dbname
, count
(*) AS num_seq_dbxrefs 
FROM (go_sequence.seq_dbxref x 
  JOIN go_general.dbxref d 
    ON (
           (x.dbxref_id = d.id)
     )
)
GROUP BY d.xref_dbname;

Index - Schema go_annotation_reports


View: go_annotation_reports.term_association_count_by_association_qualifier

go_annotation_reports.term_association_count_by_association_qualifier Structure
F-Key Name Type Description
acc character varying(255)
name character varying(255)
term_type character varying(55)
qualifier character varying(255)
n_associations bigint
SELECT term.acc
, term.name
, term.term_type
, qterm.acc AS qualifier
, count
(DISTINCT aq.association_id) AS n_associations 
FROM (
     (
           (go_associations.association_qualifier aq 
              JOIN go_graph.term qterm 
                ON (
                       (aq.term_id = qterm.id)
                 )
           )
        JOIN go_associations.association 
          ON (
                 (aq.association_id = association.id)
           )
     )
  JOIN go_graph.term 
    ON (
           (association.term_id = term.id)
     )
)
GROUP BY term.acc
, term.name
, term.term_type
, qterm.acc;

Index - Schema go_annotation_reports


View: go_annotation_reports.term_dbxref_summary

what kind of dbxrefs links to terms: grouped by database type Many different tables link to the general purpose dbxref table. This summarises one kind of link

go_annotation_reports.term_dbxref_summary Structure
F-Key Name Type Description
xref_dbname character varying(55)
num_term_dbxrefs bigint
SELECT d.xref_dbname
, count
(*) AS num_term_dbxrefs 
FROM (go_meta.term_dbxref x 
  JOIN go_general.dbxref d 
    ON (
           (x.dbxref_id = d.id)
     )
)
GROUP BY d.xref_dbname;

Index - Schema go_annotation_reports


View: go_annotation_reports.total_annotated_entities_by_dbname_and_type

go_annotation_reports.total_annotated_entities_by_dbname_and_type Structure
F-Key Name Type Description
xref_dbname character varying(55)
acc character varying(255)
total_gps bigint
SELECT dbxref.xref_dbname
, tt.acc
, count
(*) AS total_gps 
FROM (
     (go_associations.gene_product 
        JOIN go_general.dbxref 
          ON (
                 (dbxref.id = gene_product.dbxref_id)
           )
     )
  JOIN go_graph.term tt 
    ON (
           (tt.id = gene_product.type_id)
     )
)
GROUP BY dbxref.xref_dbname
, tt.acc 
ORDER BY dbxref.xref_dbname
, tt.acc;

Index - Schema go_annotation_reports


View: go_annotation_reports.total_annotations_per_gp

count of distinct direct annotations broken down by gene product note: does not correspnd to lines in gene_association file

go_annotation_reports.total_annotations_per_gp Structure
F-Key Name Type Description
gene_product_id integer
total_annotations bigint
SELECT association.gene_product_id
, count
(DISTINCT association.id) AS total_annotations 
FROM go_associations.association 
GROUP BY association.gene_product_id;

Index - Schema go_annotation_reports


View: go_annotation_reports.total_gps_by_dbname

total number of GPs in the database instance grouped by contributing database (eg FlyBase, UniProt, ..)

go_annotation_reports.total_gps_by_dbname Structure
F-Key Name Type Description
xref_dbname character varying(55)
total_gps bigint
SELECT dbxref.xref_dbname
, count
(*) AS total_gps 
FROM (go_associations.gene_product 
  JOIN go_general.dbxref 
    ON (
           (dbxref.id = gene_product.dbxref_id)
     )
)
GROUP BY dbxref.xref_dbname 
ORDER BY count
(*);

Index - Schema go_annotation_reports


View: go_annotation_reports.total_nonroot_annotations_per_gp

as total_annotations_per_gp, excluding direct annotations to root

go_annotation_reports.total_nonroot_annotations_per_gp Structure
F-Key Name Type Description
gene_product_id integer
total_annotations bigint
SELECT association.gene_product_id
, count
(DISTINCT association.id) AS total_annotations 
FROM go_associations.association 
WHERE (NOT 
     (EXISTS 
           (
            SELECT root_term.id
                 , root_term.name
                 , root_term.term_type
                 , root_term.acc
                 , root_term.is_obsolete
                 , root_term.is_root 
              FROM go_graph_views.root_term 
             WHERE (root_term.id = association.term_id)
           )
     )
)
GROUP BY association.gene_product_id;

Index - Schema go_annotation_reports


View: go_annotation_reports.total_nonroot_pubs_per_gp

go_annotation_reports.total_nonroot_pubs_per_gp Structure
F-Key Name Type Description
gene_product_id integer
total_pubs bigint
SELECT association.gene_product_id
, count
(DISTINCT evidence.dbxref_id) AS total_pubs 
FROM (go_associations.association 
  JOIN go_associations.evidence 
    ON (
           (association.id = evidence.association_id)
     )
)
WHERE (NOT 
     (EXISTS 
           (
            SELECT root_term.id
                 , root_term.name
                 , root_term.term_type
                 , root_term.acc
                 , root_term.is_obsolete
                 , root_term.is_root 
              FROM go_graph_views.root_term 
             WHERE (root_term.id = association.term_id)
           )
     )
)
GROUP BY association.gene_product_id;

Index - Schema go_annotation_reports


View: go_annotation_reports.total_nonroot_terms_per_gp

go_annotation_reports.total_nonroot_terms_per_gp Structure
F-Key Name Type Description
gene_product_id integer
total_terms bigint
SELECT association.gene_product_id
, count
(DISTINCT association.term_id) AS total_terms 
FROM go_associations.association 
WHERE (NOT 
     (EXISTS 
           (
            SELECT root_term.id
                 , root_term.name
                 , root_term.term_type
                 , root_term.acc
                 , root_term.is_obsolete
                 , root_term.is_root 
              FROM go_graph_views.root_term 
             WHERE (root_term.id = association.term_id)
           )
     )
)
GROUP BY association.gene_product_id;

Index - Schema go_annotation_reports


View: go_annotation_reports.total_nonroot_transitive_terms_per_gp

go_annotation_reports.total_nonroot_transitive_terms_per_gp Structure
F-Key Name Type Description
gene_product_id integer
total_transitive_terms bigint
SELECT association.gene_product_id
, count
(DISTINCT graph_path.term1_id) AS total_transitive_terms 
FROM (go_associations.association 
  JOIN go_optimisations.graph_path 
    ON (
           (graph_path.term2_id = association.term_id)
     )
)
WHERE (NOT 
     (EXISTS 
           (
            SELECT root_term.id
                 , root_term.name
                 , root_term.term_type
                 , root_term.acc
                 , root_term.is_obsolete
                 , root_term.is_root 
              FROM go_graph_views.root_term 
             WHERE (root_term.id = association.term_id)
           )
     )
)
GROUP BY association.gene_product_id;

Index - Schema go_annotation_reports


View: go_annotation_reports.total_nonroot_transitive_terms_per_gp_pair

go_annotation_reports.total_nonroot_transitive_terms_per_gp_pair Structure
F-Key Name Type Description
gp1_id integer
gp2_id integer
total_transitive_terms bigint
SELECT a1.gene_product_id AS gp1_id
, a2.gene_product_id AS gp2_id
, count
(DISTINCT tc1.term1_id) AS total_transitive_terms 
FROM go_associations.association a1
, go_optimisations.graph_path tc1
, go_optimisations.graph_path tc2
, go_associations.association a2 
WHERE (
     (
           (
                 (tc1.term2_id = a1.term_id)
               AND (tc2.term2_id = a2.term_id)
           )
         AND (tc1.term1_id = tc2.term1_id)
     )
   AND (NOT 
           (EXISTS 
                 (
                  SELECT root_term.id
                       , root_term.name
                       , root_term.term_type
                       , root_term.acc
                       , root_term.is_obsolete
                       , root_term.is_root 
                    FROM go_graph_views.root_term 
                   WHERE (
                             (root_term.id = a1.term_id)
                            OR (root_term.id = a1.term_id)
                       )
                 )
           )
     )
)
GROUP BY a1.gene_product_id
, a2.gene_product_id;

Index - Schema go_annotation_reports


View: go_annotation_reports.total_pubs_per_gp

go_annotation_reports.total_pubs_per_gp Structure
F-Key Name Type Description
gene_product_id integer
total_pubs bigint
SELECT association.gene_product_id
, count
(DISTINCT evidence.dbxref_id) AS total_pubs 
FROM (go_associations.association 
  JOIN go_associations.evidence 
    ON (
           (association.id = evidence.association_id)
     )
)
GROUP BY association.gene_product_id;

Index - Schema go_annotation_reports


View: go_annotation_reports.total_terms_per_gp

go_annotation_reports.total_terms_per_gp Structure
F-Key Name Type Description
gene_product_id integer
total_terms bigint
SELECT association.gene_product_id
, count
(DISTINCT association.term_id) AS total_terms 
FROM go_associations.association 
GROUP BY association.gene_product_id;

Index - Schema go_annotation_reports


View: go_annotation_reports.total_transitive_terms_per_gp

go_annotation_reports.total_transitive_terms_per_gp Structure
F-Key Name Type Description
gene_product_id integer
total_transitive_terms bigint
SELECT association.gene_product_id
, count
(DISTINCT graph_path.term1_id) AS total_transitive_terms 
FROM (go_associations.association 
  JOIN go_optimisations.graph_path 
    ON (
           (graph_path.term2_id = association.term_id)
     )
)
GROUP BY association.gene_product_id;

Index - Schema go_annotation_reports


Schema go_associations


Table: go_associations.association

Annotation model: An association is a link between a gene product record and an ontology term, with one or more pieces of evidence *** IMPORTANT: NOT all associations are positive: some posit negative links. THESE SHOULD TYPICALLY BE FILTERED OUT FOR MOST ANALYSIS PURPOSES. See the is_not column ***

go_associations.association Structure
F-Key Name Type Description
id serial PRIMARY KEY
go_graph.term.id term_id integer NOT NULL

the (GO) term to which the gene_product is associated
go_associations.gene_product.id gene_product_id integer NOT NULL

the gene or gene_product to which the term is associated
is_not integer

** IMPORTANT ** when this field is non-zero, the meaning of the annotation is that the gene_product does NOT have the role defined by the GO term (column 4 = NOT in the gene-association file)
assocdate integer

a date in YYYYMMDD format. This is the date the association was last checked the source db providers (column 14 in the gene-association file)
go_general.db.id source_db_id integer

the source of the association; for instance, the association file may come from SwissProt, but the source of the association (Example: SGD) (Example: MGI) (column 15 = NOT in the gene-association file) (docs: http://www.geneontology.org/cgi-bin/xrefs.cgi)

Tables referencing this one via Foreign Key Constraints:

a1 term_id a2 gene_product_id a3 term_id, gene_product_id a4 id, term_id, gene_product_id a5 id, gene_product_id

Index - Schema go_associations


Table: go_associations.association_property

(column 16 in the gene-association file)

go_associations.association_property Structure
F-Key Name Type Description
id serial PRIMARY KEY
go_associations.association.id association_id integer NOT NULL
go_graph.term.id relationship_type_id integer NOT NULL

eg part_of
go_graph.term.id term_id integer NOT NULL

eg CL:0000017

Index - Schema go_associations


Table: go_associations.association_qualifier

associations can have a number of qualifiers. These include, but are not limited to the NOT qualifier (which technically is not a qualifier at all as it fundamentally changes the semantics of an association) note that this table IS redundant with association.is_not (column 4 in the gene-association file)

go_associations.association_qualifier Structure
F-Key Name Type Description
id serial PRIMARY KEY
go_associations.association.id association_id integer NOT NULL
go_graph.term.id term_id integer NOT NULL

qualifiers come from their own terminology
value character varying(255)

qualifiers can potentialy be tag=value pairs. however, all qualifiers are currently boolean tags, so this column is always null
aq1 association_id, term_id

Index - Schema go_associations


Table: go_associations.association_species_qualifier

(see http://www.geneontology.org/GO.annotation.shtml#manySpp) (column 13 in gene_association file, ONLY WHEN card>1, this is the next entry) to be used only in conjunction with terms that have the term 'interaction between organisms' as an ancestor. gene_product.species_id is for the organism type encoding the gene or gene product, association_species_qualifier.species_id should be that of the other organism in the interaction.

go_associations.association_species_qualifier Structure
F-Key Name Type Description
id serial PRIMARY KEY
go_associations.association.id association_id integer NOT NULL
go_associations.species.id species_id integer

The species of the interacting organism (eg host) Example: in cytolysis of cells of another organism (GO:0051715) this would be the species playing the 'other organism' role

Index - Schema go_associations


Table: go_associations.evidence

each association can have one or more pieces of evidence attached to it (the schema actually allows zero or more, but with GO all annotation have at least one piece of evidence) (doc: http://www.geneontology.org/GO.evidence.shtml)

go_associations.evidence Structure
F-Key Name Type Description
id serial PRIMARY KEY
code character varying(8) UNIQUE#1 NOT NULL

a string code (typically 3-letter) corresponding to a GO evidence code. (column 7 in the gene-association file) (Example: IEA - inferred from electronic annotation) (Example: IMP - inferred from mutant phenotype) evidence codes may eventually become "ontologized", allowing us to take full advantage of the OBO evidence ontology: http://www.obofoundry.org/cgi-bin/detail.cgi?evidence_code
go_associations.association.id association_id integer UNIQUE#1 NOT NULL
go_general.dbxref.id dbxref_id integer UNIQUE#1 NOT NULL

A reference for the annotation. Typically a pubmed ID (column 6 in the gene-association file)
seq_acc character varying(255)

a denormalised field containing a "|" separated list of accession supporting the call. for the normalised data, use evidence_dbxref (column 8 in the gene-association file, copied identically)

Tables referencing this one via Foreign Key Constraints:

ev1 association_id ev2 code ev3 dbxref_id ev4 association_id, code

Index - Schema go_associations


Table: go_associations.evidence_dbxref

each piece of evidence can have multiple dbxrefs associated with it; this is the *normalised* version of the "With" or "From" field of the evidence (column 8 in the gene-association file, normalized)

go_associations.evidence_dbxref Structure
F-Key Name Type Description
go_associations.evidence.id evidence_id integer NOT NULL
go_general.dbxref.id dbxref_id integer NOT NULL

globally unique identifier for the evidence (Example: GO:0000346 - will be stored as DB=GO, Acc=0000346)
evx1 evidence_id evx2 dbxref_id evx3 evidence_id, dbxref_id

Index - Schema go_associations


Table: go_associations.gene_product

Represents a gene or gene_product, typically at the species level. GO allows for annotation of genes OR gene products. Annotation of a gene is understood to be "proxy" for annotation of the corresponding gene products. (docs: http://www.geneontology.org/GO.annotation.fields.shtml) (docs: http://www.geneontology.org/GO.annotation.shtml#file) (Example: human p53-gene) (Example: human p53-protein)

go_associations.gene_product Structure
F-Key Name Type Description
id serial PRIMARY KEY
symbol character varying(128) NOT NULL

concise label for this gene product (Example: p53) (Example: BRCA) (Example: PHO3) typically unique within an originating database authority, but not guaranteed; (an example of such as authority is FlyBase or UniProt)
go_general.dbxref.id dbxref_id integer UNIQUE NOT NULL

A globally unique identifier for this gene or gene product. All (non-GO) unique identifiers are stored as dbxrefs - they must consist of both a DB and a DB_Object_ID (Example: SGD:S000000296) (column 1 and 2 in gene_association file)
go_associations.species.id species_id integer

The species or taxon to which this gene product belongs (Note: in future we reserve the option to use gene_product to represent families at higher levels in the taxonomic tree above species) (column 13 in gene_association file; if card>1, this is the first entry)
go_graph.term.id type_id integer

gene_product type (eg gene, transcript, protein, complex) (column 13 in the gene-association file) the type term may correspond to a SO ID, but typically SO is not loaded an an ontology into the GO database
full_name text

symbol is typically a concise label, full_name may be more textual (column 10 in the gene-association file)

Tables referencing this one via Foreign Key Constraints:

g1 symbol g2 dbxref_id g3 species_id g4 id, species_id g5 dbxref_id, species_id g6 id, dbxref_id g7 id, species_id

Index - Schema go_associations


Table: go_associations.gene_product_subset

(aka goslims). Each subsetdef (slim) is stored as a gene_product in the database (with term_type = 'subset') The subset_id links to this term (OBO-Format: *subset* tag. term_id references a term housing the *subsetdef*)

go_associations.gene_product_subset Structure
F-Key Name Type Description
go_associations.gene_product.id gene_product_id integer NOT NULL
go_graph.term.id subset_id integer NOT NULL
gps1 gene_product_id gps2 subset_id

Index - Schema go_associations


Table: go_associations.gene_product_synonym

alternate label for the gene or gene product (column 11 in the gene-association file)

go_associations.gene_product_synonym Structure
F-Key Name Type Description
go_associations.gene_product.id gene_product_id integer UNIQUE#1 NOT NULL
product_synonym character varying(255) UNIQUE#1 NOT NULL

alternate label. Typically NOT redundant with gene_product.symbol or gene_product.full_name, but this is not guaranteed (column 11 in the gene-association file)
gs1 gene_product_id gs2 product_synonym

Index - Schema go_associations


Table: go_associations.species

Linnaean taxonomic information for an organism type. Modeled after NCBI Taxonomy (Note: the name of the table is misleading, as it can model ANY node in Linnaen taxonomy) (The table should be better called "taxon")

go_associations.species Structure
F-Key Name Type Description
id serial PRIMARY KEY
ncbi_taxa_id integer UNIQUE

identifier within the NCBI Taxonomy database. (Example: Dmel=7227) (Example: S Cerevisae=4932)
common_name character varying(255)

Non-scientific name (Example: fruitfly)
lineage_string text

denormalized list of taxon names as text. (Note: not currently populated)
genus character varying(55)

If the row in the table is genuinely a species, this column is for storing the "genus" in the Linnaean system. If the row is a higher taxon, then this column is for the scientific name of that taxon. (Example: Drosophila -- for leaf node taxon) (Example: Homo -- for leaf node taxon) (Example: Metazoa -- for non-leaf node taxon) unfortunately the name of this column is misleading. However, it will be retained for backwards compatibility
species character varying(255)

If the row in the table is genuinely a species, this column is for storing the "species" name in the Linnaean system. If the row is a higher taxon, this column is null (Example: sapiens) (Example: pombe) unf