Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
biopet.biopet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Mirrors
biopet.biopet
Commits
80b770ec
Commit
80b770ec
authored
Mar 30, 2017
by
Sander Bollen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Single-sample jobs for count file generation
parent
659a271f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
3 deletions
+74
-3
tarmac/src/main/scala/nl/lumc/sasc/biopet/pipelines/tarmac/Tarmac.scala
...n/scala/nl/lumc/sasc/biopet/pipelines/tarmac/Tarmac.scala
+74
-3
No files found.
tarmac/src/main/scala/nl/lumc/sasc/biopet/pipelines/tarmac/Tarmac.scala
View file @
80b770ec
...
...
@@ -4,14 +4,22 @@ import java.io.File
import
nl.lumc.sasc.biopet.core.
{
PedigreeQscript
,
PipelineCommand
,
Reference
}
import
nl.lumc.sasc.biopet.core.summary.SummaryQScript
import
nl.lumc.sasc.biopet.extensions.Ln
import
nl.lumc.sasc.biopet.extensions.gatk.DepthOfCoverage
import
nl.lumc.sasc.biopet.extensions.wisecondor.WisecondorCount
import
nl.lumc.sasc.biopet.utils.Logging
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
org.broadinstitute.gatk.queue.QScript
import
scalaz.
{
-\/,
\/,
\/-
}
/**
* Created by Sander Bollen on 23-3-17.
*/
class
Tarmac
(
val
root
:
Configurable
)
extends
QScript
with
PedigreeQscript
with
SummaryQScript
with
Reference
{
qscript
=>
private
val
targets
:
File
=
config
(
"targets"
)
def
this
()
=
this
(
null
)
def
init
()
=
{
...
...
@@ -29,13 +37,76 @@ class Tarmac(val root: Configurable) extends QScript with PedigreeQscript with S
class
Sample
(
name
:
String
)
extends
AbstractSample
(
name
)
{
val
inputCountFile
:
Option
[
File
]
=
config
(
"count_file"
)
val
inputXhmmCountFile
:
Option
[
File
]
=
config
(
"xhmm_count_file"
)
val
inputWisecondorCountFile
:
Option
[
File
]
=
config
(
"wisecondor_count_file"
)
val
bamFile
:
Option
[
File
]
=
config
(
"bam"
)
/**
* Create XHMM count file or create link to input count file
* Precedence is given to existing count files.
* Returns a disjunction where right is the file, and left is
* a potential error message
*/
lazy
val
outputXhmmCountFile
:
String
\/
File
=
{
val
outFile
=
new
File
(
sampleDir
+
File
.
separator
+
s
"$name.dcov"
)
(
inputXhmmCountFile
,
bamFile
)
match
{
case
(
Some
(
f
),
_
)
=>
{
val
ln
=
new
Ln
(
root
)
ln
.
input
=
f
ln
.
output
=
outFile
add
(
ln
)
\/-(
ln
.
output
)
}
case
(
None
,
Some
(
bam
))
=>
{
val
dcov
=
DepthOfCoverage
(
root
,
List
(
bam
),
outFile
,
List
(
targets
))
add
(
dcov
)
\/-(
dcov
.
out
)
}
case
_
=>
-\/(
s
"Cannot find bam file or xhmm count file for sample"
+
s
" $name in config. At least one must be given."
)
}
}
/**
* Create wisecondor count file or create link to input count file.
* Precedence is given to existing count files.
* Returns a disjunction where right is the file, and left is
* a potential error message
*/
lazy
val
outputWisecondorCountFile
:
String
\/
File
=
{
val
outFile
=
new
File
(
sampleDir
+
File
.
separator
+
s
"$name.wisecondor.bed"
)
(
inputWisecondorCountFile
,
bamFile
)
match
{
case
(
Some
(
f
),
_
)
=>
{
val
ln
=
new
Ln
(
root
)
ln
.
input
=
f
ln
.
output
=
outFile
add
(
ln
)
\/-(
ln
.
output
)
}
case
(
None
,
Some
(
bam
))
=>
{
val
counter
=
new
WisecondorCount
(
root
)
counter
.
inputBam
=
bam
counter
.
output
=
outFile
counter
.
binFile
=
Some
(
targets
)
add
(
counter
)
\/-(
counter
.
output
)
}
case
_
=>
-\/(
s
"Cannot find bam file or wisecondor count for sample"
+
s
" $name. At least one must be given."
)
}
}
/** Function to add sample jobs */
def
addJobs
()
:
Unit
=
{}
def
addJobs
()
:
Unit
=
{
(
outputWisecondorCountFile
::
outputXhmmCountFile
::
Nil
).
foreach
{
case
-\/(
error
)
=>
Logging
.
addError
(
error
)
case
_
=>
}
}
/* This is necesary for compile reasons, but library does not in fact exist for this pipeline */
/* This is neces
s
ary for compile reasons, but library does not in fact exist for this pipeline */
def
makeLibrary
(
id
:
String
)
=
new
Library
(
id
)
class
Library
(
id
:
String
)
extends
AbstractLibrary
(
id
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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