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
1621e5cd
Commit
1621e5cd
authored
Mar 03, 2015
by
Peter van 't Hof
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added freebayes
parent
e7aa783e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
5 deletions
+57
-5
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Freebayes.scala
...main/scala/nl/lumc/sasc/biopet/extensions/Freebayes.scala
+34
-0
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcallingTrait.scala
...asc/biopet/pipelines/shiva/ShivaVariantcallingTrait.scala
+15
-1
public/shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcallingTest.scala
...sasc/biopet/pipelines/shiva/ShivaVariantcallingTest.scala
+8
-4
No files found.
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Freebayes.scala
0 → 100644
View file @
1621e5cd
package
nl.lumc.sasc.biopet.extensions
import
java.io.File
import
nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
import
nl.lumc.sasc.biopet.core.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Output
,
Input
}
/**
* Created by pjvan_thof on 3/3/15.
*/
class
Freebayes
(
val
root
:
Configurable
)
extends
BiopetCommandLineFunction
{
@Input
(
required
=
true
)
var
bamfiles
:
List
[
File
]
=
Nil
@Input
(
required
=
true
)
var
reference
:
File
=
config
(
"reference"
)
@Output
(
required
=
true
)
var
outputVcf
:
File
=
null
var
ploidy
:
Option
[
Int
]
=
config
(
"ploidy"
)
executable
=
config
(
"exe"
,
default
=
"freebayes"
)
override
val
versionRegex
=
"""version: (.*)"""
.
r
override
def
versionCommand
=
executable
+
" --version"
def
cmdLine
=
executable
+
required
(
"--fasta-reference"
,
reference
)
+
repeat
(
"--bam"
,
bamfiles
)
+
optional
(
"--vcf"
,
outputVcf
)
+
optional
(
"--ploidy"
,
ploidy
)
}
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcallingTrait.scala
View file @
1621e5cd
...
...
@@ -77,7 +77,7 @@ trait ShivaVariantcallingTrait extends SummaryQScript with SampleLibraryTag {
addSummaryJobs
}
protected
def
callersList
:
List
[
Variantcaller
]
=
List
(
new
RawVcf
,
new
Bcftools
)
protected
def
callersList
:
List
[
Variantcaller
]
=
List
(
new
Freebayes
,
new
RawVcf
,
new
Bcftools
)
trait
Variantcaller
{
val
name
:
String
...
...
@@ -88,6 +88,20 @@ trait ShivaVariantcallingTrait extends SummaryQScript with SampleLibraryTag {
def
outputFile
:
File
}
class
Freebayes
extends
Variantcaller
{
val
name
=
"freebayes"
protected
val
defaultPrio
=
7
def
outputFile
=
new
File
(
outputDir
,
namePrefix
+
".freebayes.vcf"
)
def
addJobs
()
{
val
fb
=
new
nl
.
lumc
.
sasc
.
biopet
.
extensions
.
Freebayes
(
qscript
)
fb
.
bamfiles
=
inputBams
fb
.
outputVcf
=
outputFile
add
(
fb
)
}
}
class
Bcftools
extends
Variantcaller
{
val
name
=
"bcftools"
protected
val
defaultPrio
=
8
...
...
public/shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcallingTest.scala
View file @
1621e5cd
...
...
@@ -4,6 +4,7 @@ import java.io.File
import
com.google.common.io.Files
import
nl.lumc.sasc.biopet.core.config.Config
import
nl.lumc.sasc.biopet.extensions.Freebayes
import
nl.lumc.sasc.biopet.extensions.gatk.CombineVariants
import
nl.lumc.sasc.biopet.tools.
{
VcfFilter
,
MpileupToVcf
}
import
nl.lumc.sasc.biopet.utils.ConfigUtils
...
...
@@ -31,20 +32,21 @@ class ShivaVariantcallingTest extends TestNGSuite with Matchers {
@DataProvider
(
name
=
"shivaVariantcallingOptions"
)
def
shivaVariantcallingOptions
=
{
val
bool
=
Array
(
true
,
false
)
(
for
(
bams
<-
0
to
3
;
raw
<-
bool
;
bcftools
<-
bool
)
yield
Array
(
bams
,
raw
,
bcftool
s
)).
toArray
(
for
(
bams
<-
0
to
3
;
raw
<-
bool
;
bcftools
<-
bool
;
freebayes
<-
bool
)
yield
Array
(
bams
,
raw
,
bcftools
,
freebaye
s
)).
toArray
}
@Test
(
dataProvider
=
"shivaVariantcallingOptions"
)
def
testShivaVariantcalling
(
bams
:
Int
,
raw
:
Boolean
,
bcftools
:
Boolean
)
=
{
def
testShivaVariantcalling
(
bams
:
Int
,
raw
:
Boolean
,
bcftools
:
Boolean
,
freebayes
:
Boolean
)
=
{
val
callers
:
ListBuffer
[
String
]
=
ListBuffer
()
if
(
raw
)
callers
.
append
(
"raw"
)
if
(
bcftools
)
callers
.
append
(
"bcftools"
)
if
(
freebayes
)
callers
.
append
(
"freebayes"
)
val
map
=
Map
(
"variantcallers"
->
callers
.
toList
)
val
pipeline
=
initPipeline
(
map
)
pipeline
.
inputBams
=
(
for
(
n
<-
1
to
bams
)
yield
new
File
(
"bam_"
+
n
+
".bam"
)).
toList
val
illegalArgumentException
=
pipeline
.
inputBams
.
isEmpty
||
(!
raw
&&
!
bcftools
)
val
illegalArgumentException
=
pipeline
.
inputBams
.
isEmpty
||
(!
raw
&&
!
bcftools
&&
!
freebayes
)
if
(
illegalArgumentException
)
intercept
[
IllegalArgumentException
]
{
pipeline
.
script
()
...
...
@@ -56,6 +58,7 @@ class ShivaVariantcallingTest extends TestNGSuite with Matchers {
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
CombineVariants
])
shouldBe
1
+
(
if
(
raw
)
1
else
0
)
//pipeline.functions.count(_.isInstanceOf[Bcftools]) shouldBe (if (bcftools) 1 else 0)
//FIXME: Can not check for bcftools because of piping
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
Freebayes
])
shouldBe
(
if
(
freebayes
)
1
else
0
)
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
MpileupToVcf
])
shouldBe
(
if
(
raw
)
bams
else
0
)
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
VcfFilter
])
shouldBe
(
if
(
raw
)
bams
else
0
)
}
...
...
@@ -75,6 +78,7 @@ object ShivaVariantcallingTest {
"reference"
->
"test"
,
"gatk_jar"
->
"test"
,
"samtools"
->
Map
(
"exe"
->
"test"
),
"bcftools"
->
Map
(
"exe"
->
"test"
)
"bcftools"
->
Map
(
"exe"
->
"test"
),
"freebayes"
->
Map
(
"exe"
->
"test"
)
)
}
\ No newline at end of file
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