cwl

package
v0.9.33 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2017 License: BSD-2-Clause Imports: 15 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMapElement

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

func ParseJob

func ParseJob(collection *CWL_collection, job_file string) (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
	String() string
}

type CWLType

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

CWLType httpCWL_objectmonwl.org/v1.0/CommandLineTool.html#CWLType null, boolean, int, long, float, double, string, File, Directory

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
	All                map[string]*CWL_object
}

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_object

type CWL_object 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           string             `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

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 (*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 CommandOutputBinding

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

type CommandOutputParameter

type CommandOutputParameter struct {
	Id             string               `yaml:"id"`
	SecondaryFiles []Expression         `yaml:"secondaryFiles"` // TODO string | Expression | array<string | Expression>
	Format         string               `yaml:"format"`
	Streamable     bool                 `yaml:"streamable"`
	Type           string               `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 CreateCommandOutputArray

func CreateCommandOutputArray(original interface{}) (err error, new_array []CommandOutputParameter)

keyname will be converted into 'Id'-field

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 DockerRequirement

type DockerRequirement struct {
	//Class         string `yaml:"class"`
	DockerPull    string `yaml:"dockerPull"`
	DockerLoad    string `yaml:"dockerLoad"`
	DockerFile    string `yaml:"dockerFile"`
	DockerImport  string `yaml:"dockerImport"`
	DockerImageId string `yaml:"dockerImageId"`
}

func (DockerRequirement) GetClass

func (c DockerRequirement) GetClass() string

func (DockerRequirement) GetId

func (c DockerRequirement) GetId() string

type Empty

type Empty struct {
	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 (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 Expression

type Expression string

func (Expression) Evaluate

func (e Expression) Evaluate(collection *CWL_collection) string

func (Expression) String

func (e Expression) String() string

type File

type File struct {
	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 (*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           string             `yaml:"type"` // TODO CWLType | InputRecordSchema | InputEnumSchema | InputArraySchema | string | array<CWLType | InputRecordSchema | InputEnumSchema | InputArraySchema | string>
}

func CreateInputParameterArray

func CreateInputParameterArray(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 Int

type Int struct {
	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]interface{}

type LinkMergeMethod

type LinkMergeMethod string // merge_nested or merge_flattened

type Requirement

type Requirement interface {
	GetClass() string
}

func CreateRequirementArray

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

[]Requirement

func NewRequirement

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

type ShockRequirement

type ShockRequirement struct {
	Host string `yaml:"host"`
}

func (ShockRequirement) GetClass

func (s ShockRequirement) GetClass() string

func (ShockRequirement) GetId

func (s ShockRequirement) GetId() string

type StepInputExpressionRequirement

type StepInputExpressionRequirement struct {
}

func (StepInputExpressionRequirement) GetClass

func (StepInputExpressionRequirement) GetId

type String

type String struct {
	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 (*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 []Expression         `yaml:"secondaryFiles"` // TODO string | Expression | array<string | Expression>
	Format         []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           string               `yaml:"type"` // TODO CWLType | OutputRecordSchema | OutputEnumSchema | OutputArraySchema | string | array<CWLType | OutputRecordSchema | OutputEnumSchema | OutputArraySchema | string>
}

func CreateWorkflowOutputParameterArray

func CreateWorkflowOutputParameterArray(original interface{}) (err error, new_array []WorkflowOutputParameter)

WorkflowOutputParameter

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           string               `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 CreateWorkflowStepsArray

func CreateWorkflowStepsArray(original interface{}) (err error, new_array []WorkflowStep)

CreateWorkflowStepsArray

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 Expression      `yaml:"valueFrom"` // StepInputExpressionRequirement
}

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

func CreateWorkflowStepInputArray

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

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{}) (err error, new_array []WorkflowStepOutput)

Jump to

Keyboard shortcuts

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