//  sccs:  @(#)models.wrm	1.10   10/30/94
//
// models.wrm - main file defining tree class structures
// This file is read only at run time, and furthermore
// only when you select 
// "Read Models" or "Add Update File"
// from the main menu.
//
// all tags must appear in tags.wrm or systags.wrm
//
//---------------------------------------------------------------
//  TreeGenes notes:
//
//  In September 1993, I deleted all classes in this file
//  and started anew.  I have stolen a lot of ideas from
//  Sam Cartinhour, Mike Cherry, Richard Durbin, Lisa Lorenzen,
//  David Matthews, John McCarthy, Jean Thierry-Mieg, and anyone
//  else who had one.  I am also indebted to David Neale for
//  putting up with my ignorant and incessant interrogatories
//  about basic biology.
//
//  My goals were to:
//    o Eliminate anything that I don't have data for yet
//    o Make the database look familiar to investigators
//      of the molecular biology of forest tree genomes.
//    o Bring the classes into alignment with the Plant Genome
//      Database schema where possible.
//    o Be sure that there is enough information to recreate
//      an experiment.
//
//  There are still interactions with the Graphical displays that
//  I don't fully understand, so I expect that these areas will have
//  to change.
//
//  I need to better understand the Text vs. ?Text decision.
//
//  Please do not allow tab characters to creep into this document.
// 
//  Class and tag names should not be abbreviated without reason.
//  Tags have only one CAPITAL letter except for acronyms and other
//  reasonable exceptions.  Use underscores to separate words.
//      --Bradley K. Sherman (bks@s27w007.pswfs.gov)


//  We need to deal with multiple species
?Species   Common_name         Text
           Genus               Text
           Species             Text
           Authority           Text
           Haploid_chromosomes Text
           Genetic_map         ?Genetic_map XREF Species
           Images     Tree       ?Image XREF Tree
                      Herbaria   ?Image XREF Herbaria
                      Range_map  ?Image XREF Range_map
           Experiment          ?Experiment XREF Species

// Species have genetic maps.
// The Float in Linkage_group is a kludge for the gMap display.
?Genetic_map Species       ?Species XREF Genetic_map
             Linkage_group gMap ?Linkage_group XREF Genetic_map Float
             Result_of     ?Experiment XREF Genetic_map
             Paper         ?Paper
             Total_groups  int
             Total_loci    int
             Units         ?Text
             Hardware      ?Text
             Software      ?Text

//  A Laboratory is a place where experiments are performed.
//  Each Laboratory has a unique 3 letter name, e.g. IFG
?Laboratory  Name         ?Text
             Address      ?Text
             Contact      ?Colleague
             Investigator ?Colleague
             Experiment   ?Experiment XREF Laboratory

//  Experiments serve to disambiguate data.  Each experiment
//  a six-letter name.  The first three letters designate a
//  Laboratory, and the last three an experiment within the
//  lab.  Often an Experiment produces a Genetic_map.
?Experiment  Laboratory             ?Laboratory XREF Experiment
             Investigator           ?Colleague
             Remark                 ?Text
             Mapping_population     ?Mapping_population XREF Experiment
             Paper                  ?Paper  XREF Experiment
             Protocol               ?Protocol
             Results Seg_data    ?Segregation_data XREF From_experiment
                     Genetic_map ?Genetic_map XREF Result_of
             Species                ?Species XREF Experiment

//  Mapping populations are a group of individuals usually related
//  by some kind of cross, or experimental technique (haploid
//  megagametophytes, e.g).
?Mapping_population  Type       ?Text
                     Species    ?Species
                     Experiment ?Experiment XREF ?Mapping_population
                     Pedigree  Maternal_grandmother ?Germplasm
                               Maternal_grandfather ?Germplasm
                               Paternal_grandmother ?Germplasm
                               Paternal_grandfather ?Germplasm
                               Mother               ?Germplasm
                               Father               ?Germplasm
                               Progeny              ?Germplasm

// Descriptions of individual trees.  Incomplete --bks
?Germplasm    Species ?Species
              Genotype ?Genotype XREF Germplasm
              Source ?Colleague

//  Probes are usually derived from a DNA_library.
//  The class Library is reserved for the kind that contains books.
?DNA_library  Other_name    Text
              Tissue_source ?Text  // Needles e.g.
              Laboratory    ?Laboratory
              Contact       ?Colleague
              Paper         ?Paper
              Type  cDNA
                    genomic

//  Used to be a Chromosome in ACeDB.  Changes have been made to other
//  files in ~TreeGenes/wspec to make Linkage_group always appear in
//  displays.  Aliasing in options.wrm is insufficient.
?Linkage_group  Non_graphic
                Centre           UNIQUE Float UNIQUE Float
                Species          ?Species XREF Linkage_group
                Segregation_data ?Segregation_data
                Locus            ?Locus
                Genetic_map      ?Genetic_map XREF Linkage_group

//  Perhaps the most nebulous class.  Push hard on this one and
//  computer goo flies out all over the place.  I have included
//  Alleles as a simple 3-part entry here.  I'm sure that this
//  will need to be expanded, as Alleles seem to be huge conglomerations
//  in other databases.
?Locus Type  RFLP
             RAPD
             Isozyme
             Gene
       Map  Genetic  gMap ?Linkage_group XREF Locus UNIQUE Float UNIQUE Float
       Molecular_information  Probe   ?Probe XREF Locus
                              Sequence ?Sequence XREF Locus
                              Primer  ?Primer XREF Locus
       Associated_gene  ?Gene XREF Locus
       //                Tree      Genotype    Autorad
       Genotype ?Genotype XREF Locus
       // Genotype ?Germplasm Int Int ?Autoradiogram
       //      Scored-as   Enzyme-used   Molecular weight in Base-pairs
       Allele Int ?Probe ?Restriction_enzyme Int

?Genotype Locus     ?Locus XREF Genotype
          Germplasm ?Germplasm XREF Genotype
          Genotype  Text

//  I am assured by the molecular biologists that Vectors deserve
//  their own class.
?Vector Name                  ?Text  //pUC19 e.g.
        Antibiotic_resistance ?Text //e.g. Ampicillin
        Size                  Int //Base Pairs
        Vendor                ?Vendor

//  Probes elicit loci, however Isozyme loci do not have probes.
?Probe  Locus           ?Locus XREF Probe
        DNA_library     ?DNA_library XREF Probe
        Vector          ?Vector
        Excision_enzyme ?Text //xbaI e.g.
        Insert_size_bp  Int  //Base_pairs
        Sequence        ?Sequence XREF Probe
        Autoradiogram   ?Autoradiogram XREF Probe
        Source  Colleague  ?Colleague
                Laboratory ?Laboratory
                Vendor     ?Vendor
        STS  Amplification_conditions Text
             Primers  Forward  Text
                      Reverse  Text

//  This is another class that has strong interactions with graphical
//  displays.  Note that the .ace file format for Sequence is a little
//  different from what you might expect.
?Sequence Title      UNIQUE ?Text
          Other_name ?Text
          Gene_name  ?Text
          DNA UNIQUE ?DNA
          Peptide    UNIQUE ?Peptide  // if there is DNA then derive from that
          RNA                         // set this tag to display AUGC
          Length     UNIQUE Int
          Probe      ?Probe XREF Sequence
          Primers Forward Text
                  Reverse Text
          Remark      Text
          Quality     Text
          Reference Paper       ?Paper
                    Author      ?Author
                    Colleague   ?Colleague

//  This is the result of scoring the alleles in the experimental
//  results.  Each Locus is scored for each tree in the mapped
//  population.  Tree vs. Locus is a genotype.
//  11/93 This will be changed to Input file, or something
?Segregation_data From_experiment ?Experiment XREF Seg_data
                  Remark Text
                  Locus ?Locus Text

//  Images are Of another object in the database.  This results in
//  more double-clicks of the mouse, but better reflects the fact
//  that the images and image-viewers are not full fledged members
//  of ACEDB.
?Image  Of  Autoradiogram ?Autoradiogram XREF Image
            Colleague     ?Colleague XREF Image
            Tree          ?Species XREF Tree
            Herbaria      ?Species XREF Herbaria
            Range_map     ?Species XREF Range_map
        Format Text // GIF, TIFF ...
        Date   Text
        Remark ?Text
        Size   Int  // in bytes
        // The first Text field is a program to be launched,
        // the second is an argument to that program.  I am
        // using a script "tgxv" to decipher the second field
        // and launch xv, or whatever.
        Pick_me_to_call  UNIQUE Text Text 


//  Colleagues can be people or Institutions.
?Colleague      Position    Text
                Surname     Text
                Given_name  Text
                Form_of_address Text
                Initials    Text
                Suffix      Text
                Profession  Text
                Not_person  // Boolean, indicates institution
                Institution ?Text
                Address Mail         Text
                        Street       Text
                        City         ?Text
                        State        ?Text
                        Postal_code  ?Text
                        Country      ?Text
                        Phone        Text
                        E_mail       Text
                        Fax          Text
                        Telex        Text
                //  We allow seven lines for a Mailing label
                Mailing_label  Add1 UNIQUE Text
                               Add2 UNIQUE Text
                               Add3 UNIQUE Text
                               Add4 UNIQUE Text
                               Add5 UNIQUE Text
                               Add6 UNIQUE Text
                               Add7 UNIQUE Text
                No_Dendrome  //  Do not send digest
                No_IUFRO     //  Do not include in IUFRO list
                Research_interest ?Text
                Keyword           ?Keyword
                Publishes_as      ?Author XREF Full_name
                Associate         ?Colleague XREF Associate
                Last_update       Text
                Obtained_from     ?Colleague
                Image             ?Image XREF Colleague

?Author  Full_name ?Colleague XREF Publishes_as
         Paper     ?Paper

//
?Journal Paper ?Paper XREF Journal

//
// This is the wrong name for this class.  What about books ...
// To be changed 1/13/94
?Paper  Reference  Title          UNIQUE ?Text
                   Original_title Text
                   Journal        UNIQUE ?Journal XREF Paper
                   Publisher      UNIQUE Text
                   So             UNIQUE Text
                   Contained_in   ?Paper XREF Contains
                   Year           UNIQUE Int
                   Volume         UNIQUE Int Text
                   Page           UNIQUE Int Int
        Institution Text
        Adviser     ?Author XREF Paper
        Author      ?Author XREF Paper
        Type        UNIQUE Text
        Language    Text
        Abstract    Text
        Contains    ?Paper XREF Contained_in
        Keyword     ?Keyword
        Experiment  ?Experiment XREF Paper

//
?Autoradiogram  Image ?Image XREF Autoradiogram
                Probe ?Probe XREF Autoradiogram
                Locus ?Locus XREF Autoradiogram
                Blot  Text
                Date  Text
                Protocol ?Protocol
                Set ?Autoradiogram XREF Set
                Remark Text
 
//
?Protocol Description ?LongText

//
?Gene_Class   Gene ?Gene

//
?Gene   Name Correct_name ?Gene XREF Other_name
             Other_name   ?Gene XREF Other_name
        Gene_Class UNIQUE ?Gene_Class XREF Gene
        Molecular_information  Probe    ?Probe XREF Gene
                               Sequence ?Sequence XREF Gene
                               RFLP     ?Locus XREF Gene
        Mapping_information  Locus  ?Locus XREF Associated_Gene
                             Genetic  gMap UNIQUE ?Linkage_group XREF Gene Float Float

// Pretty much straight out of AAtDB
?Restriction_enzyme  Site UNIQUE Text
                     Offset Text
                     Cleavage Text
                     Overhang Text
                     Isoschizomers ?Restriction_enzyme REPEAT
                     Source Vendor ?Vendor
                            Colleague ?Colleague
                            Laboratory ?Laboratory
                     Paper ?Paper
                     Remark Text

//Non colleague, non-laboratory
?Vendor  Other_name ?Vendor XREF Other_name // Full name
         Contents   Text // Description of collection
         Remark     Text // other descriptions
         Paper      ?Paper
         Contact    ?Colleague
         Address Mail   Text
                 Phone  Text
                 E_mail Text
                 Fax    Text

//  Need some place to put these things.
?Primer  Type  ?Text
         Locus ?Locus XREF Primer
         Source Vendor     ?Vendor
                Colleague  ?Colleague
                Laboratory ?Laboratory
         Sequence ?Text                   //was ?Primer XREF Sequence