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
ba0deb1c
Commit
ba0deb1c
authored
Dec 12, 2016
by
Sander Bollen
Browse files
Merge branch 'fix-BIOPET-483' into 'develop'
Adding bgzipped fasta See merge request !498
parents
45c2a57d
4a702a03
Changes
3
Hide whitespace changes
Inline
Side-by-side
biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/Bgzip.scala
View file @
ba0deb1c
...
...
@@ -17,21 +17,28 @@ package nl.lumc.sasc.biopet.extensions
import
java.io.File
import
nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
import
nl.lumc.sasc.biopet.utils.Logging
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
/** Wrapper for the bgzip command */
class
Bgzip
(
val
root
:
Configurable
)
extends
BiopetCommandLineFunction
{
@Input
(
doc
=
"Input files"
,
required
=
tru
e
)
@Input
(
doc
=
"Input files"
,
required
=
fals
e
)
var
input
:
List
[
File
]
=
Nil
@Output
(
doc
=
"Compressed output file"
,
required
=
tru
e
)
@Output
(
doc
=
"Compressed output file"
,
required
=
fals
e
)
var
output
:
File
=
null
var
f
:
Boolean
=
config
(
"f"
,
default
=
false
)
executable
=
config
(
"exe"
,
default
=
"bgzip"
,
freeVar
=
false
)
override
def
beforeGraph
()
:
Unit
=
{
super
.
beforeGraph
()
if
(
input
.
isEmpty
&&
!
inputAsStdin
)
Logging
.
addError
(
"Input is missing for Bgzip"
)
if
(
output
==
null
&&
!
outputAsStsout
)
Logging
.
addError
(
"Output is missing for Bgzip"
)
}
def
cmdLine
=
required
(
executable
)
+
conditional
(
f
,
"-f"
)
+
" -c "
+
repeat
(
input
)
+
...
...
biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/samtools/SamtoolsFaidx.scala
View file @
ba0deb1c
...
...
@@ -25,13 +25,14 @@ class SamtoolsFaidx(val root: Configurable) extends Samtools {
var
input
:
File
=
_
@Output
(
doc
=
"output File"
)
private
var
_output
:
File
=
_
private
var
_output
:
List
[
File
]
=
Nil
def
output
=
_output
override
def
beforeGraph
:
Unit
=
{
super
.
beforeGraph
_output
=
new
File
(
input
.
getParentFile
,
input
.
getName
+
".fai"
)
_output
=
List
(
new
File
(
input
.
getAbsolutePath
+
".fai"
))
if
(
input
.
getName
.
endsWith
(
".gz"
))
_output
:+=
new
File
(
input
.
getAbsolutePath
+
".gzi"
)
}
/** Returns command to execute */
...
...
@@ -42,7 +43,8 @@ object SamtoolsFaidx {
def
apply
(
root
:
Configurable
,
input
:
File
)
:
SamtoolsFaidx
=
{
val
faidx
=
new
SamtoolsFaidx
(
root
)
faidx
.
input
=
input
faidx
.
_output
=
new
File
(
input
.
getParentFile
,
input
.
getName
+
".fai"
)
faidx
.
_output
=
List
(
new
File
(
input
.
getAbsolutePath
+
".fai"
))
if
(
input
.
getName
.
endsWith
(
".gz"
))
faidx
.
_output
:+=
new
File
(
input
.
getAbsolutePath
+
".gzi"
)
faidx
}
}
\ No newline at end of file
generate-indexes/src/main/scala/nl/lumc/sasc/biopet/pipelines/generateindexes/GenerateIndexes.scala
View file @
ba0deb1c
...
...
@@ -2,7 +2,7 @@ package nl.lumc.sasc.biopet.pipelines.generateindexes
import
nl.lumc.sasc.biopet.core.
{
BiopetQScript
,
PipelineCommand
}
import
nl.lumc.sasc.biopet.extensions.bowtie.
{
Bowtie2Build
,
BowtieBuild
}
import
nl.lumc.sasc.biopet.extensions.
{
Ln
,
Star
}
import
nl.lumc.sasc.biopet.extensions.
{
Bgzip
,
Ln
,
Star
}
import
nl.lumc.sasc.biopet.extensions.bwa.BwaIndex
import
nl.lumc.sasc.biopet.extensions.gmap.GmapBuild
import
nl.lumc.sasc.biopet.extensions.hisat.Hisat2Build
...
...
@@ -44,9 +44,13 @@ class GenerateIndexes(val root: Configurable) extends QScript with BiopetQScript
var
outputConfig
:
Map
[
String
,
Any
]
=
Map
(
"reference_fasta"
->
fastaFile
)
val
configDeps
=
new
ListBuffer
[
File
]()
val
bgzipFasta
=
new
File
(
fastaFile
.
getAbsolutePath
+
".gz"
)
add
(
fastaFile
:<:
new
Bgzip
(
this
)
>
bgzipFasta
)
add
(
SamtoolsFaidx
(
this
,
bgzipFasta
))
val
faidx
=
SamtoolsFaidx
(
this
,
fastaFile
)
add
(
faidx
)
configDeps
+=
faidx
.
output
faidx
.
output
.
foreach
(
configDeps
+=
_
)
val
createDict
=
new
CreateSequenceDictionary
(
this
)
createDict
.
reference
=
fastaFile
...
...
@@ -59,10 +63,10 @@ class GenerateIndexes(val root: Configurable) extends QScript with BiopetQScript
def
createLinks
(
dir
:
File
)
:
File
=
{
val
newFastaFile
=
new
File
(
dir
,
fastaFile
.
getName
)
val
newFai
=
new
File
(
dir
,
faidx
.
output
.
getName
)
val
newFai
=
new
File
(
dir
,
faidx
.
output
.
head
.
getName
)
val
newDict
=
new
File
(
dir
,
createDict
.
output
.
getName
)
add
(
Ln
(
this
,
faidx
.
output
,
newFai
))
add
(
Ln
(
this
,
faidx
.
output
.
head
,
newFai
))
add
(
Ln
(
this
,
createDict
.
output
,
newDict
))
val
lnFasta
=
Ln
(
this
,
fastaFile
,
newFastaFile
)
lnFasta
.
deps
++=
List
(
newFai
,
newDict
)
...
...
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