Executes a Scala script. The script is executed in an environment where relevant imports and variable definitions have been made. See Anduril Scala API for available utility classes. The Table class in that API provides I/O support for BED, CSV, FASTA, FASTQ, gzip and VCF formats.
The following variables are visible during execution. Here, X{1-3} refers to variables X1, X2 and X3.
Variable | Kind | Class | Description |
---|---|---|---|
table{1-5} | val | org.anduril.runtime.table.Table | Input tables; null if not provided |
table1.* | def | Members | Members of table1 are imported into main name space |
table{1-5}File | val | java.io.File | Input files; null if not provided |
var{1-3}File | val | java.io.File | Generic inputs; null if not provided |
param{1-5} | val | java.lang.String | Value of extra parameter |
tableOut | var | org.anduril.runtime.table.Table | If assigned, this table is written to tableOutFile; initially null |
tableOutFile | val | java.io.File | Output table file |
optOut{1-3}File | val | java.io.File | Generic outputs |
Members of table1 (if defined) can be accessed without "table1." qualifier. If any table object is assigned to tableOut, it is written to tableOutFile. All outputs are empty if not explictly written to.
Automatically imported classes include:
Version | 1.0 |
---|---|
Bundle | tools |
Categories | External |
Specialties | generic |
Authors | Kristian Ovaska (kristian.ovaska@helsinki.fi) |
Issue tracker | View/Report issues |
Requires | commons-primitives-1.0.jar (jar) ; commons-math3-3.2.jar (jar) |
Source files | component.xml ScalaEvaluate.sh |
Usage | Example with default values |
Name | Type | Mandatory | Description |
---|---|---|---|
scriptFile | ScalaSource | Optional | Scala source file. Either this or the parameter must be given. |
table1 | CSV | Optional | Data table 1, visible as table1 (Table). |
table2 | CSV | Optional | Data table 2, visible as table2 (Table). |
table3 | CSV | Optional | Data table 3, visible as table3 (Table). |
table4 | CSV | Optional | Data table 4, visible as table4 (Table). |
table5 | CSV | Optional | Data table 5, visible as table5 (Table). |
var1 | IN1 or Array<IN1> (generic) | Optional | Generic input that may be used for folders, arrays and binaries. Visible as var1 (File). |
var2 | IN2 or Array<IN2> (generic) | Optional | Generic input that may be used for folders, arrays and binaries. Visible as var2 (File). |
var3 | IN3 or Array<IN3> (generic) | Optional | Generic input that may be used for folders, arrays and binaries. Visible as var3 (File). |
Name | Type | Description |
---|---|---|
table | CSV | Result table. |
optOut1 | OUT1 or Array<OUT1> (generic) | An optional output that can be used for custom data types. |
optOut2 | OUT2 or Array<OUT2> (generic) | An optional output that can be used for custom data types. |
optOut3 | OUT3 or Array<OUT3> (generic) | An optional output that can be used for custom data types. |
scriptOut | ScalaSource | Final Scala script that was executed. Used for debugging. |
Name | Type | Default | Description |
---|---|---|---|
defaultOutput | string | "" | Name of an input port that is written to the output by default. Example: table1. If empty, no table is written to output by default. |
format | string | "csv" | Override input table file formats. The default format for all tables is csv. To override the formats of all tables, set the parameter to one of bed, csv, fasta, fastq or vcf. To override formats for individual tables, use the syntax TABLE=FORMAT,TABLE=FORMAT, where TABLE is one of table1 to table5 and FORMAT is as above. |
param1 | string | "" | Extra parameter, visible as param1 (String). |
param2 | string | "" | Extra parameter, visible as param2 (String). |
param3 | string | "" | Extra parameter, visible as param3 (String). |
param4 | string | "" | Extra parameter, visible as param4 (String). |
param5 | string | "" | Extra parameter, visible as param5 (String). |
scalaFlags | string | "" | Extra command line flags for the Scala compiler. If multiple flags are given, they are separated by space. Flags to the underlying JVM need to be prefixed with -J, e.g., -J-Xprof. |
scriptStr | string | "" | Scala source string. Either this or the input must be given. If both are given, this parameter is appended to the input. |
Test case | Parameters▼ | IN scriptFile |
IN table1 |
IN table2 |
IN table3 |
IN table4 |
IN table5 |
IN var1 |
IN var2 |
IN var3 |
OUT table |
OUT optOut1 |
OUT optOut2 |
OUT optOut3 |
OUT scriptOut |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
case1 | properties | scriptFile | table1 | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | table | (missing) | (missing) | (missing) | (missing) |
parameter.defaultOutput = table1 |
|||||||||||||||
case2_modify | (missing) | scriptFile | table1 | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | table | (missing) | (missing) | (missing) | (missing) |
case3_join | properties | scriptFile | table1 | table2 | table3 | (missing) | (missing) | (missing) | (missing) | (missing) | table | (missing) | (missing) | (missing) | (missing) |
metadata.timeout=0 |
|||||||||||||||
case4_join2 | (missing) | scriptFile | table1 | table2 | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | table | (missing) | (missing) | (missing) | (missing) |
case5_stats | properties | scriptFile | table1 | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) |
metadata.timeout=0 |
|||||||||||||||
case6_collect | (missing) | scriptFile | table1 | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) |
case7_join3 | (missing) | scriptFile | table1 | table2 | table3 | (missing) | (missing) | (missing) | (missing) | (missing) | table | (missing) | (missing) | (missing) | (missing) |
case8_small | properties | scriptFile | table1 | table2 | table3 | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) |
scalaFlags=-optimize -deprecation |