Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
biopet.biopet
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
biopet.biopet
Commits
0f8dafb1
Commit
0f8dafb1
authored
9 years ago
by
Peter van 't Hof
Browse files
Options
Downloads
Patches
Plain Diff
Tests
parent
c774f02c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/gwas-test/src/main/scala/nl/lumc/sasc/biopet/pipelines/gwastest/GwasTest.scala
+18
-10
18 additions, 10 deletions
...ala/nl/lumc/sasc/biopet/pipelines/gwastest/GwasTest.scala
with
18 additions
and
10 deletions
public/gwas-test/src/main/scala/nl/lumc/sasc/biopet/pipelines/gwastest/GwasTest.scala
+
18
−
10
View file @
0f8dafb1
package
nl.lumc.sasc.biopet.pipelines.gwastest
package
nl.lumc.sasc.biopet.pipelines.gwastest
import
java.io.File
import
java.io.File
import
java.util
import
nl.lumc.sasc.biopet.core.
{
PipelineCommand
,
Reference
,
BiopetQScript
}
import
nl.lumc.sasc.biopet.core.
{
PipelineCommand
,
Reference
,
BiopetQScript
}
import
nl.lumc.sasc.biopet.extensions.gatk.
{
SelectVariants
,
CombineVariants
}
import
nl.lumc.sasc.biopet.extensions.gatk.
{
SelectVariants
,
CombineVariants
}
...
@@ -9,29 +10,36 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
...
@@ -9,29 +10,36 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
import
nl.lumc.sasc.biopet.utils.intervals.BedRecordList
import
nl.lumc.sasc.biopet.utils.intervals.BedRecordList
import
org.broadinstitute.gatk.queue.QScript
import
org.broadinstitute.gatk.queue.QScript
import
scala.collection.JavaConversions._
/**
/**
* Created by pjvanthof on 16/03/16.
* Created by pjvanthof on 16/03/16.
*/
*/
class
GwasTest
(
val
root
:
Configurable
)
extends
QScript
with
BiopetQScript
with
Reference
{
class
GwasTest
(
val
root
:
Configurable
)
extends
QScript
with
BiopetQScript
with
Reference
{
def
this
()
=
this
(
null
)
def
this
()
=
this
(
null
)
lazy
val
inputVcf
:
Option
[
File
]
=
config
(
"input_vcf"
)
val
inputVcf
:
Option
[
File
]
=
config
(
"input_vcf"
)
lazy
val
phenotypeFile
:
File
=
config
(
"phenotype_file"
)
val
phenotypeFile
:
File
=
config
(
"phenotype_file"
)
case
class
GensInput
(
genotypes
:
File
,
info
:
Option
[
File
],
contig
:
String
)
case
class
GensInput
(
genotypes
:
File
,
info
:
Option
[
File
],
contig
:
String
)
lazy
val
inputGens
:
Option
[
List
[
GensInput
]]
=
if
(
inputVcf
.
isDefined
)
None
val
inputBlaGens
:
List
[
GensInput
]
=
if
(
inputVcf
.
isDefined
)
List
[
GensInput
]()
else
{
else
{
if
(
config
.
contains
(
"input_gens"
))
{
println
(
"blabla"
)
val
gens
:
List
[
Any
]
=
configValue2list
(
config
(
"input_gens"
))
config
(
"input_gens"
,
default
=
Nil
).
asList
.
map
(
x
=>
x
match
{
Some
(
gens
.
map
{
case
value
:
Map
[
String
,
Any
]
=>
case
value
:
Map
[
String
,
Any
]
=>
GensInput
(
new
File
(
value
(
"genotypes"
).
toString
),
GensInput
(
new
File
(
value
(
"genotypes"
).
toString
),
value
.
get
(
"info"
).
map
(
x
=>
new
File
(
x
.
toString
)),
value
.
get
(
"info"
).
map
(
x
=>
new
File
(
x
.
toString
)),
value
(
"contig"
).
toString
)
value
(
"contig"
).
toString
)
case
value
:
util.LinkedHashMap
[
_
,
_
]
=>
GensInput
(
new
File
(
value
(
"genotypes"
).
toString
),
value
.
toMap
.
get
(
"info"
).
map
(
x
=>
new
File
(
x
.
toString
)),
value
(
"contig"
).
toString
)
case
_
=>
throw
new
IllegalArgumentException
})
})
}
else
None
List
[
GensInput
]()
}
}
/** Init for pipeline */
/** Init for pipeline */
def
init
()
:
Unit
=
{
def
init
()
:
Unit
=
{
...
@@ -40,12 +48,12 @@ class GwasTest(val root: Configurable) extends QScript with BiopetQScript with R
...
@@ -40,12 +48,12 @@ class GwasTest(val root: Configurable) extends QScript with BiopetQScript with R
/** Pipeline itself */
/** Pipeline itself */
def
biopetScript
()
:
Unit
=
{
def
biopetScript
()
:
Unit
=
{
val
vcfFile
:
File
=
inputVcf
.
getOrElse
{
val
vcfFile
:
File
=
inputVcf
.
getOrElse
{
val
gens
=
inputGens
.
getOrElse
(
throw
new
IllegalArgumentException
(
"No vcf file or gens files defined in config"
)
)
require
(
input
Bla
Gens
.
nonEmpty
,
"No vcf file or gens files defined in config"
)
val
outputDirGens
=
new
File
(
outputDir
,
"gens_to_vcf"
)
val
outputDirGens
=
new
File
(
outputDir
,
"gens_to_vcf"
)
val
cv
=
new
CombineVariants
(
this
)
val
cv
=
new
CombineVariants
(
this
)
cv
.
outputFile
=
new
File
(
outputDirGens
,
"merge.gens.vcf.gz"
)
cv
.
outputFile
=
new
File
(
outputDirGens
,
"merge.gens.vcf.gz"
)
cv
.
setKey
=
"null"
cv
.
setKey
=
"null"
g
ens
.
foreach
{
gen
=>
inputBlaG
ens
.
foreach
{
gen
=>
val
gensToVcf
=
new
GensToVcf
(
this
)
val
gensToVcf
=
new
GensToVcf
(
this
)
gensToVcf
.
inputGens
=
gen
.
genotypes
gensToVcf
.
inputGens
=
gen
.
genotypes
gensToVcf
.
inputInfo
=
gen
.
info
gensToVcf
.
inputInfo
=
gen
.
info
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment