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
172a5c94
Commit
172a5c94
authored
Nov 24, 2016
by
Sander Bollen
Browse files
write xcnv to bed tool
parent
53da62be
Changes
2
Hide whitespace changes
Inline
Side-by-side
biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/DepthOfCoverage.scala
View file @
172a5c94
...
...
@@ -20,42 +20,42 @@ class DepthOfCoverage(val root: Configurable) extends CommandLineGATK {
@Output
lazy
val
summaryFile
:
File
=
{
new
File
(
out
+
"_summary"
)
new
File
(
out
+
"
.sample
_summary"
)
}
@Output
lazy
val
statisticsFile
:
File
=
{
new
File
(
out
+
"_statistics"
)
new
File
(
out
+
"
.sample
_statistics"
)
}
@Output
lazy
val
intervalSummaryFile
:
File
=
{
new
File
(
out
+
"_interval_summary"
)
new
File
(
out
+
"
.sample
_interval_summary"
)
}
@Output
lazy
val
intervalStatisticsFile
:
File
=
{
new
File
(
out
+
"_interval_statistics"
)
new
File
(
out
+
"
.sample
_interval_statistics"
)
}
@Output
lazy
val
geneSummaryFile
:
File
=
{
new
File
(
out
+
"_gene_summary"
)
new
File
(
out
+
"
.sample
_gene_summary"
)
}
@Output
lazy
val
geneStatisticsFile
:
File
=
{
new
File
(
out
+
"_gene_statistics"
)
new
File
(
out
+
"
.sample
_gene_statistics"
)
}
@Output
lazy
val
cumulativeCoverageCountsFile
:
File
=
{
new
File
(
out
+
"_cumulative_coverage_counts"
)
new
File
(
out
+
"
.sample
_cumulative_coverage_counts"
)
}
@Output
lazy
val
cumulativeCoverageProportionsFile
:
File
=
{
new
File
(
out
+
"_cumulative_coverage_proportions"
)
new
File
(
out
+
"
.sample
_cumulative_coverage_proportions"
)
}
@Argument
(
required
=
false
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/XcnvToBed.scala
0 → 100644
View file @
172a5c94
package
nl.lumc.sasc.biopet.tools
import
java.io.
{
BufferedWriter
,
File
,
FileWriter
}
import
nl.lumc.sasc.biopet.tools.VepNormalizer.Args
import
nl.lumc.sasc.biopet.utils.ToolCommand
import
scala.io.Source
/**
* Created by Sander Bollen on 24-11-16.
*/
object
XcnvToBed
extends
ToolCommand
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
commandArgs
:
Args
=
new
OptParser
()
.
parse
(
args
,
Args
())
.
getOrElse
(
throw
new
IllegalArgumentException
)
val
writer
=
new
BufferedWriter
(
new
FileWriter
(
commandArgs
.
outputBed
))
Source
.
fromFile
(
commandArgs
.
inputXcnv
).
getLines
().
filter
(!
_
.
startsWith
(
"SAMPLE"
)).
map
(
x
=>
x
.
split
(
"\t"
)).
map
(
x
=>
XcnvBedLine
(
x
(
0
),
x
(
1
),
x
(
2
))).
filter
(
_
.
sample
==
commandArgs
.
sample
).
foreach
(
x
=>
writer
.
write
(
x
.
toString
))
}
case
class
XcnvBedLine
(
sample
:
String
,
cnvType
:
String
,
location
:
String
)
{
override
def
toString
:
String
=
{
val
cnv
=
if
(
cnvType
==
"DEL"
)
{
-
1
}
else
if
(
cnvType
==
"DUP"
)
{
1
}
else
0
val
locs
=
location
.
split
(
":"
)
val
chr
=
locs
(
0
)
val
start
=
locs
(
1
).
split
(
"-"
)(
0
)
val
stop
=
locs
(
1
).
split
(
"-"
)(
1
)
s
"$chr\t$start\t$stop\t$cnv"
}
}
case
class
Args
(
inputXcnv
:
File
=
null
,
outputBed
:
File
=
null
,
sample
:
String
=
null
)
extends
AbstractArgs
class
OptParser
extends
AbstractOptParser
{
head
(
"Convert a sample track within an XHMM XCNV file to a BED track. Fourt column indicates deletion (-1), normal (0) or duplication (1) of region"
)
opt
[
File
](
'I'
,
"Input"
)
required
()
valueName
"<xcnv>"
action
{
(
x
,
c
)
=>
c
.
copy
(
inputXcnv
=
x
)
}
validate
{
x
=>
if
(
x
.
exists
)
success
else
failure
(
"Input XCNV not found"
)
}
text
{
"Input XCNV file"
}
opt
[
File
](
'O'
,
"Output"
)
required
()
valueName
"<bed>"
action
{
(
x
,
c
)
=>
c
.
copy
(
outputBed
=
x
)
}
text
{
"Output BED file"
}
opt
[
String
](
'S'
,
"Sample"
)
required
()
action
{
(
x
,
c
)
=>
c
.
copy
(
sample
=
x
)
}
text
{
"The sample which to select"
}
}
}
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