General Purpose ExternalScript Pscript

From Array Suite Wiki

Jump to: navigation, search

A General-purpose Escript for running Docker tools

This Escript is a flexible skeleton for testing Docker images on a variety of input files; in this example it does not currently support a "Resources" section, but as a fun exercise you can add in a @Resources@ macro and add it in!

This is designed to be a testing environment for new Docker scripts; for production integration you will want to extensively customize to your use case, or follow an example Escript.

If you have appropriate permissions on your OmicSoft Server, add this script with Manage_Scripts and start experimenting!

<Info>
Label=External Tool
Description=Run a pipeline with an external tool (Docker)
Category=Pipeline\External Tool

<Input>
@Resource1@=

~@Resource1@Type=FileName

//External tool input
@Command@=
~@Command@=Command to run in the external tool

@ImageName@=omicdocker/kallisto:testing
~@ImageName@=Docker image name
@OutputFolder@=
~@OutputFolder@=Docker output folder
~@OutputFolder@Type=FilePath
 
//Display
ExternalScriptInputType=Files
ExternalScriptMenuText=External Tool
ExternalScriptMenuStructure=External Tool


//Options
@ParallelJobNumber@=1
~@ParallelJobNumber@=Parallel jobs number
~@ParallelJobNumber@Levels=1,2,3,4,5,6,7,8

@ThreadNumberPerJob@=8
~@ThreadNumberPerJob@=Number of threads for each job
~@ThreadNumberPerJob@Levels=1,2,3,4,5,6,7,8

@Mode@=Single
~@Mode@=File read mode
~@Mode@Levels=Single,Paired,Multiple
~@Mode@ExclusiveLevels=True

@UseCloud@=False
~@UseCloud@=Run external tool on EC2 instance or server
~@UseCloud@Levels=True,False
~@UseCloud@ExclusiveLevels=True

@ErrorOnStdErr@=False
~@ErrorOnStdErr@=Error on standard error
~@ErrorOnStdErr@Levels=True,False
~@ErrorOnStdErr@ExclusiveLevels=True

@ErrorOnMissingOutput@=True
~@ErrorOnMissingOutput@=Error on missing output
~@ErrorOnMissingOutput@Levels=True,False
~@ErrorOnMissingOutput@ExclusiveLevels=True

<Script>

Begin RunEScript /RunOnServer=True;
Resources
"@Resource1@";
Files
"@FileNames@";
EScriptName ExternalTool;
Command @Command@;
Options /ParallelJobNumber=@ParallelJobNumber@ /ThreadNumberPerJob=@ThreadNumberPerJob@ /Mode=@Mode@ /ErrorOnStdErr=@ErrorOnStdErr@ /ErrorOnMissingOutput=@ErrorOnMissingOutput@  /RunOnDocker=True /ImageName="@ImageName@" /UseCloud=@UseCloud@ /OutputFolder="@OutputFolder@"; 

Output "@Transform@" /Type=@TransformType@;

End;