Skip to content
Snippets Groups Projects
Commit de397edd authored by Sander Bollen's avatar Sander Bollen
Browse files

Merge branch 'feature-option_keep_files_flexiprep' into 'develop'

Added a option to not keep the last fastq file anymore

See also #185 

Can not remove the zip action completely, it's still needed for the final fastqc. It's now intermediate by default when running flexiprep in an other pipeline on default.

See merge request !212
parents c4271fbb 60ca1247
No related branches found
No related tags found
No related merge requests found
......@@ -37,13 +37,19 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
/** Skip Clip fastq files */
var skipClip: Boolean = config("skip_clip", default = false)
/** Make a final fastq files, by default only when flexiprep is the main pipeline */
var keepQcFastqFiles: Boolean = config("keepQcFastqFiles", default = root == null)
/** Location of summary file */
def summaryFile = new File(outputDir, sampleId.getOrElse("x") + "-" + libId.getOrElse("x") + ".qc.summary.json")
/** Returns files to store in summary */
def summaryFiles: Map[String, File] = {
Map("input_R1" -> input_R1, "output_R1" -> outputFiles("output_R1_gzip")) ++
(if (paired) Map("input_R2" -> input_R2.get, "output_R2" -> outputFiles("output_R2_gzip")) else Map())
if (!skipTrim || !skipClip)
Map("input_R1" -> input_R1, "output_R1" -> outputFiles("output_R1_gzip")) ++
(if (paired) Map("input_R2" -> input_R2.get, "output_R2" -> outputFiles("output_R2_gzip")) else Map())
else Map("input_R1" -> input_R1) ++
(if (paired) Map("input_R2" -> input_R2.get) else Map())
}
/** returns settings to store in summary */
......@@ -264,13 +270,13 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
val R1 = new File(outputDir, R1_name + ".qc" + R1_ext + ".gz")
val R2 = new File(outputDir, R2_name + ".qc" + R2_ext + ".gz")
add(Gzip(this, fastq_R1, R1))
if (paired) add(Gzip(this, fastq_R2, R2))
if (!skipTrim || !skipClip) {
add(Gzip(this, fastq_R1, R1), !keepQcFastqFiles)
if (paired) add(Gzip(this, fastq_R2, R2), !keepQcFastqFiles)
outputFiles += ("output_R1_gzip" -> R1)
if (paired) outputFiles += ("output_R2_gzip" -> R2)
outputFiles += ("output_R1_gzip" -> R1)
if (paired) outputFiles += ("output_R2_gzip" -> R2)
if (!skipTrim || !skipClip) {
fastqc_R1_after = Fastqc(this, R1, new File(outputDir, R1_name + ".qc.fastqc/"))
add(fastqc_R1_after)
addSummarizable(fastqc_R1_after, "fastqc_R1_qc")
......
......@@ -84,7 +84,7 @@ class FlexiprepTest extends TestNGSuite with Matchers {
flexiprep.functions.count(_.isInstanceOf[Cutadapt]) shouldBe (if (skipClip) 0 else if (paired) 2 else 1)
flexiprep.functions.count(_.isInstanceOf[FastqSync]) shouldBe (if (skipClip) 0 else if (paired) 1 else 0)
flexiprep.functions.count(_.isInstanceOf[Sickle]) shouldBe (if (skipTrim) 0 else 1)
flexiprep.functions.count(_.isInstanceOf[Gzip]) shouldBe (if (paired) 2 else 1)
flexiprep.functions.count(_.isInstanceOf[Gzip]) shouldBe (if (skipClip && skipTrim) 0 else if (paired) 2 else 1)
}
// remove temporary run directory all tests in the class have been run
......
......@@ -154,6 +154,7 @@
<goal>format</goal>
</goals>
<configuration>
<baseDir>${basedir}/src</baseDir>
<rewriteArrowSymbols>false</rewriteArrowSymbols>
<alignParameters>true</alignParameters>
<alignSingleLineCaseStatements_maxArrowIndent>40
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment