DataType

Numeric Variable

The Numeric Variable is the simplest data type in MotifLab and can only hold a single numeric value. New numeric variables can be created with the operation new (using either a literal number, a collection, or a numeric map as argument) or by extracting numeric values from analyses or other data objects. Numeric Variables can also be manipulated with arithmetic operations (increase, decrease, multiply and divide) and transform.

Creating Numeric Variables

# Create a new Numeric Variable with the specific value 3.14
NumericVar1 = new Numeric Variable(3.14)

# Create a new Numeric Variable based on the number of entries in the given collection
NumericVar2 = new Numeric Variable(SequenceCollection1)

# Create a new Numeric Variable based on the default value from the given Numeric Map
NumericVar3 = new Numeric Variable(NumericMap2)

# Create a new Numeric Variable by extracting the largest value from a given Numeric Map
NumericVar4 = extract "top value" from NumericMap2 as Numeric Variable

# Create a new Numeric Variable by extracting a specific result from an analysis
NumericVar5 = extract "p-value at least observed overlap" from Analysis1 as Numeric Variable

# Create a new Numeric Variable derived from the value of another Numeric Variable
NumericVar6 = multiply NumericVar1 by 10

Using Numeric Variables

Numeric Variables can be used to represent numeric values wherever they may appear, such as in arguments for other operations.
# Create a new Numeric Variable named "Cutoff" and use this as an argument in the subsequent
# filter operation to delete regions that have a score below this value
Cutoff = new Numeric Variable(90)
filter RegionDataset1 where region score < Cutoff