--- title: "Script" slug: "script" updated: 2022-07-27T22:36:42Z published: 2022-07-27T22:36:42Z canonical: "code.tag.bio/script" --- > ## Documentation Index > Fetch the complete documentation index at: https://code.tag.bio/llms.txt > Use this file to discover all available pages before exploring further. # Script 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](https://tagbio-developer-docs.document360.io/docs/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" } ```