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
bde80bda
Commit
bde80bda
authored
Feb 26, 2015
by
Peter van 't Hof
Browse files
Add automatic sample detection
parent
6362081c
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/MpileupToVcf.scala
View file @
bde80bda
...
...
@@ -17,6 +17,7 @@ package nl.lumc.sasc.biopet.tools
import
java.io.File
import
java.io.PrintWriter
import
htsjdk.samtools.SamReaderFactory
import
nl.lumc.sasc.biopet.core.BiopetJavaCommandLineFunction
import
nl.lumc.sasc.biopet.core.ToolCommand
import
nl.lumc.sasc.biopet.core.config.Configurable
...
...
@@ -59,6 +60,16 @@ class MpileupToVcf(val root: Configurable) extends BiopetJavaCommandLineFunction
val
samtoolsMpileup
=
new
SamtoolsMpileup
(
this
)
}
override
def
beforeCmd
:
Unit
=
{
if
(
sample
==
null
&&
inputBam
.
exists
())
{
val
inputSam
=
SamReaderFactory
.
makeDefault
.
open
(
inputBam
)
val
readGroups
=
inputSam
.
getFileHeader
.
getReadGroups
val
samples
=
readGroups
.
map
(
readGroup
=>
readGroup
.
getSample
).
distinct
sample
=
samples
.
head
inputSam
.
close
}
}
override
def
commandLine
=
{
(
if
(
inputMpileup
==
null
)
{
val
samtoolsMpileup
=
new
SamtoolsMpileup
(
this
)
...
...
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