Question: cwl for a Phyloseq command
0
gravatar for Shakuntala Baichoo
2.2 years ago by
University of Mauritius
Shakuntala Baichoo0 wrote:

Hi Michael! I have an R script that takes as input 3 files namely an OTU file, a map and a tree and generates a set of reports in the folder output and test.Rdata in current folder. At command line I call it as follows:

Rscript PhyloseqReport.R otus.tax.biom dog_stool_samples_metadata.tsv otus.tre output test.Rdata

I have started the following cwl script:

#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
inputs:
otuFile:
  type: File
  inputBinding:
    position: 1
mapFile:
  type: File
  inputBinding:
    position: 2
tre:
  type: File
  inputBinding:
    position: 3

baseCommand: [ Rscript, PhyloSeqReport.R, "results.Rdata" ]

outputs:
  results:
    type: File
    outputBinding:
      glob: results.Rdata

How do I capture the fact that the set of reports generated should go in folder output?

Thank you.

Shakun

phyloseq cwl R • 890 views
ADD COMMENTlink modified 2.1 years ago • written 2.2 years ago by Shakuntala Baichoo0

I have now modified the PhyloSeqReport.R to run as follows on commandline:

Rscript PhyloseqReport.R otus.tax.biom dog_stool_samples_metadata.tsv otus.tre output

So my cwlfile has been written as follows:

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

inputs:
  otuFile:
    type: File
    inputBinding:
      position: 1
  mapFile:
    type: File
    inputBinding:
      position: 2
  tre:
    type: File
    inputBinding:
      position: 3
  outDir:
    type: string
    inputBinding:
      position: 4

baseCommand: [ Rscript, "/Users/admin/CloudHackathon/h3abionet16S/workflows/tmp/PhyloseqReport.R" ]

outputs:
  resultsGraphs:
    type: File[]
    outputBinding:
      glob: "$(inputs.outDir)/*.jpg"

When I run the workflow like this:

cwltool --debug R_Reports.cwl --otuFile otus.tax.biom --mapFile dog_stool_samples_metadata.tsv --tre otus.tre --outDir output

I get the following output/error:

/usr/local/bin/cwltool 1.0.20160919152321
Parsed job order from command line: {
    "otuFile": {
        "class": "File", 
        "location": "file:///Users/admin/CloudHackathon/h3abionet16S/workflows/tmp/otus.tax.biom"
    }, 
   ....

    {
        "position": [
            4, 
            "outDir"
        ], 
        "datum": "output"
    }
]
[job R_Reports.cwl] /private/var/folders/m2/ghytr99n77v7zp54w129yv240000gn/T/tmp2_6gKl$ Rscript \
    /Users/admin/CloudHackathon/h3abionet16S/workflows/tmp/PhyloseqReport.R \
    /private/var/folders/m2/ghytr99n77v7zp54w129yv240000gn/T/tmpA4ajoR/stg457f8b24-9a4b-48f1-8921-d77faec92e5a/otus.tax.biom \
    /private/var/folders/m2/ghytr99n77v7zp54w129yv240000gn/T/tmpA4ajoR/stg79515c85-af08-4c51-985b-936d4339f62a/dog_stool_samples_metadata.tsv \
    /private/var/folders/m2/ghytr99n77v7zp54w129yv240000gn/T/tmpA4ajoR/stg1e44511c-a68d-42ee-a685-704b592d99ca/otus.tre \
    output
Error in read_biom(biom_file = BIOMfilename) : 
  Both attempts to read input file:
otus.tax.biom
either as JSON (BIOM-v1) or HDF5 (BIOM-v2).
Check file path, file name, file itself, then try again.
Calls: import_biom -> read_biom
Execution halted
[job R_Reports.cwl] completed permanentFail
[job R_Reports.cwl] {
    "resultsGraphs": []
}
Final process status is permanentFail
[job R_Reports.cwl] Removing input staging directory /private/var/folders/m2/ghytr99n77v7zp54w129yv240000gn/T/tmpA4ajoR
[job R_Reports.cwl] Removing temporary directory /private/var/folders/m2/ghytr99n77v7zp54w129yv240000gn/T/tmpAUWjI_
[job R_Reports.cwl] Removing empty output directory /private/var/folders/m2/ghytr99n77v7zp54w129yv240000gn/T/tmp2_6gKl
Workflow error, try again with --debug for more information:
  Process status is ['permanentFail']
Traceback (most recent call last):
  File "build/bdist.macosx-10.10-intel/egg/cwltool/main.py", line 672, in main

    **vars(args))
  File "build/bdist.macosx-10.10-intel/egg/cwltool/main.py", line 228, in single_job_executor
    raise WorkflowException(u"Process status is %s" % (final_status))
WorkflowException: Process status is ['permanentFail']

Kindly advise. Thank you.

ADD REPLYlink written 2.1 years ago by Shakuntala Baichoo0

Hello Shakuntala,

The error is from the R script itself and it seems that it doesn't like your input file otus.tax.biom

Does running the command directly work?

ADD REPLYlink written 2.1 years ago by Michael R. Crusoe1.1k

Hello again Shakun,

Can you reply with a link to the software so I can try it out myself?

ADD REPLYlink written 2.1 years ago by Michael R. Crusoe1.1k

Hi Michael, The command does work directly. I checked some other similar queries and it seems that cwl has some issue with PhyloSeq package. I don't know what to do. Gerrit said he will try it.

ADD REPLYlink written 2.1 years ago by Shakuntala Baichoo0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1148 users visited in the last hour