【发布时间】:2018-07-30 02:01:56
【问题描述】:
我已经编写了在 docker 容器中运行 Rscript 命令的 CWL 代码。我有两个 cwl 和 yaml 文件并通过命令运行它们:
cwltool --debug a_code.cwl a_input.yaml
我得到的输出表明进程状态为成功,但没有输出文件,结果“输出”:null 被报告。我想知道是否有一种方法可以找到 Rscript 文件已在 docker 上成功运行。我真的想知道输出文件为空的原因。
结果的最后部分是:
[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 代码:
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()
我的cwl文件代码是:
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
我的输入文件(yaml 文件)是:
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
另外,这是我用于创建镜像的 Dockerfile:
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
【问题讨论】:
-
你是如何运行 docker 镜像的?输出文件可能会在 docker 实例中生成,但它不会出现在您的本地文件系统中,除非您使用卷。 stackoverflow.com/questions/47831774/docker-run-with-volume
-
我查过了。我通过以下方式运行 docker: docker run -i -t --rm cummerbund_0:latest 并且我通过命令 docker cp 0f42fb5ad89e:/scripts/cuff.txt shafighi/CWLs/ 检查以移动文件(如果存在)。但没有文件。我也会将用于创建图像的 docker 文件添加到帖子中。