fmod ASSAYS is
  inc BASEDOPS .  
    **** incs PROTEINOPS has PeptideOps incl THEOPS incl Site Peptide
    **** incs CELLOPS and STRING
  inc HANDLEOPS .
  inc FRACTIONOPS .
  inc POSITIONOPS .
  inc DETECTIONOPS .
  inc CHEMICALOPS .
  inc SUBSTRATEOPS .
    
***  Assay formalization
  sort Assay .
  sort AssayName .
  op assay : AssayName -> Assay [ctor format (nt d)] .

*****************************************************************************
***(
Assay Hierarchy

**** sorts Assay AssayType .
  sorts SimpleAssay ModificationAssay BindingAssay  .
**** ActivationAssay  LocationAssay

subsorts SimpleAssay ModificationAssay  
         BindingAssay  ActivationAssay  LocationAssay < AssayType .
)

*****************************************************************************
****  Auxiliaries -- Handles, Detection methods is separate modules
****  Oligos


*****************************************************************************
*** Oligo declarations -- is this the right place?
***(
sometimes double stranded oligos are used:  ???? does order matter?  
    *** oligo1: GAS 5-ACAGCCTGATTTCCCCGAAATGAC-3
    *** oligo2: GAS 5-GTCATTTCGGGGAAATCAGGCTGT-3
sometimes sequence is not given:
    *** oligo: GAS sequence-not-reported
sometimes oligo name will be a string
    *** oligo: "Egr1-consensus" 5-CGCCCCCGC-3
)

  sorts Oligo OligoName OligoSequence .

  ops GAS SBE AP1 ARE CAGA : -> OligoName [ctor] .
  op PAI1-PE21 : -> OligoName [ctor] .
  op oligo-name-not-reported : -> OligoName [ctor] .
  op oname : String ->  OligoName [ctor] .
  op o : OligoName OligoSequenceDescription -> Oligo [ctor] .

  sort OligoSequenceDescription .
  subsort OligoSequence <  OligoSequenceDescription .
  op _:_ : OligoSequence OligoSequence -> OligoSequenceDescription [ctor ] .

***(
OligoSequences:  should be a NeList that starts with 5- and ends with -3
and contains only A, T, G, or C 
)  
  op 5-_-3 : ATGCList -> OligoSequence .
  sorts ATGC ATGCList .  subsort ATGC < ATGCList .
  ops A T G C : -> ATGC .
  op nil : -> ATGCList [ctor] .
  op __ : ATGCList ATGCList -> ATGCList [ctor assoc id: nil] .
  
  op 5-_-3 : ATGCList -> OligoSequence .
  op sequence-not-reported : -> OligoSequence .
  
*****************************************************************************
**** Simple Assays -- a type and detection method
  
  sorts SimpleAssay GXPAssay REReporterAssay SimpleModAssay .
  subsorts  GXPAssay REReporterAssay SimpleModAssay < SimpleAssay .
  
  op _[_] : SimpleAssay DetectionMethod  -> AssayName .

**** SimpleModAssays
  op upshift : -> SimpleModAssay  [ctor] .
  op dimerization : -> SimpleModAssay  [ctor] .
  op oligomerization : -> SimpleModAssay  [ctor] .
  op polymerization : -> SimpleModAssay  [ctor] .

**** GXPAssays
  op GDP-dissociation : -> GXPAssay  [ctor] .
  op GTP-association : -> GXPAssay  [ctor] .
  op GTP-hydrolysis : -> GXPAssay  [ctor] .
  op GTP-bdpd : -> GXPAssay  [ctor] .
  op GTP-percent : -> GXPAssay  [ctor] .

**** REReporterAssays --- also a kind of activity (of TFs) detection
  op 3TP-reporter : -> REReporterAssay [ctor] .
  op AP1-reporter : -> REReporterAssay [ctor] .
  op ARE-reporter : -> REReporterAssay [ctor] .
  op BRE-reporter : -> REReporterAssay [ctor] .
  op CAGA-reporter : -> REReporterAssay [ctor] .
  op CRE-reporter : -> REReporterAssay [ctor] .
  op DE-reporter : -> REReporterAssay [ctor] .
  op E2fRE-reporter : -> REReporterAssay [ctor] .
  op EgrRE-reporter : -> REReporterAssay [ctor] .
  op Ets-reporter : -> REReporterAssay [ctor] .
  op Elk1-reporter : -> REReporterAssay [ctor] .
  op HRE-reporter : -> REReporterAssay [ctor] .
  op FHRE-reporter : -> REReporterAssay [ctor] .
  op GAS-reporter : -> REReporterAssay [ctor] .
  op IL8-reporter : -> REReporterAssay [ctor] .
  op Isg54-reporter : -> REReporterAssay [ctor] .
  op Ifng-reporter : -> REReporterAssay [ctor] .
  op ISRE-reporter : -> REReporterAssay [ctor] .
  op Lef1-reporter : -> REReporterAssay [ctor] .
  op MycRE-reporter : -> REReporterAssay [ctor] .
  op Nfkb-reporter : -> REReporterAssay [ctor] .
  op REAP-reporter : -> REReporterAssay [ctor] .
  op SBE-reporter : -> REReporterAssay [ctor] .
  op SIE-reporter : -> REReporterAssay [ctor] .
  op SRE-reporter : -> REReporterAssay [ctor] .
  op SrfRE-reporter : -> REReporterAssay [ctor] .
  op StatRE-reporter : -> REReporterAssay [ctor] .
  op Stat3-reporter : -> REReporterAssay [ctor] .
  op Stat5-reporter : -> REReporterAssay [ctor] .
  op Stat6RE-reporter : -> REReporterAssay [ctor] .
  op TCF-reporter : -> REReporterAssay [ctor] .
  op TRE-reporter : -> REReporterAssay [ctor] .
  op Tp53-reporter : -> REReporterAssay [ctor] .
  op SV40promo-reporter : -> REReporterAssay [ctor] .  *** used to test repression by Rb1

**** other simple assays

  op Gal4-reporter : -> SimpleAssay  [ctor] .
  op mRNA : -> SimpleAssay  [ctor] .
  op promo-reporter : -> SimpleAssay  [ctor] .
      --- subject is a gene, testing if gene is on 

  op internalization : -> SimpleAssay  [ctor] .
     --- protein still there but not on the surface
  op nuc-export-reporter : -> SimpleAssay  [ctor] .
     --- protein still there but not in the nucleus
  op nuc-import : -> SimpleAssay  [ctor] .
     --- possible DetectionMethods are IVnucImport
  op nuc-export : -> SimpleAssay  [ctor] .
     --- possible DetectionMethods are NEreporter HeterokaryonAssay

  op surface-exp : -> SimpleAssay  [ctor] .
  op prot-exp : -> SimpleAssay  [ctor] .
  op prot-stability : -> SimpleAssay  [ctor] .
  op secretion : -> SimpleAssay  [ctor] .

  op reporter : -> SimpleAssay  [ctor] .  --- going away

*****************************************************************************
******* Modification assays (with sites -- from theops)

  sort ModificationAssay .

  op _(_)[_] : ModificationAssay Sites DetectionMethod -> AssayName [ctor] . 


  op phos : -> ModificationAssay [ctor] .
       --- Sphos >> phos(SSite)
       --- Tphos >> phos(TSite)
       --- STphos >> phos(STSite)
       --- Yphos >> phos(YSite)
       
  op acetyl : -> ModificationAssay [ctor] .
  op methyl : -> ModificationAssay [ctor] .
  op ubiq : -> ModificationAssay [ctor] .
  op sumo : -> ModificationAssay [ctor] .
  op nedd : -> ModificationAssay [ctor] .
  op cleavage : -> ModificationAssay [ctor] .

  
*****************************************************************************
******* Second subject assays

  sort BindingAssay .

  op _[_]_ : BindingAssay DetectionMethod NeHooks -> AssayName [ctor] .

  ops boundby colocwith copptby snaggedby : -> BindingAssay [ctor] .

  sort Hook .
  op _[_] : OProtein Handle -> Hook [ctor] .
  op _[_] : Peptide Handle -> Hook [ctor] .
  op _[_] : Chemical Handle -> Hook [ctor] .
  op _[_] : Composite Handle -> Hook [ctor] .
  op _[_] : Oligo Handle -> Hook [ctor] .

  sorts Hooks NeHooks .
  subsort Hook < NeHooks < Hooks .
  op none : -> Hooks [ctor] .
  op __ : Hooks Hooks -> Hooks [ctor assoc comm id: none] .
  op __ : NeHooks NeHooks -> NeHooks [ctor ditto] .


*****************************************************************************
*******  Activity assays

  op IVKA(_)(_)[_] : NeSubstrateList Sites DetectionMethod -> AssayName [ctor] .
  op IVLKA(_)[_] : NeLipidList DetectionMethod -> AssayName [ctor] .
  op IVGefA(_)[_] : Substrate DetectionMethod -> AssayName [ctor] .
  op IVPPaseAct(_)[_] : Substrate DetectionMethod -> AssayName [ctor] .
  op oligo-binding[_]_ : DetectionMethod Oligo -> AssayName [ctor] .
  op IVHatAct(_)[_] : Substrate DetectionMethod -> AssayName [ctor] .
  op IVProteaseAct(_)[_] : Substrate DetectionMethod -> AssayName [ctor] .

*** sort Substrate .  moved to Theops

***  subsort BProtein < Substrate .
***  subsort Peptide < Substrate .
***  subsort Chemical < Substrate .
***  subsort Composite < Substrate .

  op ss : BProtein -> Substrate [ctor] .
  op ss : Peptide -> Substrate [ctor] .
  op ss : Chemical -> Substrate [ctor] .
  op ss : Composite -> Substrate [ctor] .

ops MBP Enolase SV40TAg Crebtide : -> Substrate [ctor] .
op snr : -> Substrate [ctor] .      *** substrate not reported
op peptide : -> Substrate [ctor] .  *** used for any peptide substrate 
op auto : ->  Substrate [ctor] .    *** autophosphorylation
op histones : -> Substrate [ctor] . *** purified histone gmish
op S6peptide : -> Substrate [ctor] .

  sorts NeSubstrateList  SubstrateList .
  subsort Substrate < NeSubstrateList < SubstrateList .
  op nil : -> SubstrateList [ctor] .
  op _,_ : SubstrateList SubstrateList -> SubstrateList [ctor assoc id: nil] .
  op _,_ : NeSubstrateList SubstrateList -> NeSubstrateList [ctor ditto] .
  op _,_ : SubstrateList NeSubstrateList -> NeSubstrateList [ctor ditto] .
  
  sorts NeLipidList  LipidList .
  subsort Lipid < NeLipidList < LipidList .
  op nil : -> LipidList [ctor] .
  op _`,_ : LipidList LipidList -> LipidList [ctor assoc id: nil] .
  op _`,_ : NeLipidList LipidList -> NeLipidList [ctor ditto] .
  op _`,_ : LipidList NeLipidList -> NeLipidList [ctor ditto] .

*****************************************************************************
******* Location assays

  op locatedin(_)[_] : Position DetectionMethod -> AssayName [ctor] .
  op infraction(_)[_] : Fraction DetectionMethod -> AssayName [ctor] .
**** shorthand:	boundto(Gene)[ChIP]
  op boundto(_)[_] : Gene DetectionMethod -> AssayName [ctor] .

*****************************************************************************
*******new assays added by amk
*** the following could be classified as PhenotypeAssays or no subject assays

  op Thymidine-inc : -> SimpleAssay  [ctor] .
  op BRDU-incorporation : -> SimpleAssay  [ctor] .
  op Apoptosis : -> SimpleAssay  [ctor] .
  op Proliferation : -> SimpleAssay  [ctor] .
  op PtdBtd-accumulation : -> SimpleAssay  [ctor] .
  op IP3-accumulation : -> SimpleAssay  [ctor] .
  op PI45P2-accumulation : -> SimpleAssay  [ctor] .
  op PI4P-accumulation : -> SimpleAssay  [ctor] .
  op CellCycleArrest : -> SimpleAssay  [ctor] .
  op G1Arrest : -> SimpleAssay  [ctor] .
  op ClonogenicGrowth : -> SimpleAssay  [ctor] .
  op PolyUbiq : -> SimpleAssay  [ctor] .
  op NeuriteOutgrowth : -> SimpleAssay  [ctor] .
  op Caspase37-activity : -> SimpleAssay  [ctor] .
  op G1-arrest : -> SimpleAssay  [ctor] .
  op Colonies-In-Soft-Agar : -> SimpleAssay  [ctor] .

*** request parser change to 
*** op cytolysisof(_)[_] : -> Cells DetectionMethod -> AssayName [ctor] .

  op RAJI-cytolysis : -> SimpleAssay  [ctor] .
  op K562-cytolysis : -> SimpleAssay  [ctor] .

  op aggregation : -> SimpleAssay  [ctor] .
  op receptor-binding : -> SimpleAssay  [ctor] .

***  op methylation : -> ModificationAssay [ctor] .

*** Acitivity Assays

  op PTPaseAct : -> SimpleAssay [ctor] .
***  op IVHatAct : -> SimpleAssay [ctor] .
  op IVtranscription : ->  SimpleAssay [ctor] .

  op dephos : -> ModificationAssay [ctor] .



endfm


***(  Why not this instead?

SimpleAssay = Assay with Name and DM only.

  op _[_] : AssayName DetectionMethod  ->  SimpleAssay .

SecondSubjectAssay = Assay with Name, DM, Hooks

  op _[_]_ : AssayName DetectionMethod NeHooks -> SecondSubjectAssay [ctor] .

ActivityAssay = Assay with Name, Substrates, Site, DM

  op _(_)(_)[_] : AssayName Substrates Sites DetectionMethod -> ActivityAssay [ctor] .

OtherAssay =  Assay with Name, Something, and DM only.

  op _(_)[_] : AssayName Site DetectionMethod  ->  SiteAssay .
  op _(_)[_] : AssayName Position DetectionMethod  ->  LocationAssay .
  op _(_)[_] : AssayName Fraction DetectionMethod  ->  FractionAssay .
  op _(_)[_] : AssayName Gene DetectionMethod  ->  ChipAssay .

)***



