This is a test version of Biostars. For the public version, visit https://www.biostars.org.
cwl for a Phyloseq command

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

cwl phyloseq r

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.

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?

Hello again Shakun,

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

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.

Hello Shakuntala Baichoo!

We believe that this post does not fit the main topic of this site.

CWL support has moved, please refer to CWL user support moving to https://cwl.discourse.group/; many thanks to Biostars for over 4 years of support!

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

0 answers

No answers yet.

Log in to answer this question.