Skip to content
Snippets Groups Projects
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
Branches
Tags
No related merge requests found
...@@ -35,6 +35,7 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r ...@@ -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 */ /** Allow reporting of all found (potentially adapter) sequences in the FastQC */
var sensitiveAdapterSearch: Boolean = config("sensitiveAdapterSearch", default = false) var sensitiveAdapterSearch: Boolean = config("sensitiveAdapterSearch", default = false)
var enableRCtrimming: Boolean = config("enableRCtrimming", default = false)
/** Class for storing a single FastQC module result */ /** Class for storing a single FastQC module result */
protected case class FastQCModule(name: String, status: String, lines: Seq[String]) 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 ...@@ -188,9 +189,10 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r
val fromKnownList: Set[AdapterSequence] = (adapterSet ++ contaminantSet) val fromKnownList: Set[AdapterSequence] = (adapterSet ++ contaminantSet)
.filter(x => foundAdapterNames.exists(_.startsWith(x.name))) .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)) x => AdapterSequence(x.name + "_RC", reverseComplement(x.seq))
} }
else Set.empty
// list all sequences found by FastQC // list all sequences found by FastQC
val fastQCFoundSequences: Seq[AdapterSequence] = if (sensitiveAdapterSearch) { val fastQCFoundSequences: Seq[AdapterSequence] = if (sensitiveAdapterSearch) {
......
...@@ -27,7 +27,7 @@ class CutadaptTest extends FastqcV0101Test { ...@@ -27,7 +27,7 @@ class CutadaptTest extends FastqcV0101Test {
val fqc = new Fastqc(null) val fqc = new Fastqc(null)
fqc.output = outputv0101 fqc.output = outputv0101
fqc.contaminants = Option(resourceFile("fqc_contaminants_v0112.txt")) fqc.contaminants = Option(resourceFile("fqc_contaminants_v0112.txt"))
// fqc.beforeGraph() fqc.enableRCtrimming = true
fqc fqc
} }
......
...@@ -73,11 +73,15 @@ class FastqcV0101Test extends TestNGSuite with Matchers { ...@@ -73,11 +73,15 @@ class FastqcV0101Test extends TestNGSuite with Matchers {
fqc.contaminants = Option(resourceFile("fqc_contaminants_v0101.txt")) fqc.contaminants = Option(resourceFile("fqc_contaminants_v0101.txt"))
// found adapters also contain the adapters in reverse complement (done within flexiprep/fastqc only) // found adapters also contain the adapters in reverse complement (done within flexiprep/fastqc only)
val adapters = fqc.foundAdapters 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" if (fqc.enableRCtrimming) {
adapters.head.seq shouldEqual "CAAGCAGAAGACGGCATACGAGATCGTGATGTGACTGGAGTTCAGACGTGTGCTCTTCCGATC" // 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.name shouldEqual "TruSeq Adapter, Index 1"
adapters.last.seq shouldEqual "GATCGGAAGAGCACACGTCTGAACTCCAGTCACATCACGATCTCGTATGCCGTCTTCTGCTTG" adapters.last.seq shouldEqual "GATCGGAAGAGCACACGTCTGAACTCCAGTCACATCACGATCTCGTATGCCGTCTTCTGCTTG"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment