Closed:Utilizing R Script Inputs in CWL
1
0
Entering edit mode
5.1 years ago
Tony.D • 0

Hi everyone,

I am creating a CWL pipeline for a simple R script (runs in a docker container) that reads in a .csv file and subsequently analyzes it via a R package. I am able to read in the file by passing the file from the command line to the R script using commandArgs(trailingOnly=TRUE) in the script. However, is there any other way of reading in a file (i.e csv file) into a R script using CWL? I feel like commandArgs(trailingOnly=TRUE) may not be the best option.

Here is my .cwl and .yml file

  #!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
requirements:
  ResourceRequirement:
    ramMin: 2096

hints:
 DockerRequirement:
  dockerPull: docker/image

inputs:

 script:
   type: File
   inputBinding:
      position: 1

 annotation:
   type: File
   inputBinding:
      position: 2

baseCommand: [ Rscript ]

outputs:
 getFile:
  type: File
  outputBinding:
   glob: getFile.RData

.yml

script:
  class: File
  path: script_final.R

annotation:
  class: File
  path: annotation_full.csv

Thank you for your help.

cwl R • 147 views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 1998 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6