Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
0eeaa7b5
Commit
0eeaa7b5
authored
May 13, 2016
by
Peter van 't Hof
Browse files
Merge branch 'feature-allow-custom-adapters' into 'develop'
Feature allow custom adapters fixes #266 See merge request !384
parents
275b3584
847b1265
Changes
4
Hide whitespace changes
Inline
Side-by-side
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/AdapterSequence.scala
0 → 100644
View file @
0eeaa7b5
package
nl.lumc.sasc.biopet.pipelines.flexiprep
/** Case class representing a known adapter sequence */
case
class
AdapterSequence
(
name
:
String
,
seq
:
String
)
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Cutadapt.scala
View file @
0eeaa7b5
...
...
@@ -16,7 +16,6 @@
package
nl.lumc.sasc.biopet.pipelines.flexiprep
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
scala.collection.JavaConversions._
/**
* Cutadapt wrapper specific for Flexiprep.
...
...
@@ -30,9 +29,29 @@ import scala.collection.JavaConversions._
*/
class
Cutadapt
(
root
:
Configurable
,
fastqc
:
Fastqc
)
extends
nl
.
lumc
.
sasc
.
biopet
.
extensions
.
Cutadapt
(
root
)
{
val
ignoreFastqcAdapters
:
Boolean
=
config
(
"ignore_fastqc_adapters"
,
default
=
false
)
val
customAdaptersConfig
:
Map
[
String
,
Any
]
=
config
(
"custom_adapters"
,
default
=
Map
.
empty
)
/** Clipped adapter names from FastQC */
protected
def
seqToName
:
Map
[
String
,
String
]
=
fastqc
.
foundAdapters
.
map
(
adapter
=>
adapter
.
seq
->
adapter
.
name
).
toMap
protected
def
seqToName
:
Map
[
String
,
String
]
=
{
if
(!
ignoreFastqcAdapters
)
{
(
fastqc
.
foundAdapters
++
customAdapters
)
.
map
(
adapter
=>
adapter
.
seq
->
adapter
.
name
).
toMap
}
else
{
customAdapters
.
map
(
adapter
=>
adapter
.
seq
->
adapter
.
name
).
toMap
}
}
def
customAdapters
:
Set
[
AdapterSequence
]
=
{
customAdaptersConfig
.
flatMap
(
adapter
=>
{
adapter
match
{
case
(
adapterName
:
String
,
sequence
:
String
)
=>
Some
(
AdapterSequence
(
adapterName
,
sequence
))
case
_
=>
throw
new
IllegalStateException
(
s
"Custom adapter was setup wrong for: $adapter"
)
}
}).
toSet
}
override
def
summaryStats
:
Map
[
String
,
Any
]
=
{
val
initStats
=
super
.
summaryStats
...
...
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Fastqc.scala
View file @
0eeaa7b5
...
...
@@ -150,9 +150,6 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r
}
}
else
Map
()
/** Case class representing a known adapter sequence */
protected
case
class
AdapterSequence
(
name
:
String
,
seq
:
String
)
/**
* Retrieves overrepresented sequences found by FastQ.
*
...
...
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/QcCommand.scala
View file @
0eeaa7b5
...
...
@@ -102,9 +102,15 @@ class QcCommand(val root: Configurable, val fastqc: Fastqc) extends BiopetComman
addPipeJob
(
seqtk
)
clip
=
if
(!
flexiprep
.
skipClip
)
{
val
foundAdapters
=
fastqc
.
foundAdapters
.
map
(
_
.
seq
)
val
cutadapt
=
clip
.
getOrElse
(
new
Cutadapt
(
root
,
fastqc
))
val
foundAdapters
=
if
(!
cutadapt
.
ignoreFastqcAdapters
)
{
fastqc
.
foundAdapters
.
map
(
_
.
seq
)
++
cutadapt
.
customAdapters
.
map
(
_
.
seq
)
}
else
{
cutadapt
.
customAdapters
.
map
(
_
.
seq
)
}
if
(
foundAdapters
.
nonEmpty
)
{
val
cutadapt
=
clip
.
getOrElse
(
new
Cutadapt
(
root
,
fastqc
))
cutadapt
.
fastqInput
=
seqtk
.
output
cutadapt
.
fastqOutput
=
new
File
(
output
.
getParentFile
,
input
.
getName
+
".cutadapt.fq"
)
cutadapt
.
statsOutput
=
new
File
(
flexiprep
.
outputDir
,
s
"${flexiprep.sampleId.getOrElse("
x
")}-${flexiprep.libId.getOrElse("
x
")}.$read.clip.stats"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment