From d3a453a18473a93c205d52aa68cfb2f033f593c1 Mon Sep 17 00:00:00 2001 From: bow <bow@bow.web.id> Date: Mon, 28 Jul 2014 11:50:02 +0200 Subject: [PATCH] Add cutadapt statistics output to flexiprep runs --- .../scala/nl/lumc/sasc/biopet/function/fastq/Cutadapt.scala | 6 +++++- .../nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/flexiprep/src/main/scala/nl/lumc/sasc/biopet/function/fastq/Cutadapt.scala b/flexiprep/src/main/scala/nl/lumc/sasc/biopet/function/fastq/Cutadapt.scala index 17df80bf4..2760ead88 100644 --- a/flexiprep/src/main/scala/nl/lumc/sasc/biopet/function/fastq/Cutadapt.scala +++ b/flexiprep/src/main/scala/nl/lumc/sasc/biopet/function/fastq/Cutadapt.scala @@ -19,6 +19,9 @@ class Cutadapt(val root: Configurable) extends BiopetCommandLineFunction { @Output(doc = "Output fastq file") var fastq_output: File = _ + @Output(doc = "Output statistics file") + var stats_output: File = _ + executable = config("exe", default = "cutadapt") override def versionCommand = executable + " --version" override val versionRegex = """(.*)""".r @@ -49,7 +52,8 @@ class Cutadapt(val root: Configurable) extends BiopetCommandLineFunction { optional("-M", opt_maximum_length) + // input / output required(fastq_input) + - " > " + required(fastq_output) + required("--output", fastq_output) + + " > " + required(stats_output) } else { analysisName = getClass.getSimpleName + "-ln" "ln -sf " + diff --git a/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala b/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala index 38b9809da..bb1e004de 100644 --- a/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala +++ b/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala @@ -128,13 +128,19 @@ class Flexiprep(val root: Configurable) extends QScript with BiopetQScript { var R2: File = new File(R2_in) if (!skipClip) { // Adapter clipping + val cutadapt_R1 = new Cutadapt(this) + if (!skipTrim || paired) cutadapt_R1.isIntermediate = true cutadapt_R1.fastq_input = R1 cutadapt_R1.fastq_output = swapExt(outDir, R1, R1_ext, ".clip" + R1_ext) + cutadapt_R1.stats_output = swapExt(outDir, R1, R1_ext, ".clip.stats") + if (outputFiles.contains("contams_R1")) cutadapt_R1.contams_file = outputFiles("contams_R1") + add(cutadapt_R1) R1 = cutadapt_R1.fastq_output + if (paired) { val cutadapt_R2 = new Cutadapt(this) if (!skipTrim || paired) cutadapt_R2.isIntermediate = true -- GitLab