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
0cc8ef3d
Commit
0cc8ef3d
authored
Apr 05, 2017
by
Sander Bollen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make varda annotation optional (on by default).
parent
31384aa3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
32 deletions
+42
-32
toucan/src/main/scala/nl/lumc/sasc/biopet/pipelines/toucan/ManweActivateAfterImport.scala
...sc/biopet/pipelines/toucan/ManweActivateAfterImport.scala
+2
-5
toucan/src/main/scala/nl/lumc/sasc/biopet/pipelines/toucan/Toucan.scala
...n/scala/nl/lumc/sasc/biopet/pipelines/toucan/Toucan.scala
+40
-27
No files found.
toucan/src/main/scala/nl/lumc/sasc/biopet/pipelines/toucan/ManweActivateAfter
Annot
Import.scala
→
toucan/src/main/scala/nl/lumc/sasc/biopet/pipelines/toucan/ManweActivateAfterImport.scala
View file @
0cc8ef3d
...
...
@@ -25,15 +25,12 @@ import scala.io.Source
* Created by ahbbollen on 9-10-15.
* Wrapper for manwe activate after importing and annotating
*/
class
ManweActivateAfterAnnotImport
(
root
:
Configurable
,
annotate
:
ManweAnnotateVcf
,
class
ManweActivateAfterImport
(
root
:
Configurable
,
imported
:
ManweSamplesImport
)
extends
ManweSamplesActivate
(
root
)
{
override
def
beforeGraph
:
Unit
=
{
super
.
beforeGraph
require
(
annotate
!=
null
,
"Annotate should be defined"
)
require
(
imported
!=
null
,
"Imported should be defined"
)
this
.
deps
:+=
annotate
.
jobOutputFile
this
.
deps
:+=
imported
.
jobOutputFile
}
...
...
toucan/src/main/scala/nl/lumc/sasc/biopet/pipelines/toucan/Toucan.scala
View file @
0cc8ef3d
...
...
@@ -170,11 +170,11 @@ class Toucan(val parent: Configurable) extends QScript with BiopetQScript with S
* @param sampleID the sampleID to be used
* @param inputVcf the input VCF
* @param gVCF the gVCF for coverage
* @param annotation: ManweDownloadAnnotateVcf object of annotated vcf
* @param annotation:
Optional
ManweDownloadAnnotateVcf object of annotated vcf
* @return
*/
def
importAndActivateSample
(
sampleID
:
String
,
sampleGroups
:
List
[
String
],
inputVcf
:
File
,
gVCF
:
File
,
annotation
:
ManweAnnotateVcf
)
:
ManweActivateAfterAnnot
Import
=
{
gVCF
:
File
,
annotation
:
Option
[
ManweAnnotateVcf
])
:
ManweActivateAfter
Import
=
{
val
minGQ
:
Int
=
config
(
"minimum_genome_quality"
,
default
=
20
,
namespace
=
"manwe"
)
val
isPublic
:
Boolean
=
config
(
"varda_is_public"
,
default
=
true
,
namespace
=
"manwe"
)
...
...
@@ -228,7 +228,8 @@ class Toucan(val parent: Configurable) extends QScript with BiopetQScript with S
imported
.
output
=
swapExt
(
outputDir
,
intersected
.
output
,
".vcf.gz"
,
".manwe.import"
)
add
(
imported
)
val
active
=
new
ManweActivateAfterAnnotImport
(
this
,
annotation
,
imported
)
val
active
=
new
ManweActivateAfterImport
(
this
,
imported
)
annotation
.
foreach
(
a
=>
active
.
deps
:+=
a
.
jobOutputFile
)
active
.
output
=
swapExt
(
outputDir
,
imported
.
output
,
".import"
,
".activated"
)
add
(
active
)
active
...
...
@@ -236,7 +237,7 @@ class Toucan(val parent: Configurable) extends QScript with BiopetQScript with S
}
/**
*
Perform varda analysis
*
Import to and optionally annotate with varda
*
* @param vcf input vcf
* @param gVcf The gVCF to be used for coverage calculations
...
...
@@ -245,7 +246,23 @@ class Toucan(val parent: Configurable) extends QScript with BiopetQScript with S
def
varda
(
vcf
:
File
,
gVcf
:
File
)
:
File
=
{
val
annotationQueries
:
List
[
String
]
=
config
(
"annotation_queries"
,
default
=
List
(
"GLOBAL *"
),
namespace
=
"manwe"
)
val
doAnnotate
:
Boolean
=
config
(
"annotate"
,
namespace
=
"varda"
,
default
=
true
)
val
sampleGroups
=
sampleInfo
map
{
x
=>
val
maybeSampleGroup
=
x
.
_2
.
get
(
"varda_group"
)
match
{
case
None
=>
Some
(
Nil
)
case
Some
(
vals
)
=>
vals
match
{
case
xs
:
List
[
_
]
=>
xs
.
traverse
[
Option
,
String
]
{
x
=>
Option
(
x
.
toString
).
filter
(
_
==
x
)
}
case
otherwise
=>
None
}
}
val
sampleGroup
=
maybeSampleGroup
.
getOrElse
(
throw
new
IllegalArgumentException
(
"Sample tag 'varda_group' is not a list of strings"
))
x
.
_1
->
sampleGroup
}
if
(
doAnnotate
)
{
val
annotate
=
new
ManweAnnotateVcf
(
this
)
annotate
.
vcf
=
vcf
if
(
annotationQueries
.
nonEmpty
)
{
...
...
@@ -260,18 +277,8 @@ class Toucan(val parent: Configurable) extends QScript with BiopetQScript with S
annotatedVcf
.
output
=
swapExt
(
outputDir
,
annotate
.
output
,
".manwe.annot"
,
"manwe.annot.vcf.gz"
)
add
(
annotatedVcf
)
val
activates
=
sampleInfo
map
{
x
=>
val
maybeSampleGroup
=
x
.
_2
.
get
(
"varda_group"
)
match
{
case
None
=>
Some
(
Nil
)
case
Some
(
vals
)
=>
vals
match
{
case
xs
:
List
[
_
]
=>
xs
.
traverse
[
Option
,
String
]
{
x
=>
Option
(
x
.
toString
).
filter
(
_
==
x
)
}
case
otherwise
=>
None
}
}
val
sampleGroup
=
maybeSampleGroup
.
getOrElse
(
throw
new
IllegalArgumentException
(
"Sample tag 'varda_group' is not a list of strings"
))
importAndActivateSample
(
x
.
_1
,
sampleGroup
,
vcf
,
gVcf
,
annotate
)
val
activates
=
sampleGroups
map
{
x
=>
importAndActivateSample
(
x
.
_1
,
x
.
_2
,
vcf
,
gVcf
,
Some
(
annotate
))
}
val
finalLn
=
new
Ln
(
this
)
...
...
@@ -282,6 +289,12 @@ class Toucan(val parent: Configurable) extends QScript with BiopetQScript with S
add
(
finalLn
)
finalLn
.
output
}
else
{
sampleGroups
.
foreach
{
x
=>
importAndActivateSample
(
x
.
_1
,
x
.
_2
,
vcf
,
gVcf
,
None
)
}
vcf
}
}
def
summaryFiles
=
Map
(
"input_vcf"
->
inputVcf
,
"outputVcf"
->
outputVcf
)
...
...
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