<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Id: chado-module-metadata.xml,v 1.25 2009-08-31 14:25:35 scottcain Exp $ -->
<schema_metadata id='chado'>

  <title>Chado: A generic model organism database schema</title>
  <description>
    Chado is a modular schema for biological data
  </description>
  <about>
    This is a metadata file describing chado and its components,
    specified in XML. The path to each module SQL file is described,
    as well as other files which that module may require or use
  </about>

  <!-- source types -->
  <!--  dir: a directory relative to the chado root dir -->
  <!--  sql: SQL DDL statements that are largely DBMS neutral-->
  <!--  plpgsql: PostgreSQL functions and triggers -->
  <!--  bridge-xml: Can be converted with chado/bin/create-bridge-sql.pl -->
  <!--  sqlapi: Pseudo-SQL public function interface declarations -->
  <!-- -->

  <modules>
    <source type='dir' path='modules'/>

    <module id='general' required='true'>
      <description>
        General purpose tables, including dbxrefs
      </description>
      <source type='sql' path='general/general.sql'/>

      <component id='general-report' type='views' required='true'>
        <description>
          Standard Chado SQL Reports for the general module
        </description>
        <source type='sql' path='general/views/general-report.sql'/>
      </component>

      <component id='general-loading-api' type='dbapi'>
        <description>
          A DBMS API for the general module's loading functions
        </description>
        <source type='sqli' path='general/functions/general-loading.sqlapi'/>
      </component>

      <component id='general-loading' type='code'>
        <description>
          Postgres code for helping with loading the general module
        </description>
        <implements to='general-loading-api'/>
        <source type='plpgsql' path='general/functions/general-loading.plpgsql'/>
      </component>
    </module>

    <module id='cv' required='true'>
      <dependency to='general'/>
      <description>
        Controlled vocabularies and ontologies
      </description>
      <source type='sql' path='cv/cv.sql'/>

      <component id='cv-views' type='views' required='true'>
        <description>
          Standard Chado SQL Views for the cv module
        </description>
        <source type='sql' path='cv/views/cv-views.sql'/>
      </component>

      <component id='cv-report' type='views' required='true'>
        <description>
          Standard Chado SQL Reports for the cv module
        </description>
        <source type='sql' path='cv/views/cv-report.sql'/>
      </component>

      <component id='cv-dbapi' type='dbapi'>
        <description>
          A DBMS API for the cv module
        </description>
        <source type='sqli' path='cv/cv-dbapi.sqli'/>
      </component>

      <component id='cv-subj-obj' type='code'>
        <description>
          Postgres code for finding parent and child cvterms
        </description>
        <source type='plpgsql' path='cv/functions/get_subj_obj_ids.plpgsql'/>
      </component>

      <component id='cv-funcs' type='code'>
        <description>
          Postgres code for populating the cvtermpath table
        </description>
        <implements to='cv-dbapi'/>
        <source type='plpgsql' path='cv/functions/fill_cvtermpath.plpgsql'/>
      </component>

      <component id='cv-cycle' type='code'>
        <description>
          Postgres code for working with cvterm cycles
        </description>
        <source type='plpgsql' path='cv/functions/detect_cycle.plpgsql'/>
      </component>
    </module>

    <module id='pub' required='true'>
      <dependency to='general'/>
      <dependency to='cv'/>
      <description>
        Bibliographic data on publications
      </description>
      <source type='sql' path='pub/pub.sql'/>
    </module>

    <module id='organism' required='true'>
      <dependency to='general'/>
      <dependency to='cv'/>
      <description>
        Species data - does not include phylogeny
      </description>
      <source type='sql' path='organism/organism.sql'/>

      <component id='organism-dbapi' type='dbapi'>
        <description>
          A DBMS API for the organism module
        </description>
        <source type='sqli' path='organism/functions/organism.sqlapi'/>
      </component>

      <component id='organism-funcs' type='code'>
        <description>
          Postgres code retrieving organism data
        </description>
        <implements to='organism-dbapi'/>
        <source type='plpgsql' path='organism/functions/organism.plpgsql'/>
      </component>

      <component id='organism-loading' type='code'>
        <description>
          Postgres code for helping with loading organism data
        </description>
        <source type='plpgsql' path='organism/functions/organism-loading.plpgsql'/>
      </component>
    </module>

    <module id='sequence' required='true'>
      <dependency to='general'/>
      <dependency to='organism'/>
      <dependency to='cv'/>
      <dependency to='pub'/>
      <description>
        Sequence and sequence features, their localization and properties
      </description>
      <source type='sql' path='sequence/sequence.sql'/>

      <component id='sequence-report' type='views' required='true'>
        <description>
          Standard Chado SQL Reports for the sequence module
        </description>
        <source type='sql' path='sequence/views/sequence-report.sql'/>
      </component>

      <component id='gencode' type='sql' required='true'>
        <description>
          Genetic code - maps codons to amino acids according to
          species specific translation table
        </description>
        <source type='sql' path='sequence/gencode/gencode.sql'/>
        <source type='sqldump' path='sequence/gencode/gencode_data.sql'/>
      </component>

      <component id='sequence-dbapi' type='dbapi'>
        <dependency to='gencode'/>
        <description>
          A SQL/DBMS API for the sequence module. Currently only plpgsql
          implementations exist
        </description>
        <!-- subcomponents -->
        <component id='sequence-dbapi-range' type='dbapi'>
          <description>
            Functions for operating on interval ranges
          </description>
          <source type='sqlapi' path='sequence/functions/range.sqlapi'/>
          <source type='plpgsql' path='sequence/functions/range.plpgsql'/>
        </component>
        <component id='sequence-dbapi-sequtil' type='dbapi'>
          <dependency to='gencode'/>
          <description>
            Utility functions for biological sequences
          </description>
          <source type='sqlapi' path='sequence/functions/sequtil.sqlapi'/>
          <source type='plpgsql' path='sequence/functions/sequtil.plpgsql'/>
        </component>
        <component id='sequence-dbapi-locgraph' type='dbapi'>
          <description>
            Projections on graph defined by featureloc
          </description>
          <source type='sqlapi' path='sequence/functions/locgraph.sqlapi'/>
          <source type='plpgsql' path='sequence/functions/locgraph.plpgsql'/>
        </component>
        <component id='sequence-dbapi-cv-helper' type='dbapi'>
          <description>
            feature types
          </description>
          <source type='sqlapi' path='sequence/functions/sequence-cv-helper.sqlapi'/>
          <source type='plpgsql' path='sequence/functions/sequence-cv-helper.plpgsql'/>
        </component>
      </component>

      <component id='feature-util-api' type='dbapi'>
        <description>
          A DBMS API for general feature queries
        </description>
        <source type='sqli' path='sequence/functions/feature.sqlapi'/>
      </component>

      <component id='feature-util' type='code'>
        <dependency to='sequence-dbapi'/>
        <description>
          Postgres code for general feature queries
        </description>
        <implements to='feature-util-api' />
        <source type='plpgsql' path='sequence/functions/feature.plpgsql'/>
      </component>

      <component id='sequence_opt' type='optimizations'>
        <description>
          Optional optimizations to be applied to the sequence module
        </description>
        <source type='sql-in-xml' path='sequence/sequence_opt.xml'/>
      </component>

      <component id='godb-bridge' type='bridge'>
        <description>
          Views that let Chado masquerade as a GO Database. 
          Note that this is a component of the sequence module, as the
          views are over both cv and sequence modules
        </description>
        <status code='alpha'>
          Requires testing with AmiGO
        </status>
        <source type='bridge-xml' path='cv/bridges/godb-bridge.sql.xml'/>
      </component>

      <component id='chaos-bridge' type='bridge'>
        <description>
          Chaos is a simplified layer over chado
        </description>
        <status code='alpha'/>
        <source type='bridge-xml' path='sequence/bridges/chaos-bridge.sql'/>
      </component>

      <component id='so-bridge' type='view' required='true'>
        <description>
          Provides a view for every type in the SO ontology. This
          means you can do queries such as "SELECT * FROM gene" etc
        </description>
        <source type='sql' path='sequence/bridges/so-bridge.sql'/>
      </component>

      <component id='implicit-feature-views' type='views' required='true'>
        <dependency to='sofa-bridge' />
        <description>
          This enhances the SOFA layer with additional queries for
          complex feature types, such as those can be inferred from
          other features.
        </description>
        <source type='sql' path='sequence/views/implicit-feature-views.sql'/>
      </component>


      <component id='sequence-loading-api' type='dbapi'>
        <description>
          A DBMS API for loading feature tables
        </description>
        <source type='sqli' path='sequence/functions/sequence-loading.plpgsql'/>
      </component>

      <component id='sequence-loading' type='code'>
        <description>
          Postgres code for loading feature tables
        </description>
        <implements to='sequence-loading-api' />
        <source type='plpgsql' path='sequence/functions/sequence-loading.plpgsql'/>
      </component>

      <component id='subsequence-api' type='dbapi'>
        <description>
          A DBMS API for doing subsequence queries
        </description>
        <source type='sqli' path='sequence/functions/subsequence.sqlapi'/>
      </component>

      <component id='subsequence' type='code'>
        <description>
          Postgres code for doing subsequence queries
        </description>
        <implements to='subsequence-api' />
        <source type='plpgsql' path='sequence/functions/subsequence.plpgsql'/>
      </component>

      <component id='feature_subalignments' type='code'>
        <description>
          Postgres code for doing something with feature subalignments,
          but I don't remember what.  Allen?
        </description>
        <source type='plpgsql' path='sequence/functions/feature_subalignments.plpgsql'/>
      </component>

      <component id='frange' type='code'>
        <description>
          Postgres code for fast feature 'contains' query, requried
          for the DAS2 server (right?)
        </description>
        <source type='plpgsql' path='sequence/functions/frange.plpgsql'/>
      </component>

      <component id='create_soi' type='code'>
        <description>
          Postgres code to flatten feature relationships; it is in some
          ways similar to frange.
        </description>
        <source type='plpgsql' path='sequence/functions/create_soi.plpgsql'/>
      </component>

      <component id='feature_ids_fx' type='code'>
        <description>
          Postgres code to simplify feature relationship queries
        </description>
        <source type='plpgsql' path='sequence/functions/feature_ids_fx.plpgsql'/>
      </component>
    </module>

    <module id='companalysis'  required='true'>
      <!--added required, since sequence_views is requred and it depends on companalysis-->
      <dependency to='general'/>
      <dependency to='sequence'/>
      <dependency to='cv'/>
      <description>
        Augments sequence module with descriptions of computational
        analyses and features resulting from those analyses
      </description>
      <source type='sql' path='companalysis/companalysis.sql'/>

      <component id='companalysis-loading-api' type='dbapi'>
        <description>
          A DBMS API for the companalysis module's loading functions
        </description>
        <source type='sqli' path='companalysis/functions/companalysis-loading.sqlapi'/>
      </component>

      <component id='companalysis-loading' type='code'>
        <description>
          Postgres code for helping with loading the companalysis module
        </description>
        <implements to='companalysis-loading-api'/>
        <source type='plpgsql' path='companalysis/functions/companalysis-loading.plpgsql'/>
      </component>

    </module>

    <module id='phenotype'>
      <dependency to='general'/>
      <dependency to='sequence'/>
      <dependency to='cv'/>
      <dependency to='pub'/>
      <status code='beta'>
        In use right now in FlyBase
      </status>
      <description>
        Entity-attribute-value phenotypic character descriptions
      </description>
      <source type='sql' path='phenotype/phenotype.sql'/>
    </module>

    <module id='genetic'>
      <dependency to='general'/>
      <dependency to='sequence'/>
      <dependency to='cv'/>
      <dependency to='pub'/>
      <dependency to='phenotype'/>
      <status code='beta'>
        In use right now in FlyBase
      </status>
      <description>
        Genotypes and mutant alleles
      </description>
      <source type='sql' path='genetic/genetic.sql'/>
    </module>

    <module id='map'>
      <dependency to='sequence'/>
      <dependency to='cv'/>
      <dependency to='pub'/>
      <status code='alpha'>
        Not yet in production use anywhere?
      </status>
      <description>
        Non-sequence maps: genetic, radiation hybrid, cytogenetic, etc
      </description>
      <source type='sql' path='map/map.sql'/>
    </module>

<!--
    This module isn't in cvs
    <module id='event'>
      <dependency to='sequence'/>
      <dependency to='cv'/>
      <dependency to='pub'/>
      <status code='pre-alpha'>
        discussion stage
      </status>
      <description>
        Pathways and quantitative models
      </description>
      <source type='sql' path='event/event.sql'/>
    </module>
-->

    <module id='phylogeny'>
      <dependency to='sequence'/>
      <dependency to='cv'/>
      <dependency to='pub'/>
      <dependency to='general'/>
      <dependency to='organism'/>
      <dependency to='companalysis'/>	
      <status code='beta'>
        In use at IRRI
      </status>
      <description>
        For representing phylogenetic trees; the trees represent the
        phylogeny of some some kind of sequence feature (mainly
        proteins) or actual organism taxonomy trees
      </description>
      <source type='sql' path='phylogeny/phylogeny.sql'/>

      <component id='phylogeny-dbapi' type='dbapi'>
        <description>
          A DBMS API for the phylogeny module
        </description>
        <source type='sqli' path='phylogeny/functions/phylo.sqlapi'/>
      </component>

      <component id='phylogeny-funcs' type='code'>
        <description>
          Postgres code retrieving phylogeny data
        </description>
        <implements to='phylogeny-dbapi'/>
        <source type='plpgsql' path='phylogeny/functions/phylo.plpgsql'/>
      </component>
    </module>

    <module id='contact'>
      <dependency to='cv'/>
      <dependency to='general'/>
      <status code='alpha'>
        In use at UCLA/Allen Day
      </status>
      <description>
        model persons, institutes, groups, organizations, etc
      </description>
      <source type='sql' path='contact/contact.sql'/>
    </module>


    <module id='expression'>
      <dependency to='sequence'/>
      <dependency to='cv'/>
      <dependency to='pub'/>
      <dependency to='general'/>
      <status code='alpha'>
        In use at FlyBase
      </status>
      <description>
        transcript or protein expression data
      </description>
      <source type='sql' path='expression/expression.sql'/>
    </module>

    <module id='project'>
      <dependency to="cv"/>
      <dependency to="contact"/>
      <dependency to="pub"/>
      <status code='beta'>
      </status>
      <description>
The project table has been moved from general to its own module and has been
expanded to provide properties, publications and contacts.
      </description>
      <source type='sql' path='project/project.sql'/>
    </module>


    <module id='mage'>
	<dependency to='sequence'/>
   	<dependency to='cv'/>
      	<dependency to='pub'/>
      	<dependency to='general'/>
 	<dependency to='organism'/>
 	<dependency to='contact'/>
 	<dependency to='companalysis'/>
        <dependency to='project'/> 
      <status code='beta'>
        In use at UCLA/Allen Day
      </status>
      <description>
        Alternative expression module, based on MAGE model
      </description>
      <source type='sql' path='mage/mage.sql'/>
    </module>

    <module id='stock'>
      <dependency to='genetic'/>
      <dependency to='cv'/>
      <dependency to='pub'/>
      <dependency to='general'/>
      <dependency to='contact'/>
      <status code='beta'>
        In use at ParameciumDB
      </status>
      <description>
        For tracking stock collections
      </description>
      <source type='sql' path='stock/stock.sql'/>
    </module>

    <module id='library'>
      <dependency to='sequence'/>
      <dependency to='cv'/>
      <dependency to='pub'/>
      <dependency to='organism'/>
      <status code='beta'>
      </status>
      <description>
        For describing molecular libraries
      </description>
      <source type='sql' path='library/library.sql'/>
    </module>

    <module id='cell_line'>
      <dependency to='sequence'/>
      <dependency to='cv'/>
      <dependency to='pub'/>
      <dependency to='organism'/>
      <dependency to='library'/>
      <status code='beta'>
      </status>
      <description>
        For describing cell lines 
      </description>
      <source type='sql' path='cell_line/cell_line.sql'/>
    </module>


    <module id='composite'>
      <status code='beta'>
      </status>
      <description>
          A collection of bridge codes that have multiple dependencies
          so they don't happily go where is most obvious.
      </description>

      <component id='gff-bridge' type='bridge'>
        <dependency to='pub'/>
        <dependency to='sequence'/>
        <dependency to='companalysis'/>
        <dependency to='cv'/>
        <dependency to='sequence-dbapi'/>
        <description>
          A GFF-view over chado. Required by Gbrowse
        </description>
        <source type='sql' path='sequence/gff-bridge/sequence-gff-views.sql'/>
        <source type='plpgsql' path='sequence/gff-bridge/sequence-gff-funcs.plpgsql'/>
      </component>

      <component id='sequence-views' type='views' required='true'>
        <dependency to='sequence'/>
        <dependency to='companalysis'/>
        <dependency to='cv'/>
        <description>
          Standard Chado SQL Views for the sequence module
        </description>
        <source type='sql' path='sequence/sequence_views.sql'/>
        <component id='range-views' type='views' required='true'>
          <description>
            Views for operating on featureloc ranges. Overlap,
            intersection, union, difference etc
          </description>
          <source type='sql' path='sequence/views/range-views.sql'/>
        </component>
      </component>
    </module>

    <module id='natural-diversity'>
      <dependency to='sequence'/>
      <dependency to='cv'/>
      <dependency to='pub'/>
      <dependency to='phenotype'/>
      <dependency to='organism'/>
      <dependency to='genetic'/>
      <dependency to='contact'/>
      <dependency to='general'/>
      <dependency to='stock'/>
      <dependency to='project'/>
      <status code='beta'>
      </status>
      <description>
Natural diversity module for dealing with populations, samples, genotypes,
phenotypes and results of other assays.
      </description>
      <source type='sql' path='natural_diversity/natural_diversity.sql'/>
    </module>


<!--
    Since this is dynamically generated from a given schema, this should
    either be done at a later step, or if requested, dynamically generated
    at run time after the rest of the schema has been generated
    <module id='audit'>
     <dependency to='sequence'/>
      <dependency to='cv'/>
      <dependency to='pub'/>
      <dependency to='general'/>
      <dependency to='companalysis'/>
      <dependency to='contact'/>
      <dependency to='expression'/>
      <dependency to='event'/>
      <dependency to='genetic'/>
      <dependency to='library'/>
      <dependency to='map'/>
      <dependency to='organism'/>
      <dependency to='phylogeny'/>
      <dependency to='rad'/>
      <dependency to='project'/>
      <dependency to='natural-diversity'/>

      <status code='beta'>
        In use at...?
      </status>
      <description>
        Table auditing for whole database; autogenerated tables
      </description>
      <source type='sql' path='audit/audit_tables.sql'/>
    </module>
-->


  </modules>
</schema_metadata>
