0

我制作了我的管道,我想在每个过程之前打印一个关于所执行内容的简短描述。

我基本上试图在脚本中的每个进程之前添加一个“打印”。当我运行管道时,它只是首先打印出所有描述,然后进程开始执行。

我做了什么 :

// Trimming
println 'Trimming reads with AlienTrimmer'
process Trimming {
    ...
}


// Convert to fasta
println 'Convert files from fastq to fasta'
process Fastq2Fasta {
    ...
}


// Concatenate files
println 'Combine all fasta files'
reads_fasta.collectFile()


// Dereplication
if (params.prefixdrep) println 'Dereplication using prefixes'
else println 'Dereplication using full reads lentgh'
process Dereplication {
    ...
}

我得到什么:

* Trimming reads with AlienTrimmer
* Convert files from fastq to fasta
* Combine all fasta files
* Dereplication using full reads lentgh
[74/ee63b8] Cached process > Trimming (MOBIO2-16S)
[d7/9b16c3] Cached process > Trimming (IHMS1-16S)
[e8/821f96] Cached process > Trimming (IHMS2-16S)
[2d/bfe805] Cached process > Trimming (MOBIO1-16S)
[a0/6702b3] Cached process > Fastq2Fasta (IHMS1-16S)
[c0/044dcd] Cached process > Fastq2Fasta (MOBIO2-16S)
[84/344d52] Cached process > Fastq2Fasta (MOBIO1-16S)
[7f/20caee] Cached process > Fastq2Fasta (IHMS2-16S)
[aa/ea78e8] Cached process > Dereplication (mycobiote_16S)

我想要的是 :

* Trimming reads with AlienTrimmer
[74/ee63b8] Cached process > Trimming (MOBIO2-16S)
[d7/9b16c3] Cached process > Trimming (IHMS1-16S)
[e8/821f96] Cached process > Trimming (IHMS2-16S)
[2d/bfe805] Cached process > Trimming (MOBIO1-16S)
* Convert files from fastq to fasta
[a0/6702b3] Cached process > Fastq2Fasta (IHMS1-16S)
[c0/044dcd] Cached process > Fastq2Fasta (MOBIO2-16S)
[84/344d52] Cached process > Fastq2Fasta (MOBIO1-16S)
[7f/20caee] Cached process > Fastq2Fasta (IHMS2-16S)
* Combine all fasta files   
* Dereplication using full reads lentgh
[aa/ea78e8] Cached process > Dereplication (mycobiote_16S)
4

1 回答 1

0

快速回答不可能开箱即用。如果您确实需要,可以print在脚本部分使用 a,例如:

process foo {
  script:
  println 'Hello'
  """
  your_command_here
  """
}

但是,您还需要编写代码以仅在第一次时才编写该消息。

于 2019-01-07T12:37:56.323 回答