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
18e22c1b
Commit
18e22c1b
authored
Oct 23, 2015
by
Peter van 't Hof
Browse files
Added GenotypeConcordance to shiva
parent
05bff3ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/GenotypeConcordance.scala
View file @
18e22c1b
...
...
@@ -20,7 +20,7 @@ import java.io.File
import
nl.lumc.sasc.biopet.core.summary.Summarizable
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
org.broadinstitute.gatk.utils.report.
{
GATKReportTable
,
GATKReport
}
import
org.broadinstitute.gatk.utils.report.
{
GATKReportTable
,
GATKReport
}
/**
* Extension for CombineVariants from GATK
...
...
@@ -54,8 +54,7 @@ class GenotypeConcordance(val root: Configurable) extends Gatk with Summarizable
val
samples
=
for
(
i
<-
0
until
genotypeSummary
.
getNumRows
)
yield
genotypeSummary
.
get
(
i
,
"Sample"
).
toString
def
getMap
(
table
:
GATKReportTable
,
column
:
String
)
=
samples
.
distinct
.
map
(
sample
=>
sample
->
{
(
for
(
i
<-
0
until
table
.
getNumRows
if
table
.
get
(
i
,
"Sample"
)
==
sample
)
yield
s
"${table.get(i, "
Eval_Genotype
")}__${table.get(i, "
Comp_Genotype
")}"
->
table
.
get
(
i
,
column
)).
toMap
(
for
(
i
<-
0
until
table
.
getNumRows
if
table
.
get
(
i
,
"Sample"
)
==
sample
)
yield
s
"${table.get(i, "
Eval_Genotype
")}__${table.get(i, "
Comp_Genotype
")}"
->
table
.
get
(
i
,
column
)).
toMap
}).
toMap
Map
(
...
...
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcallingTrait.scala
View file @
18e22c1b
...
...
@@ -20,7 +20,7 @@ import java.io.File
import
nl.lumc.sasc.biopet.core.summary.SummaryQScript
import
nl.lumc.sasc.biopet.core.
{
Reference
,
SampleLibraryTag
}
import
nl.lumc.sasc.biopet.extensions.bcftools.
{
BcftoolsCall
,
BcftoolsMerge
}
import
nl.lumc.sasc.biopet.extensions.gatk.CombineVariants
import
nl.lumc.sasc.biopet.extensions.gatk.
{
GenotypeConcordance
,
CombineVariants
}
import
nl.lumc.sasc.biopet.extensions.samtools.SamtoolsMpileup
import
nl.lumc.sasc.biopet.extensions.tools.
{
MpileupToVcf
,
VcfFilter
,
VcfStats
}
import
nl.lumc.sasc.biopet.extensions.
{
Bgzip
,
Tabix
}
...
...
@@ -38,6 +38,10 @@ trait ShivaVariantcallingTrait extends SummaryQScript with SampleLibraryTag with
@Input
(
doc
=
"Bam files (should be deduped bams)"
,
shortName
=
"BAM"
,
required
=
true
)
var
inputBams
:
List
[
File
]
=
Nil
var
referenceVcf
:
Option
[
File
]
=
config
(
"reference_vcf"
)
var
referenceVcfRegions
:
Option
[
File
]
=
config
(
"reference_vcf_regions"
)
/** Name prefix, can override this methods if neeeded */
def
namePrefix
:
String
=
{
(
sampleId
,
libId
)
match
{
...
...
@@ -85,6 +89,16 @@ trait ShivaVariantcallingTrait extends SummaryQScript with SampleLibraryTag with
vcfStats
.
setOutputDir
(
new
File
(
caller
.
outputDir
,
"vcfstats"
))
add
(
vcfStats
)
addSummarizable
(
vcfStats
,
namePrefix
+
"-vcfstats-"
+
caller
.
name
)
referenceVcf
.
foreach
(
referenceVcfFile
=>
{
val
gc
=
new
GenotypeConcordance
(
this
)
gc
.
evalFile
=
caller
.
outputFile
gc
.
compFile
=
referenceVcfFile
gc
.
outputFile
=
new
File
(
caller
.
outputDir
,
s
"$namePrefix-genotype_concordance.${caller.name}.txt"
)
referenceVcfRegions
.
foreach
(
gc
.
intervals
::=
_
)
add
(
gc
)
addSummarizable
(
gc
,
s
"$namePrefix-genotype_concordance_${caller.name}"
)
})
}
add
(
cv
)
...
...
@@ -95,6 +109,16 @@ trait ShivaVariantcallingTrait extends SummaryQScript with SampleLibraryTag with
add
(
vcfStats
)
addSummarizable
(
vcfStats
,
namePrefix
+
"-vcfstats-final"
)
referenceVcf
.
foreach
(
referenceVcfFile
=>
{
val
gc
=
new
GenotypeConcordance
(
this
)
gc
.
evalFile
=
finalFile
gc
.
compFile
=
referenceVcfFile
gc
.
outputFile
=
new
File
(
outputDir
,
s
"$namePrefix-genotype_concordance.final.txt"
)
referenceVcfRegions
.
foreach
(
gc
.
intervals
::=
_
)
add
(
gc
)
addSummarizable
(
gc
,
s
"$namePrefix-genotype_concordance_final"
)
})
addSummaryJobs
()
}
...
...
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