Script
  • 27 Jul 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Script

  • Dark
    Light
  • PDF

Article summary

A Tag.script is an analysis query - a text file formatted in JSON - that can be run on the Tag.cortex platform. Any valid Tag.script can be converted into and registered as a protocol by adding a protocol definition. Note that Tag.script analyses make heavy use of variable objects, which reference and transform data from Tag.cortex. See the Variable Object Reference for details.

Overall schema



The overall schema of a Tag.script is a JSON object with specific attributes. The critical attribute is method which tells the Tag.script interpreter the type of analysis to run. Most analysis methods require the setting of other attributes (e.g., the tag-comparison method requires a focus).

{
  "method": "mmmm", //Mandatory, defines the analysis to be run
  
  //Attributes which inform the analysis
  "background": {...}, //Optional, a categorical variable object
  "focus": {...}, //Mandatory for "method":"tag-comparison", a categorical variable object
  "numeric_focus": {...}, //Mandatory for "method": "numeric-comparison", a numeric variable object
  "analysis_variables": [...], //Optional, an array of numeric and categorical variable objects
  "context": {...}, //Optional, a categorical variable object
 
  //Attributes which control how results are returned
  "limit": #, //Optional, defaults to 100
  "cutoff": #, //Optional, defaults to 0.0
  "sort": [...], //Optional, defaults to "score"
}

Was this article helpful?

What's Next