<opt
  name="sgdfeatconv"
  date="20040821"
  >
 
  <title>Chado DB Feature info for SGDLite db</title>
  <about>
    Configured for SGDLite feature usage  
    
    These are configurations for converting chado feature table dumps to
    standard feature/sequence files. Much of below specifies how to
    process different features  
    
    These configs should be data-set independent.
    This works with, but is independent of SeqUtil2 configs.
  </about>
  
  <informat>feature_table</informat>  
  
  <outformats>fff</outformats>
  <outformats>gff</outformats>
  <outformats>fasta</outformats>

  <!-- copied from db-release config files .. this is mostly common info,
    but db-release config can override @featset, %featmap -->

  <!-- feature sets to make fasta bulk files -->
  <!--
  <featset>chromosome</featset>
  <featset>gene</featset>
  <featset>CDS_translation</featset>
  <featset>ncRNA</featset>
  <featset>transposon</featset>
  <featset>gene_extended2000</featset>
  <featset>intergenic</featset>
  -->
  
  <!-- see featuresets.xml -->
  
  <featmap id="gene" get_id="1" />

  <!-- sgd variant; is this a gene or a transposon? 
 SO mail  2005-08-05  http://sourceforge.net/mailarchive/message.php?msg_id=12570320
 "The term "transposable_element_gene" is_a "gene_class" which is a sequence attribute"
  "The features are "gene" and "transposable_element""; see below maptype
 -->
 
  <featmap id="five_prime_UTR" add_id="gene" />
  <featmap id="three_prime_UTR" add_id="gene" />
  <featmap id="intron" add_id="gene" />
  <featmap id="mRNA" add_id="gene" />
  <featmap id="CDS" add_id="gene" />

  <!-- sgdlite doesnt have translation/transcript residues in sgdlite chado -->
  <featmap id="translation"
    types="protein"
    typelabel="protein"
    fromdb="1"
    />
    
  <featmap id="CDS_translation"
    types="CDS gene"
    typelabel="protein protein"
    dotranslate="1"
    fromdb="1"
    />
    
  <featmap id="chromosome"
    types="${golden_path}"
    fromdb="1"
    onlydb="1"
    />
  <featmap id="EST"
    types="EST"
    fromdb="1"
    onlydb="1"
    />
    
  <featmap id="transposon"
    types="transposable_element"
    typelabel="transposable_element"
    />
  <featmap name="ncRNA"
    types="ncRNA snRNA snoRNA rRNA tRNA"
    />
  <featmap id="gene_extended2000"
    types="gene"
    typelabel="gene_ex2000"
    subrange="-2000..2000"
    />
  <featmap id="intergenic"
    types="gene"
    typelabel="intergenic"
    method="between"
    />

    
<!-- 
this is sgd chado gene model ; uses introns instead of exons; no mRNAs (gene == mRNA?)

sgdlite=# SELECT f.name,f.uniquename,t.name
          FROM feature f, cvterm t WHERE f.type_id=t.cvterm_id
          AND f.name = 'YFL039C';
  name   |           uniquename                     | name
 YFL039C | YFL039C_gene_chrVI:53259..54695          | gene
 YFL039C | YFL039C_intron_intron_chrVI:54377..54685 | intron
 YFL039C | YFL039C_CDS_CDS_chrVI:54685..54695       | CDS
 YFL039C | YFL039C_CDS_CDS_chrVI:53259..54377       | CDS

?? rename the above as exon ? or leave as CDS ?
gene_is_complex does this for mRNA-less sgd data, 
instead of simple gene + complex mRNA
fff/scer-chrVI-sgdr5.fff:
chrVI  53260   gene    YFL039C -       complement(53260..54377,54686..54695)   YFL039C SGD:S000001855; synonym=ABY1,ACT1,END7,YFL039C,actin

ncRNA is the exon child part for RNA genes (tRNA only?; can also have intron part)
pseudogenes have 'CDS'/exon, intron child parts

Also, centromere  has  region child parts  (named? curated?)
Also, repeat_family has nucleotide_match child parts  (named? curated?)
-->

  <gene_is_complex>1</gene_is_complex> <!-- has mRNA structure instead of begin,end -->
  <GModelParts>CDS,exon,ncRNA</GModelParts>
  <GModelParents>gene</GModelParents>
  <CDS_spanType>gene</CDS_spanType>
  <CDS_exonType>CDS</CDS_exonType>
  
  <!-- 
  feat_model: 
    revision of above mess for gene models; handle pseudogene; ncRNAs ...
    see chadofeatconv.xml doc
  -->
  <feat_model id="gene" is_simple="0">
    <parts>CDS</parts> <!-- exon equivalent -->
    <skipparts>intron</skipparts>  <!-- dont need; inverse of exons -->
  </feat_model>
  <feat_model id="pseudogene">
    <parts>CDS</parts> <!-- exon equivalent -->
    <skipparts>intron</skipparts> 
  </feat_model>
  <feat_model id="tRNA">
    <parts>ncRNA</parts> <!-- exon equivalent -->
    <skipparts>intron</skipparts>  
  </feat_model>
  
  <!-- dont warn if these types have Parent oid not in data; e.g  chromosome parent -->
  <maptype_ignore_missingparent>^(gene|match_part|match)</maptype_ignore_missingparent>
  
  <!-- 0710: 
      add/replace ${golden_path} everywhere we find chromosome, EXCEPT
      golden_path is list of "csome","arm","scaffold" so we need to change
      perl processing of these fields to handle list
   -->   
      
  <!-- move these odd groupings into featmap structures ?? -->
  <!-- chado has these with fmin == 1-origin, others are 0-origin; why?? -->
  <origin_one
    chromosome_arm="1"
    chromosome_band="1"
    chromosome="1"
    supercontig="1"
    />

  <topsort
    chromosome_arm="1"
    chromosome="1"
    supercontig="1"
    />
    
  <segmentfeats 
    BAC="1"
    chromosome_arm="1"
    chromosome_band="1"
    chromosome="1"
    supercontig="1"
    golden_path_region="1"
    golden_path="1"
    source="1"
    />
  <!-- 
      ## segment no longer valid SO; supercontig or golden_path are best
  -->
  
  <!-- simplefeat == segmentfeats + others 
    NOT_gene="1"
    NOT_SGD_pseudogene="1"
    what is problem with ncRNA ??
  -->
  <simplefeat 
    oligo="1"
    intron="1"
    nucleotide_match="1"
    point_mutation="1"
    region="1"
    repeat_region="1"
    segment="1"
    transcription_start_site="1"
    binding_site="1"
    />
    
  <dropname 
    mRNA_genscan="1"
    mRNA_piecegenie="1"
    tRNA_trnascan="1"
    />
    
    <!-- these are child parts; id is autogenerated -->
  <dropid 
    exon="1"
    intron="1"
    CDS="1"
    ncRNA="1"
    />
    
  <dropfeat_fff 
    exon="1"
    remark="1"
    intron="1"
    CDS="1"
    ncRNA="1"
    />
    
  <dropfeat_gff 
    remark="1"
    />

  <skipaskid 
    />

  
  <hasdups 
    />

<!-- 
  FIXME: GFFv3 is using CDS to mean coding_exon, not coding span (like mRNA)
    dont recode CDS; revise FeatureWriter to handle as an exon-equivalent/duplicate.
    But do recode ncRNA as exon; sgd is using it that way (part of other ncRNA's)
    did try this for sgd gene models:
    CDS="exon"
    ncRNA="exon"
-->

  <maptype 
    OLD_USAGE_CDS="exon"
    ncRNA="exon"
    five_prime_untranslated_region="five_prime_UTR"
    golden_path_region="golden_path"
    match_fgenesh="match_fgenesh"
    match_HDP="match_HDP"
    match_RNAiHDP="match_RNAiHDP"
    mRNA_genscan="mRNA_genscan"
    mRNA_piecegenie="mRNA_piecegenie"
    mRNA_trnascan="tRNA_trnascan"
    oligonucleotide="oligo"
    three_prime_untranslated_region="three_prime_UTR"
    transposable_element_gene="gene"
    />
  <!--
  so => "located_sequence_feature", ## no replacement for so ; SO:1000000
  -->
    
 
  <maptype_gff>
    <OLD_USAGE_exon_SGD>CDS:SGD</OLD_USAGE_exon_SGD>
    <!-- urk; want also exon_SGD > ncRNA:SGD for rna types -->
    <match_fgenesh>match:fgenesh</match_fgenesh>
    <match_part_fgenesh>match_part:fgenesh</match_part_fgenesh>
    <match_HDP>match:HDP</match_HDP>
    <match_part_HDP>match_part:HDP</match_part_HDP>
    <match_RNAiHDP>match:RNAiHDP</match_RNAiHDP>
    <match_part_RNAiHDP>match_part:RNAiHDP</match_part_RNAiHDP>
    <mRNA_genscan>mRNA:genscan</mRNA_genscan>
    <mRNA_piecegenie>mRNA:piecegenie</mRNA_piecegenie>
    <tRNA_trnascan>tRNA:trnascan</tRNA_trnascan>
  </maptype_gff>

  
</opt>
