简体   繁体   中英

How can I found that the Rscript have been run successfully on the docker by the CWL?

I have written the CWL code which runs the Rscript command in the docker container. I have two files of cwl and yaml and run them by the command:

cwltool --debug a_code.cwl a_input.yaml

I get the output which said that the process status is success but there is no output file and in the result "output": null is reported. I want to know if there is a method to find that the Rscript file has run on the docker successfully. I want actually know about the reason that the output files are null.

The final part of the result is:

[job a_code.cwl] {
    "output": null, 
    "errorFile": null
}
[job a_code.cwl] Removing input staging directory /tmp/tmpUbyb7k
[job a_code.cwl] Removing input staging directory /tmp/tmpUbyb7k
[job a_code.cwl] Removing temporary directory /tmp/tmpkUIOnw
[job a_code.cwl] Removing temporary directory /tmp/tmpkUIOnw
Removing intermediate output directory /tmp/tmpCG9Xs1
Removing intermediate output directory /tmp/tmpCG9Xs1
{
    "output": null, 
    "errorFile": null
}
Final process status is success
Final process status is success

R code:

library(cummeRbund)
cuff<-readCufflinks( dbFile = "cuffData.db", gtfFile = NULL, runInfoFile = "run.info", repTableFile = "read_groups.info", geneFPKM = "genes.fpkm_trac .... )
#setwd("/scripts")
sink("cuff.txt")
print(cuff)
sink()

My cwl file code is:

class: CommandLineTool
cwlVersion: v1.0
id: cummerbund
baseCommand:
  - Rscript
inputs:
  - id: Rfile
    type: File?
    inputBinding:
      position: 0
  - id: cuffdiffout
    type: 'File[]?'
    inputBinding:
      position: 1
  - id: errorout
    type: File?
    inputBinding:
      position: 99
      prefix: 2>
      valueFrom: |
        error.txt
outputs:
  - id: output
    type: File?
    outputBinding:
      glob: cuff.txt
  - id: errorFile
    type: File?
    outputBinding:
      glob: error.txt
label: cummerbund
requirements:
  - class: DockerRequirement
    dockerPull: cummerbund_0

my input file (yaml file) is:

 inputs:
    Rfile:
      basename: run_cummeR.R
      class: File
      nameext: .R
      nameroot: run_cummeR
      path: run_cummeR.R
    cuffdiffout:
      - class: File
        path: cuffData.db
      - class: File
        path: genes.fpkm_tracking
      - class: File
        path: read_groups.info
      - class: File
        path: genes.count_tracking
      - class: File
        path: genes.read_group_tracking
      - class: File
        path: isoforms.fpkm_tracking
      - class: File
        path: isoforms.read_group_tracking
      - class: File
        path: isoforms.count_tracking
      - class: File
        path: isoform_exp.diff
      - class: File
        path: gene_exp.diff
    errorout:
      - class: File
        path: error.txt

Also, this is my Dockerfile for creating image:

FROM r-base
COPY . /scripts
RUN apt-get update
RUN apt-get install -y \
    libcurl4-openssl-dev\
    libssl-dev\
    libmariadb-client-lgpl-dev\
    libmariadbclient-dev\
    libxml2-dev\
    r-cran-plyr\
    r-cran-reshape2
WORKDIR /scripts
RUN Rscript /scripts/build.R
ENTRYPOINT /bin/bash

I got the answer! There were some problems in my program. 1. The docker was not pulled correctly then the cwl couldn't produce any output.
2. The inputs and outputs were not defined mandatory. So I got the success status in the case which I did not have proper inputs and output.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM