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
6b55bbde
Commit
6b55bbde
authored
Apr 04, 2016
by
Wai Yi Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding CleverFixVCF to add headers and fix the samplename in vcf output
parent
a4c98adb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
136 additions
and
14 deletions
+136
-14
public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/breakdancer/BreakdancerVCF.scala
...c/sasc/biopet/extensions/breakdancer/BreakdancerVCF.scala
+2
-2
public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/clever/CleverCaller.scala
.../nl/lumc/sasc/biopet/extensions/clever/CleverCaller.scala
+9
-9
public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/clever/CleverFixVCF.scala
.../nl/lumc/sasc/biopet/extensions/clever/CleverFixVCF.scala
+116
-0
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/svcallers/Breakdancer.scala
...c/sasc/biopet/pipelines/shiva/svcallers/Breakdancer.scala
+1
-1
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/svcallers/Clever.scala
...l/lumc/sasc/biopet/pipelines/shiva/svcallers/Clever.scala
+8
-2
No files found.
public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/breakdancer/BreakdancerVCF.scala
View file @
6b55bbde
...
...
@@ -30,13 +30,13 @@ class BreakdancerVCF(val root: Configurable) extends PythonCommandLineFunction {
@Output
(
doc
=
"Output VCF to PATH"
)
var
output
:
File
=
_
@Argument
(
doc
=
"Samplename"
)
@Argument
(
doc
=
"Samplename"
)
var
sample
:
String
=
_
def
cmdLine
=
{
getPythonCommand
+
"-i "
+
required
(
input
)
+
"-o "
+
required
(
output
)+
"-o "
+
required
(
output
)
+
"-s "
+
required
(
sample
)
}
}
...
...
public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/clever/CleverCaller.scala
View file @
6b55bbde
...
...
@@ -17,9 +17,9 @@ package nl.lumc.sasc.biopet.extensions.clever
import
java.io.File
import
nl.lumc.sasc.biopet.core.
{
Version
,
Reference
,
BiopetCommandLineFunct
ion
}
import
nl.lumc.sasc.biopet.core.
{
BiopetCommandLineFunction
,
Reference
,
Vers
ion
}
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Argument
,
Input
,
Output
}
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
class
CleverCaller
(
val
root
:
Configurable
)
extends
BiopetCommandLineFunction
with
Reference
with
Version
{
executable
=
config
(
"exe"
,
default
=
"clever"
)
...
...
@@ -39,17 +39,17 @@ class CleverCaller(val root: Configurable) extends BiopetCommandLineFunction wit
@Input
(
doc
=
"Reference"
)
var
reference
:
File
=
_
protected
def
workDir
:
File
=
new
File
(
cwd
,
"work"
)
var
c
wd
:
File
=
_
protected
def
cleverOutputDir
:
File
=
new
File
(
cleverWorkDir
,
"work"
)
var
c
leverWorkDir
:
File
=
_
@Output
(
doc
=
"Clever VCF output"
)
lazy
val
outputvcf
:
File
=
{
new
File
(
c
wd
,
"predictions.vcf"
)
new
File
(
c
leverOutputDir
,
"predictions.vcf"
)
}
@Output
(
doc
=
"Clever raw output"
)
lazy
val
outputraw
:
File
=
{
new
File
(
work
Dir
,
"predictions.raw.txt"
)
new
File
(
cleverOutput
Dir
,
"predictions.raw.txt"
)
}
// var T: Option[Int] = config("T", default = defaultThreads)
...
...
@@ -61,7 +61,7 @@ class CleverCaller(val root: Configurable) extends BiopetCommandLineFunction wit
override
def
beforeGraph
()
{
super
.
beforeGraph
()
if
(
work
Dir
==
null
)
throw
new
Exception
(
"Clever :: Workdirectory is not defined"
)
if
(
cleverOutput
Dir
==
null
)
throw
new
Exception
(
"Clever :: Workdirectory is not defined"
)
if
(
reference
==
null
)
reference
=
referenceFasta
()
}
...
...
@@ -75,14 +75,14 @@ class CleverCaller(val root: Configurable) extends BiopetCommandLineFunction wit
conditional
(
r
,
"-r"
)
+
required
(
input
)
+
required
(
reference
)
+
required
(
work
Dir
)
required
(
cleverOutput
Dir
)
}
object
CleverCaller
{
def
apply
(
root
:
Configurable
,
input
:
File
,
svDir
:
File
)
:
CleverCaller
=
{
val
clever
=
new
CleverCaller
(
root
)
clever
.
input
=
input
clever
.
c
wd
=
svDir
clever
.
c
leverWorkDir
=
svDir
clever
}
}
\ No newline at end of file
public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/clever/CleverFixVCF.scala
0 → 100644
View file @
6b55bbde
package
nl.lumc.sasc.biopet.extensions.clever
/**
* Created by wyleung on 4-4-16.
*/
import
java.io.
{
File
,
PrintWriter
}
import
nl.lumc.sasc.biopet.core.BiopetJavaCommandLineFunction
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
nl.lumc.sasc.biopet.utils.
{
ToolCommand
}
import
org.broadinstitute.gatk.utils.commandline.
{
Argument
,
Input
,
Output
}
import
scala.io.Source
class
CleverFixVCF
(
val
root
:
Configurable
)
extends
BiopetJavaCommandLineFunction
{
javaMainClass
=
getClass
.
getName
@Input
(
doc
=
"Input Clever VCF"
)
var
input
:
File
=
_
@Output
(
doc
=
"Output fixed VCF"
)
var
output
:
File
=
_
@Argument
(
doc
=
"Samplename"
)
var
sampleName
:
String
=
_
override
def
cmdLine
=
super
.
cmdLine
+
required
(
"-i"
,
input
)
+
required
(
"-o"
,
output
)
+
required
(
"-s"
,
sampleName
)
}
object
CleverFixVCF
extends
ToolCommand
{
case
class
Args
(
inputVCF
:
File
=
null
,
sampleLabel
:
String
=
""
,
outputVCF
:
File
=
null
)
extends
AbstractArgs
class
OptParser
extends
AbstractOptParser
{
opt
[
File
](
'i'
,
"inputvcf"
)
required
()
valueName
"<vcffile/path>"
action
{
(
x
,
c
)
=>
c
.
copy
(
inputVCF
=
x
)
}
text
"Please specify the input Clever VCF file"
opt
[
String
](
's'
,
"samplelabel"
)
valueName
"<sample label>"
action
{
(
x
,
c
)
=>
c
.
copy
(
sampleLabel
=
x
)
}
text
"Sample label is missing"
opt
[
File
](
'o'
,
"outputvcf"
)
valueName
"<output>"
action
{
(
x
,
c
)
=>
c
.
copy
(
outputVCF
=
x
)
}
text
"Output path is missing"
}
/**
* @param args the command line arguments
*/
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
sys
.
exit
(
1
)
val
input
:
File
=
commandArgs
.
inputVCF
val
output
:
File
=
commandArgs
.
outputVCF
val
vcfColHeader
=
"#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tdefault"
val
vcfColReplacementHeader
=
s
"#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\t${commandArgs.sampleLabel}"
val
extraHeader
=
"""##INFO=<ID=NS,Number=1,Type=Integer,Description="Number of Samples With Data">
##INFO=<ID=DP,Number=1,Type=Integer,Description="Total Depth">
##INFO=<ID=AF,Number=A,Type=Float,Description="Allele Frequency">
##INFO=<ID=IMPRECISE,Number=0,Type=Flag,Description="Imprecise structural variation">
##INFO=<ID=NOVEL,Number=0,Type=Flag,Description="Indicates a novel structural variation">
##INFO=<ID=SVEND,Number=1,Type=Integer,Description="End position of the variant described in this record">
##INFO=<ID=END,Number=1,Type=Integer,Description="End position of the variant described in this record">
##INFO=<ID=SVTYPE,Number=1,Type=String,Description="Type of structural variant">
##INFO=<ID=SVLEN,Number=.,Type=Integer,Description="Difference in length between REF and ALT alleles">
##INFO=<ID=CIPOS,Number=2,Type=Integer,Description="Confidence interval around POS for imprecise variants">
##INFO=<ID=CIEND,Number=2,Type=Integer,Description="Confidence interval around END for imprecise variants">
##INFO=<ID=HOMLEN,Number=.,Type=Integer,Description="Length of base pair identical micro-homology at event breakpoints">
##INFO=<ID=HOMSEQ,Number=.,Type=String,Description="Sequence of base pair identical micro-homology at event breakpoints">
##INFO=<ID=BKPTID,Number=.,Type=String,Description="ID of the assembled alternate allele in the assembly file">
##INFO=<ID=MEINFO,Number=4,Type=String,Description="Mobile element info of the form NAME,START,END,POLARITY">
##INFO=<ID=METRANS,Number=4,Type=String,Description="Mobile element transduction info of the form CHR,START,END,POLARITY">
##INFO=<ID=DGVID,Number=1,Type=String,Description="ID of this element in Database of Genomic Variation">
##INFO=<ID=DBVARID,Number=1,Type=String,Description="ID of this element in DBVAR">
##INFO=<ID=DBRIPID,Number=1,Type=String,Description="ID of this element in DBRIP">
##INFO=<ID=MATEID,Number=.,Type=String,Description="ID of mate breakends">
##INFO=<ID=PARID,Number=1,Type=String,Description="ID of partner breakend">
##INFO=<ID=EVENT,Number=1,Type=String,Description="ID of event associated to breakend">
##INFO=<ID=CILEN,Number=2,Type=Integer,Description="Confidence interval around the inserted material between breakends">
##INFO=<ID=DP,Number=1,Type=Integer,Description="Read Depth of segment containing breakend">
##INFO=<ID=DPADJ,Number=.,Type=Integer,Description="Read Depth of adjacency">
##INFO=<ID=CN,Number=1,Type=Integer,Description="Copy number of segment containing breakend">
##INFO=<ID=CNADJ,Number=.,Type=Integer,Description="Copy number of adjacency">
##INFO=<ID=CICN,Number=2,Type=Integer,Description="Confidence interval around copy number for the segment">
##INFO=<ID=CICNADJ,Number=.,Type=Integer,Description="Confidence interval around copy number for the adjacency">
##FORMAT=<ID=CN,Number=1,Type=Integer,Description="Copy number genotype for imprecise events">
##FORMAT=<ID=CNQ,Number=1,Type=Float,Description="Copy number genotype quality for imprecise events">
##FORMAT=<ID=CNL,Number=.,Type=Float,Description="Copy number genotype likelihood for imprecise events">
##FORMAT=<ID=NQ,Number=1,Type=Integer,Description="Phred style probability score that the variant is novel">
##FORMAT=<ID=HAP,Number=1,Type=Integer,Description="Unique haplotype identifier">
##FORMAT=<ID=AHAP,Number=1,Type=Integer,Description="Unique identifier of ancestral haplotype">
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
##FORMAT=<ID=GQ,Number=1,Type=Integer,Description="Genotype Quality">
##FORMAT=<ID=DP,Number=1,Type=Integer,Description="Read Depth">"""
val
inputVCF
=
Source
.
fromFile
(
input
)
val
writer
=
new
PrintWriter
(
output
)
for
(
line
<-
inputVCF
.
getLines
())
{
(
line
==
vcfColHeader
)
match
{
case
true
=>
{
writer
.
write
(
extraHeader
+
"\n"
)
writer
.
write
(
vcfColReplacementHeader
+
"\n"
)
}
case
_
=>
writer
.
write
(
line
+
"\n"
)
}
}
writer
.
close
()
inputVCF
.
close
()
}
}
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/svcallers/Breakdancer.scala
View file @
6b55bbde
...
...
@@ -32,7 +32,7 @@ class Breakdancer(val root: Configurable) extends SvCaller {
val
bdcfg
=
BreakdancerConfig
(
this
,
bamFile
,
new
File
(
breakdancerSampleDir
,
sample
+
".breakdancer.cfg"
))
val
breakdancer
=
BreakdancerCaller
(
this
,
bdcfg
.
output
,
new
File
(
breakdancerSampleDir
,
sample
+
".breakdancer.tsv"
))
val
bdvcf
=
BreakdancerVCF
(
this
,
breakdancer
.
output
,
new
File
(
breakdancerSampleDir
,
sample
+
".breakdancer.vcf"
),
sample
=
sample
)
sample
=
sample
)
add
(
bdcfg
,
breakdancer
,
bdvcf
)
addVCF
(
sample
,
bdvcf
.
output
)
...
...
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/svcallers/Clever.scala
View file @
6b55bbde
...
...
@@ -15,7 +15,7 @@
*/
package
nl.lumc.sasc.biopet.pipelines.shiva.svcallers
import
nl.lumc.sasc.biopet.extensions.clever.
CleverCaller
import
nl.lumc.sasc.biopet.extensions.clever.
{
CleverCaller
,
CleverFixVCF
}
import
nl.lumc.sasc.biopet.utils.config.Configurable
/** Script for sv caler Clever */
...
...
@@ -29,7 +29,13 @@ class Clever(val root: Configurable) extends SvCaller {
val
clever
=
CleverCaller
(
this
,
bamFile
,
cleverDir
)
add
(
clever
)
addVCF
(
sample
,
clever
.
outputvcf
)
val
cleverVCF
=
new
CleverFixVCF
(
this
)
cleverVCF
.
input
=
clever
.
outputvcf
cleverVCF
.
output
=
new
File
(
cleverDir
,
s
"${sample}.clever.vcf"
)
cleverVCF
.
sampleName
=
sample
add
(
cleverVCF
)
addVCF
(
sample
,
cleverVCF
.
output
)
}
}
}
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