cwl

package
v0.9.46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2017 License: BSD-2-Clause Imports: 17 Imported by: 12

Documentation

Index

Constants

View Source
const (
	CWL_null    = "null"    //no value
	CWL_boolean = "boolean" //a binary value
	CWL_int     = "int"     //32-bit signed integer
	CWL_long    = "long"    //64-bit signed integer
	CWL_float   = "float"   //single precision (32-bit) IEEE 754 floating-point number
	CWL_double  = "double"  //double precision (64-bit) IEEE 754 floating-point number
	CWL_string  = "string"  //Unicode character sequence
	CWL_File    = "File"    //A File object
)

http://www.commonwl.org/draft-3/CommandLineTool.html#CWLType

Variables

This section is empty.

Functions

func CreateCommandInputParameterTypeArray added in v0.9.45

func CreateCommandInputParameterTypeArray(v interface{}) (cipt_array_ptr *[]CommandInputParameterType, err error)

func CreateRequirementArray

func CreateRequirementArray(original interface{}) (new_array_ptr *[]Requirement, err error)

func CreateWorkflowStepInputArray

func CreateWorkflowStepInputArray(original interface{}) (array_ptr *[]WorkflowStepInput, err error)

func CreateWorkflowStepsArray

func CreateWorkflowStepsArray(original interface{}, collection *CWL_collection) (err error, array_ptr *[]WorkflowStep)

CreateWorkflowStepsArray

func EvaluateExpression added in v0.9.45

func EvaluateExpression(collection *CWL_collection, e cwl_types.Expression) string

func GetMapElement

func GetMapElement(m map[interface{}]interface{}, key string) (value interface{}, err error)

func HasCommandInputParameterType added in v0.9.45

func HasCommandInputParameterType(array *[]CommandInputParameterType, search_type string) (ok bool)

func HasInputParameterType added in v0.9.45

func HasInputParameterType(array *[]InputParameterType, search_type string) (ok bool)

func NewCommandOutputParameterArray added in v0.9.45

func NewCommandOutputParameterArray(original interface{}) (copa *[]CommandOutputParameter, err error)

func NewCommandOutputParameterTypeArray added in v0.9.45

func NewCommandOutputParameterTypeArray(original interface{}) (copta *[]CommandOutputParameterType, err error)

func NewInputParameterTypeArray added in v0.9.45

func NewInputParameterTypeArray(original interface{}) (array_ptr *[]InputParameterType, err error)

func NewWorkflowOutputParameterArray added in v0.9.45

func NewWorkflowOutputParameterArray(original interface{}) (new_array_ptr *[]WorkflowOutputParameter, err error)

WorkflowOutputParameter

func NewWorkflowOutputParameterTypeArray added in v0.9.45

func NewWorkflowOutputParameterTypeArray(original interface{}) (wopta_ptr *[]WorkflowOutputParameterType, err error)

func Parse_cwl_document

func Parse_cwl_document(collection *CWL_collection, yaml_str string) (err error)

func Unmarshal

func Unmarshal(data []byte, v interface{}) (err error)

Types

type Any

type Any interface {
	CWL_object
}

func NewAny added in v0.9.45

func NewAny(native interface{}) (any Any, err error)

type Boolean added in v0.9.45

type Boolean struct {
	CWLType_Impl
	Id    string `yaml:"id"`
	Value bool   `yaml:"value"`
}

func (*Boolean) GetClass added in v0.9.45

func (s *Boolean) GetClass() string

func (*Boolean) GetId added in v0.9.45

func (s *Boolean) GetId() string

func (*Boolean) SetId added in v0.9.45

func (s *Boolean) SetId(id string)

func (*Boolean) String added in v0.9.45

func (s *Boolean) String() string

type CWLType

type CWLType interface {
	CWL_object
	// contains filtered or unexported methods
}

CWLType - CWL basic types: int, string, boolean, .. etc http://www.commonwl.org/v1.0/CommandLineTool.html#CWLType null, boolean, int, long, float, double, string, File, Directory

func NewCWLType added in v0.9.45

func NewCWLType(native interface{}) (cwl_type CWLType, err error)

type CWLType_Impl added in v0.9.45

type CWLType_Impl struct{}

type CWLVersion

type CWLVersion interface{} // TODO

type CWL_collection

type CWL_collection struct {
	Workflows          map[string]*Workflow
	WorkflowStepInputs map[string]*WorkflowStepInput
	CommandLineTools   map[string]*CommandLineTool
	Files              map[string]*File
	Strings            map[string]*String
	Ints               map[string]*Int
	Booleans           map[string]*Boolean
	All                map[string]*CWL_object
	Job_input          *Job_document
}

func NewCWL_collection

func NewCWL_collection() (collection CWL_collection)

func (CWL_collection) Add

func (c CWL_collection) Add(obj CWL_object) (err error)

func (CWL_collection) Evaluate

func (c CWL_collection) Evaluate(raw string) (parsed string)

func (CWL_collection) Get

func (c CWL_collection) Get(id string) (obj *CWL_object, err error)

func (CWL_collection) GetFile

func (c CWL_collection) GetFile(id string) (obj *File, err error)

func (CWL_collection) GetInt

func (c CWL_collection) GetInt(id string) (obj *Int, err error)

func (CWL_collection) GetString

func (c CWL_collection) GetString(id string) (obj *String, err error)

func (CWL_collection) GetWorkflowStepInput

func (c CWL_collection) GetWorkflowStepInput(id string) (obj *WorkflowStepInput, err error)

type CWL_document_generic

type CWL_document_generic struct {
	CwlVersion string               `yaml:"cwlVersion"`
	Graph      []CWL_object_generic `yaml:"graph"`
}

this is used by YAML or JSON library for inital parsing

type CWL_location

type CWL_location interface {
	GetLocation() string
}

generic class to represent Files and Directories

type CWL_minimal added in v0.9.45

type CWL_minimal struct{}

type CWL_minimal_interface added in v0.9.45

type CWL_minimal_interface interface {
	// contains filtered or unexported methods
}

type CWL_object

type CWL_object interface {
	CWL_minimal_interface
	GetClass() string
	GetId() string
	SetId(string)
}

type CWL_object_generic

type CWL_object_generic map[string]interface{}

type CommandInputParameter

type CommandInputParameter struct {
	Id             string                      `yaml:"id"`
	SecondaryFiles []string                    `yaml:"secondaryFiles"` // TODO string | Expression | array<string | Expression>
	Format         string                      `yaml:"format"`
	Streamable     bool                        `yaml:"streamable"`
	Type           []CommandInputParameterType `yaml:"type"` // TODO CWLType | CommandInputRecordSchema | CommandInputEnumSchema | CommandInputArraySchema | string | array<CWLType | CommandInputRecordSchema | CommandInputEnumSchema | CommandInputArraySchema | string>
	Label          string                      `yaml:"label"`
	Description    string                      `yaml:"description"`
	InputBinding   CommandLineBinding          `yaml:"inputBinding"`
	Default        *Any                        `yaml:"default"`
}

func CreateCommandInputArray

func CreateCommandInputArray(original interface{}) (err error, new_array []*CommandInputParameter)

keyname will be converted into 'Id'-field

func NewCommandInputParameter added in v0.9.45

func NewCommandInputParameter(v interface{}) (input_parameter *CommandInputParameter, err error)

type CommandInputParameterType added in v0.9.45

type CommandInputParameterType struct {
	Type string
}

func NewCommandInputParameterType added in v0.9.45

func NewCommandInputParameterType(original interface{}) (cipt_ptr *CommandInputParameterType, err error)

type CommandLineBinding

type CommandLineBinding struct {
	LoadContents  bool   `yaml:"loadContents"`
	Position      int    `yaml:"position"`
	Prefix        string `yaml:"prefix"`
	Separate      string `yaml:"separate"`
	ItemSeparator string `yaml:"itemSeparator"`
	ValueFrom     string `yaml:"valueFrom"`
	ShellQuote    bool   `yaml:"shellQuote"`
}

http://www.commonwl.org/v1.0/Workflow.html#CommandLineBinding

type CommandLineTool

type CommandLineTool struct {
	Id                 string                   `yaml:"id"`
	BaseCommand        string                   `yaml:"baseCommand"` // TODO also allow []string
	Inputs             []CommandInputParameter  `yaml:"inputs"`
	Outputs            []CommandOutputParameter `yaml:"outputs"`
	Hints              []Requirement            `yaml:"hints"` // TODO Any
	Label              string                   `yaml:"label"`
	Description        string                   `yaml:"description"`
	CwlVersion         CWLVersion               `yaml:"cwlVersion"`
	Arguments          []string                 `yaml:"arguments"` // TODO support CommandLineBinding
	Stdin              string                   `yaml:"stdin"`     // TODO support Expression
	Stdout             string                   `yaml:"stdout"`    // TODO support Expression
	SuccessCodes       []int                    `yaml:"successCodes"`
	TemporaryFailCodes []int                    `yaml:"temporaryFailCodes"`
	PermanentFailCodes []int                    `yaml:"permanentFailCodes"`
}

func NewCommandLineTool added in v0.9.45

func NewCommandLineTool(object CWL_object_generic) (commandLineTool *CommandLineTool, err error)

func (*CommandLineTool) GetClass

func (c *CommandLineTool) GetClass() string

func (*CommandLineTool) GetId

func (c *CommandLineTool) GetId() string

func (*CommandLineTool) SetId

func (c *CommandLineTool) SetId(id string)

type CommandOutputArraySchema added in v0.9.45

type CommandOutputArraySchema struct {
	Items         []string              `yaml:"items"`
	Type          string                `yaml:"type"` // must be array
	Label         string                `yaml:"label"`
	OutputBinding *CommandOutputBinding `yaml:"outputBinding"`
}

func NewCommandOutputArraySchema added in v0.9.45

func NewCommandOutputArraySchema(original map[interface{}]interface{}) (coas *CommandOutputArraySchema, err error)

type CommandOutputBinding

type CommandOutputBinding struct {
	Glob         []cwl_types.Expression `yaml:"glob"`
	LoadContents bool                   `yaml:"loadContents"`
	OutputEval   cwl_types.Expression   `yaml:"outputEval"`
}

func NewCommandOutputBinding added in v0.9.45

func NewCommandOutputBinding(original interface{}) (commandOutputBinding *CommandOutputBinding, err error)

type CommandOutputEnumSchema added in v0.9.45

type CommandOutputEnumSchema struct {
	Symbols       []string
	Type          string // must be enum
	Label         string
	OutputBinding *CommandOutputBinding
}

http://www.commonwl.org/v1.0/CommandLineTool.html#CommandOutputEnumSchema

type CommandOutputParameter

type CommandOutputParameter struct {
	Id             string                       `yaml:"id"`
	SecondaryFiles []cwl_types.Expression       `yaml:"secondaryFiles"` // TODO string | Expression | array<string | Expression>
	Format         string                       `yaml:"format"`
	Streamable     bool                         `yaml:"streamable"`
	Type           []CommandOutputParameterType `yaml:"type"` // TODO CWLType | CommandInputRecordSchema | CommandInputEnumSchema | CommandInputArraySchema | string | array<CWLType | CommandInputRecordSchema | CommandInputEnumSchema | CommandInputArraySchema | string>
	Label          string                       `yaml:"label"`
	Description    string                       `yaml:"description"`
	OutputBinding  CommandOutputBinding         `yaml:"outputBinding"`
}

func NewCommandOutputParameter added in v0.9.45

func NewCommandOutputParameter(original interface{}) (output_parameter *CommandOutputParameter, err error)

type CommandOutputParameterType added in v0.9.45

type CommandOutputParameterType struct {
	Type                      string
	CommandOutputArraySchema  *CommandOutputArraySchema
	CommandOutputRecordSchema *CommandOutputRecordSchema
}

func NewCommandOutputParameterType added in v0.9.45

func NewCommandOutputParameterType(original interface{}) (copt_ptr *CommandOutputParameterType, err error)

type CommandOutputRecordField added in v0.9.45

type CommandOutputRecordField struct{}

type CommandOutputRecordSchema added in v0.9.45

type CommandOutputRecordSchema struct {
	Type   string // Must be record
	Fields []CommandOutputRecordField
	Label  string
}

type Directory

type Directory struct {
	Id       string         `yaml:"id"`
	Location string         `yaml:"location"`
	Path     string         `yaml:"path"`
	Basename string         `yaml:"basename"`
	Listing  []CWL_location `yaml:"basename"`
}

func (Directory) GetClass

func (d Directory) GetClass() string

func (Directory) GetId

func (d Directory) GetId() string

func (Directory) GetLocation

func (d Directory) GetLocation() string

func (Directory) String

func (d Directory) String() string

type Empty

type Empty struct {
	CWLType_Impl
	Id    string `yaml:"id"`
	Class string `yaml:"class"`
}

this is a generic CWL_object. Its only purpose is to retrieve the value of "class"

func NewEmpty added in v0.9.45

func NewEmpty(value interface{}) (obj_empty *Empty, err error)

func (Empty) GetClass

func (e Empty) GetClass() string

func (Empty) GetId

func (e Empty) GetId() string

func (Empty) SetId

func (e Empty) SetId(id string)

func (Empty) String

func (e Empty) String() string

type File

type File struct {
	CWLType_Impl
	Id             string         `yaml:"id"`
	Location       string         `yaml:"location"` // An IRI that identifies the file resource.
	Path           string         `yaml:"path"`     // dirname + '/' + basename == path This field must be set by the implementation.
	Basename       string         `yaml:"basename"` // dirname + '/' + basename == path // if not defined, take from location
	Dirname        string         `yaml:"dirname"`  // dirname + '/' + basename == path
	Nameroot       string         `yaml:"nameroot"`
	Nameext        string         `yaml:"nameext"`
	Checksum       string         `yaml:"checksum"`
	Size           int32          `yaml:"size"`
	SecondaryFiles []CWL_location `yaml:"secondaryFiles"`
	Format         string         `yaml:"format"`
	Contents       string         `yaml:"contents"`
	// Shock node
	Host   string
	Node   string
	Bearer string
	Token  string
}

http://www.commonwl.org/v1.0/Workflow.html#File

func MakeFile

func MakeFile(id string, obj interface{}) (file File, err error)

func NewFile added in v0.9.45

func NewFile(obj interface{}) (file File, err error)

func (*File) GetClass

func (f *File) GetClass() string

func (*File) GetId

func (f *File) GetId() string

func (*File) GetLocation

func (f *File) GetLocation() string

func (*File) SetId

func (f *File) SetId(id string)

func (*File) String

func (f *File) String() string

type InputParameter

type InputParameter struct {
	Id             string                `yaml:"id"`
	Label          string                `yaml:"label"`
	SecondaryFiles []string              `yaml:"secondaryFiles"` // TODO string | Expression | array<string | Expression>
	Format         string                `yaml:"format"`
	Streamable     bool                  `yaml:"streamable"`
	Doc            string                `yaml:"doc"`
	InputBinding   CommandLineBinding    `yaml:"inputBinding"` //TODO
	Default        Any                   `yaml:"default"`
	Type           *[]InputParameterType `yaml:"type"` // TODO CWLType | InputRecordSchema | InputEnumSchema | InputArraySchema | string | array<CWLType | InputRecordSchema | InputEnumSchema | InputArraySchema | string>
}

func NewInputParameter added in v0.9.45

func NewInputParameter(original interface{}) (input_parameter *InputParameter, err error)

func NewInputParameterArray added in v0.9.45

func NewInputParameterArray(original interface{}) (err error, new_array []InputParameter)

InputParameter

func (InputParameter) GetClass

func (i InputParameter) GetClass() string

func (InputParameter) GetId

func (i InputParameter) GetId() string

func (InputParameter) SetId

func (i InputParameter) SetId(id string)

type InputParameterType added in v0.9.45

type InputParameterType struct {
	Type string
}

func NewInputParameterType added in v0.9.45

func NewInputParameterType(original interface{}) (ipt_ptr *InputParameterType, err error)

type Int

type Int struct {
	CWLType_Impl
	Id    string `yaml:"id"`
	Value int    `yaml:"value"`
}

func (*Int) GetClass

func (i *Int) GetClass() string

func (*Int) GetId

func (i *Int) GetId() string

func (*Int) SetId

func (i *Int) SetId(id string)

func (*Int) String

func (i *Int) String() string

type Job_document

type Job_document map[string]CWLType

func NewJob_document added in v0.9.45

func NewJob_document(original interface{}) (job *Job_document, err error)

func ParseJob

func ParseJob(collection *CWL_collection, job_file string) (job_input *Job_document, err error)

type LinkMergeMethod

type LinkMergeMethod string // merge_nested or merge_flattened

type OutputArraySchema added in v0.9.45

type OutputArraySchema struct{}

type OutputEnumSchema added in v0.9.45

type OutputEnumSchema struct{}

type OutputRecordSchema added in v0.9.45

type OutputRecordSchema struct{}

type Process added in v0.9.45

type Process interface {
	CWL_object
	// contains filtered or unexported methods
}

func NewProcess added in v0.9.45

func NewProcess(original interface{}, collection *CWL_collection) (process Process, err error)

returns CommandLineTool, ExpressionTool or Workflow

type ProcessPointer added in v0.9.45

type ProcessPointer struct {
	Id    string
	Value string
}

func (*ProcessPointer) GetClass added in v0.9.45

func (p *ProcessPointer) GetClass() string

func (*ProcessPointer) GetId added in v0.9.45

func (p *ProcessPointer) GetId() string

func (*ProcessPointer) SetId added in v0.9.45

func (p *ProcessPointer) SetId(string)

type Requirement

type Requirement interface {
	GetClass() string
}

func CreateRequirementDEPRECATED added in v0.9.45

func CreateRequirementDEPRECATED(class string, v interface{}) (requirement Requirement, err error)

create Requirement object from interface type

func NewRequirement

func NewRequirement(class string, obj interface{}) (r Requirement, err error)

type String

type String struct {
	CWLType_Impl
	Id    string `yaml:"id"`
	Value string `yaml:"value"`
}

func (*String) GetClass

func (s *String) GetClass() string

func (*String) GetId

func (s *String) GetId() string

func (*String) SetId

func (s *String) SetId(id string)

func (*String) String

func (s *String) String() string

type Workflow

type Workflow struct {
	Inputs       []InputParameter          `yaml:"inputs"`
	Outputs      []WorkflowOutputParameter `yaml:"outputs"`
	Id           string                    `yaml:"id"`
	Steps        []WorkflowStep            `yaml:"steps"`
	Requirements []Requirement             `yaml:"requirements"`
	Hints        []Requirement             `yaml:"hints"` // TODO Hints may contain non-requirement objects. Give warning in those cases.
	Label        string                    `yaml:"label"`
	Doc          string                    `yaml:"doc"`
	CwlVersion   CWLVersion                `yaml:"cwlVersion"`
	Metadata     map[string]interface{}    `yaml:"metadata"`
}

func NewWorkflow added in v0.9.45

func NewWorkflow(object CWL_object_generic, collection *CWL_collection) (workflow Workflow, err error)

func (*Workflow) GetClass

func (w *Workflow) GetClass() string

func (*Workflow) GetId

func (w *Workflow) GetId() string

func (*Workflow) SetId

func (w *Workflow) SetId(id string)

type WorkflowOutputParameter

type WorkflowOutputParameter struct {
	Id             string                        `yaml:"id"`
	Label          string                        `yaml:"label"`
	SecondaryFiles []cwl_types.Expression        `yaml:"secondaryFiles"` // TODO string | Expression | array<string | Expression>
	Format         []cwl_types.Expression        `yaml:"format"`
	Streamable     bool                          `yaml:"streamable"`
	Doc            string                        `yaml:"doc"`
	OutputBinding  CommandOutputBinding          `yaml:"outputBinding"` //TODO
	OutputSource   []string                      `yaml:"outputSource"`
	LinkMerge      LinkMergeMethod               `yaml:"linkMerge"`
	Type           []WorkflowOutputParameterType `yaml:"type"` // TODO CWLType | OutputRecordSchema | OutputEnumSchema | OutputArraySchema | string | array<CWLType | OutputRecordSchema | OutputEnumSchema | OutputArraySchema | string>
}

func NewWorkflowOutputParameter added in v0.9.45

func NewWorkflowOutputParameter(original interface{}) (wop *WorkflowOutputParameter, err error)

type WorkflowOutputParameterType added in v0.9.45

type WorkflowOutputParameterType struct {
	Type               string
	OutputRecordSchema *OutputRecordSchema
	OutputEnumSchema   *OutputEnumSchema
	OutputArraySchema  *OutputArraySchema
}

func NewWorkflowOutputParameterType added in v0.9.45

func NewWorkflowOutputParameterType(original interface{}) (wopt_ptr *WorkflowOutputParameterType, err error)

type WorkflowStep

type WorkflowStep struct {
	Id            string               `yaml:"id"`
	In            []WorkflowStepInput  `yaml:"in"` // array<WorkflowStepInput> | map<WorkflowStepInput.id, WorkflowStepInput.source> | map<WorkflowStepInput.id, WorkflowStepInput>
	Out           []WorkflowStepOutput `yaml:"out"`
	Run           *Process             `yaml:"run"` // Specification unclear: string | CommandLineTool | ExpressionTool | Workflow
	Requirements  []Requirement        `yaml:"requirements"`
	Hints         []Requirement        `yaml:"hints"`
	Label         string               `yaml:"label"`
	Doc           string               `yaml:"doc"`
	Scatter       string               `yaml:"scatter"`       // ScatterFeatureRequirement
	ScatterMethod string               `yaml:"scatterMethod"` // ScatterFeatureRequirement
}

func NewWorkflowStep added in v0.9.45

func NewWorkflowStep(original interface{}, collection *CWL_collection) (w *WorkflowStep, err error)

func (WorkflowStep) GetOutput

func (w WorkflowStep) GetOutput(id string) (output *WorkflowStepOutput, err error)

type WorkflowStepInput

type WorkflowStepInput struct {
	Id        string               `yaml:"id"`
	Source    []string             `yaml:"source"` // MultipleInputFeatureRequirement
	LinkMerge LinkMergeMethod      `yaml:"linkMerge"`
	Default   Any                  `yaml:"default"`   // type Any does not make sense
	ValueFrom cwl_types.Expression `yaml:"valueFrom"` // StepInputExpressionRequirement
}

http://www.commonwl.org/v1.0/Workflow.html#WorkflowStepInput

func NewWorkflowStepInput added in v0.9.45

func NewWorkflowStepInput(original interface{}) (input_parameter_ptr *WorkflowStepInput, err error)

func (WorkflowStepInput) GetClass

func (w WorkflowStepInput) GetClass() string

func (WorkflowStepInput) GetId

func (w WorkflowStepInput) GetId() string

func (WorkflowStepInput) GetObject

func (input WorkflowStepInput) GetObject(c *CWL_collection) (obj *CWL_object, err error)

func (WorkflowStepInput) SetId

func (w WorkflowStepInput) SetId(id string)

type WorkflowStepOutput

type WorkflowStepOutput struct {
	Id string `yaml:"id"`
}

func CreateWorkflowStepOutputArray

func CreateWorkflowStepOutputArray(original interface{}) (new_array []WorkflowStepOutput, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL