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
912cab31
Commit
912cab31
authored
May 30, 2016
by
bow
Browse files
Merge branch 'feature-autodetect_paired' into 'develop'
Added autodetect fileformat paired Fixed #350 See merge request !414
parents
6a965b1c
500d864f
Changes
1
Hide whitespace changes
Inline
Side-by-side
carp/src/main/scala/nl/lumc/sasc/biopet/pipelines/carp/Carp.scala
View file @
912cab31
...
...
@@ -24,6 +24,7 @@ import nl.lumc.sasc.biopet.extensions.samtools.SamtoolsView
import
nl.lumc.sasc.biopet.pipelines.bammetrics.BamMetrics
import
nl.lumc.sasc.biopet.pipelines.bamtobigwig.Bam2Wig
import
nl.lumc.sasc.biopet.pipelines.mapping.MultisampleMappingTrait
import
nl.lumc.sasc.biopet.utils.Logging
import
nl.lumc.sasc.biopet.utils.config._
import
org.broadinstitute.gatk.queue.QScript
...
...
@@ -49,7 +50,8 @@ class Carp(val root: Configurable) extends QScript with MultisampleMappingTrait
"samtoolsview"
->
Map
(
"h"
->
true
,
"b"
->
true
)
),
"macs2callpeak"
->
Map
(
"fileformat"
->
""
)
)
def
summaryFile
=
new
File
(
outputDir
,
"Carp.summary.json"
)
...
...
@@ -91,6 +93,7 @@ class Carp(val root: Configurable) extends QScript with MultisampleMappingTrait
macs2
.
treatment
=
preProcessBam
.
get
macs2
.
name
=
Some
(
sampleId
)
macs2
.
outputdir
=
sampleDir
+
File
.
separator
+
"macs2"
+
File
.
separator
+
sampleId
+
File
.
separator
macs2
.
fileformat
=
if
(
paired
)
Some
(
"BAMPE"
)
else
Some
(
"BAM"
)
add
(
macs2
)
}
}
...
...
@@ -102,6 +105,13 @@ class Carp(val root: Configurable) extends QScript with MultisampleMappingTrait
Some
(
carp
)
}
lazy
val
paired
:
Boolean
=
{
val
notPaired
=
samples
.
forall
(
_
.
_2
.
libraries
.
forall
(
_
.
_2
.
inputR2
.
isEmpty
))
val
p
=
samples
.
forall
(
_
.
_2
.
libraries
.
forall
(
_
.
_2
.
inputR2
.
isDefined
))
if
(!
notPaired
&&
!
p
)
Logging
.
addError
(
"Combination of Paired-end and Single-end detected, this is not allowed in Carp"
)
p
}
override
def
init
()
=
{
super
.
init
()
// ensure that no samples are called 'control' since that is our reserved keyword
...
...
@@ -119,6 +129,7 @@ class Carp(val root: Configurable) extends QScript with MultisampleMappingTrait
macs2
.
treatment
=
sample
.
preProcessBam
.
get
macs2
.
control
=
samples
(
controlId
).
preProcessBam
.
get
macs2
.
name
=
Some
(
sampleId
+
"_VS_"
+
controlId
)
macs2
.
fileformat
=
if
(
paired
)
Some
(
"BAMPE"
)
else
Some
(
"BAM"
)
macs2
.
outputdir
=
sample
.
sampleDir
+
File
.
separator
+
"macs2"
+
File
.
separator
+
macs2
.
name
.
get
+
File
.
separator
add
(
macs2
)
}
...
...
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