Commit 275b3584 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Merge branch 'fix-make-rc_trimmingoptional' into 'develop'

enableRCtrimming is used to enable trimming of Reverse Complement versions of adapters

Make trimming of Reverse complement version of adapters optional (by default enableRCtrimming=false)

See merge request !393
parents d84fc9cc edc5fc7f
......@@ -35,6 +35,7 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r
/** Allow reporting of all found (potentially adapter) sequences in the FastQC */
var sensitiveAdapterSearch: Boolean = config("sensitiveAdapterSearch", default = false)
var enableRCtrimming: Boolean = config("enableRCtrimming", default = false)
/** Class for storing a single FastQC module result */
protected case class FastQCModule(name: String, status: String, lines: Seq[String])
......@@ -188,9 +189,10 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r
val fromKnownList: Set[AdapterSequence] = (adapterSet ++ contaminantSet)
.filter(x => foundAdapterNames.exists(_.startsWith(x.name)))
val fromKnownListRC: Set[AdapterSequence] = fromKnownList.map {
val fromKnownListRC: Set[AdapterSequence] = if (enableRCtrimming) fromKnownList.map {
x => AdapterSequence(x.name + "_RC", reverseComplement(x.seq))
}
else Set.empty
// list all sequences found by FastQC
val fastQCFoundSequences: Seq[AdapterSequence] = if (sensitiveAdapterSearch) {
......
......@@ -27,7 +27,7 @@ class CutadaptTest extends FastqcV0101Test {
val fqc = new Fastqc(null)
fqc.output = outputv0101
fqc.contaminants = Option(resourceFile("fqc_contaminants_v0112.txt"))
// fqc.beforeGraph()
fqc.enableRCtrimming = true
fqc
}
......
......@@ -73,11 +73,15 @@ class FastqcV0101Test extends TestNGSuite with Matchers {
fqc.contaminants = Option(resourceFile("fqc_contaminants_v0101.txt"))
// found adapters also contain the adapters in reverse complement (done within flexiprep/fastqc only)
val adapters = fqc.foundAdapters
// we find 1 adapter which comes with the Reverse Complement counterpart
adapters.size shouldBe 2
adapters.head.name shouldEqual "TruSeq Adapter, Index 1_RC"
adapters.head.seq shouldEqual "CAAGCAGAAGACGGCATACGAGATCGTGATGTGACTGGAGTTCAGACGTGTGCTCTTCCGATC"
if (fqc.enableRCtrimming) {
// we find 1 adapter which comes with the Reverse Complement counterpart
adapters.size shouldBe 2
adapters.head.name shouldEqual "TruSeq Adapter, Index 1_RC"
adapters.head.seq shouldEqual "CAAGCAGAAGACGGCATACGAGATCGTGATGTGACTGGAGTTCAGACGTGTGCTCTTCCGATC"
} else {
adapters.size shouldBe 1
}
adapters.last.name shouldEqual "TruSeq Adapter, Index 1"
adapters.last.seq shouldEqual "GATCGGAAGAGCACACGTCTGAACTCCAGTCACATCACGATCTCGTATGCCGTCTTCTGCTTG"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment