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
3ce22c45
Commit
3ce22c45
authored
10 years ago
by
Peter van 't Hof
Browse files
Options
Downloads
Patches
Plain Diff
Added queue wrapper
parent
9c0409f6
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/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfStats.scala
+20
-7
20 additions, 7 deletions
...k/src/main/scala/nl/lumc/sasc/biopet/tools/VcfStats.scala
with
20 additions
and
7 deletions
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VcfStats.scala
+
20
−
7
View file @
3ce22c45
...
...
@@ -4,20 +4,33 @@ import java.io.{ FileOutputStream, PrintWriter, File }
import
htsjdk.variant.variantcontext.
{
VariantContext
,
Genotype
}
import
htsjdk.variant.vcf.VCFFileReader
import
nl.lumc.sasc.biopet.core.ToolCommand
import
org.broadinstitute.gatk.utils.R.RScriptExecutor
import
org.broadinstitute.gatk.utils.
io.Resource
import
nl.lumc.sasc.biopet.core.
{
BiopetJavaCommandLineFunction
,
ToolCommand
}
import
nl.lumc.sasc.biopet.core.config.Configurable
import
org.broadinstitute.gatk.utils.
commandline.
{
Output
,
Input
}
import
scala.collection.JavaConversions._
import
scala.collection.mutable
import
scala.sys.process.
{
Process
,
ProcessLogger
}
import
scala.util.matching.Regex
import
htsjdk.samtools.util.Interval
/**
* Created by pjvan_thof on 1/10/15.
*/
class
VcfStats
{
//TODO: add Queue wrapper
class
VcfStats
(
val
root
:
Configurable
)
extends
BiopetJavaCommandLineFunction
{
javaMainClass
=
getClass
.
getName
@Input
(
doc
=
"Input fastq"
,
shortName
=
"I"
,
required
=
true
)
var
input
:
File
=
_
@Output
(
doc
=
"Output fastq"
,
shortName
=
"o"
,
required
=
true
)
var
output
:
File
=
_
/**
* Creates command to execute extension
* @return
*/
override
def
commandLine
=
super
.
commandLine
+
required
(
"-I"
,
input
)
+
required
(
"-o"
,
output
)
}
object
VcfStats
extends
ToolCommand
{
...
...
@@ -244,7 +257,7 @@ object VcfStats extends ToolCommand {
val
file
=
new
File
(
prefix
+
field
+
".tsv"
)
file
.
getParentFile
.
mkdirs
()
val
writer
=
new
PrintWriter
(
file
)
writer
.
println
(
samples
.
mkString
(
field
+
"\t"
,
"\t"
,
""
))
writer
.
println
(
samples
.
mkString
(
field
+
"\t"
,
"\t"
,
""
))
val
keySet
=
(
for
(
sample
<-
samples
)
yield
stats
.
samplesStats
(
sample
).
genotypeStats
.
getOrElse
(
field
,
Map
[
Any
,
Int
]()).
keySet
).
fold
(
Set
[
Any
]())(
_
++
_
)
for
(
key
<-
keySet
.
toList
.
sortWith
(
sortAnyAny
(
_
,
_
)))
{
val
values
=
for
(
sample
<-
samples
)
yield
stats
.
samplesStats
(
sample
).
genotypeStats
.
getOrElse
(
field
,
Map
[
Any
,
Int
]()).
getOrElse
(
key
,
0
)
...
...
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