#!/usr/bin/env cwl-runner

cwlVersion: v1.2
class: CommandLineTool

hints:
  DockerRequirement: 
    dockerPull: quay.io/biocontainers/mulled-v2-fdd016122f200fdc6dc30f6ea2fd0000e8067dff:f9531f6ac1f44332eff70b5912d7d5f3ebe8df38-0
  SoftwareRequirement:  
    packages:
      - package: R
        specs:
          - https://identifiers.org/rrid/RRID:SCR_001905
          - https://identifiers.org/biotools/r
          - https://anaconda.org/bioconda/r
        version: [ "4.2.3" ]
      - package: sleuth
        version: [ "0.30.1" ]
        specs: 
          - https://identifiers.org/rrid/RRID:SCR_016883
          - https://identifiers.org/biotools/sleuth

requirements:
  - class: InitialWorkDirRequirement
    listing:
      - entryname: sleuth.R
        entry:
          $include: sleuth.R

baseCommand: [Rscript, sleuth.R]

inputs:
  inKallistoResults:
    type: Directory
    inputBinding:
      position: 1
  inMetadataFile:
    type: File
    inputBinding:
      position: 2
  inMetadataSample:
    type: string
    inputBinding:
      position: 3
  inMetadataFactorList:
    type: string[]
    inputBinding:
      position: 4
  inMetadataDataCol:
    type: string
    inputBinding:
      position: 5

outputs:
  kallisto_sleuthObject:
    type: File
    outputBinding:
      glob: "kallisto_sleuthObject.RData"
  kallisto_df:
    type: File
    outputBinding:
      glob: "kallisto_df.csv"
  kallisto_tpmMatrix:
    type: File
    outputBinding:
      glob: "kallisto_tpmMatrix.csv"
  kallisto_mappingStats:
    type: File
    outputBinding:
      glob: "kallisto_mappingStats.csv"
  sleuth_dge:
    type: File
    outputBinding:
      glob: "sleuth_dge.csv"

$namespaces:
  s: https://schema.org/
  edam: http://edamontology.org/

$schemas:
  - https://schema.org/version/latest/schemaorg-current-https.rdf
  - http://edamontology.org/EDAM_1.25.owl

s:author:
  - class: s:Person
    s:name: Dominik Brilhaus
    s:identifier: https://orcid.org/0000-0001-9021-3197