Skip to content
GitLab
Menu
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
9a3356a5
Commit
9a3356a5
authored
Sep 22, 2015
by
Peter van 't Hof
Browse files
Convert pipe to SortSam again
parent
0c43aaf3
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/biopet-extentsions/src/main/scala/nl/lumc/sasc/biopet/extensions/picard/SortSam.scala
View file @
9a3356a5
...
...
@@ -31,31 +31,32 @@ class SortSam(val root: Configurable) extends Picard {
var
output
:
File
=
_
@Argument
(
doc
=
"Sort order of output file Required. Possible values: {unsorted, queryname, coordinate} "
,
required
=
true
)
var
sortOrder
:
String
=
_
var
sortOrder
:
String
=
config
(
"sort_order"
,
default
=
"coordinate"
)
@Output
(
doc
=
"Bam Index"
,
required
=
true
)
private
var
outputIndex
:
File
=
_
override
def
beforeGraph
()
{
super
.
beforeGraph
()
if
(
outputAsStsout
)
createIndex
=
false
if
(
createIndex
)
outputIndex
=
new
File
(
output
.
getAbsolutePath
.
stripSuffix
(
".bam"
)
+
".bai"
)
}
/** Returns command to execute */
override
def
cmdLine
=
super
.
cmdLine
+
required
(
"INPUT="
,
input
,
spaceSeparated
=
false
)
+
required
(
"OUTPUT="
,
output
,
spaceSeparated
=
false
)
+
(
if
(
inputAsStdin
)
required
(
"INPUT="
,
new
File
(
"/dev/stdin"
),
spaceSeparated
=
false
)
else
required
(
"INPUT="
,
input
,
spaceSeparated
=
false
))
+
(
if
(
outputAsStsout
)
required
(
"OUTPUT="
,
new
File
(
"/dev/stdout"
),
spaceSeparated
=
false
)
else
required
(
"OUTPUT="
,
output
,
spaceSeparated
=
false
))
+
required
(
"SORT_ORDER="
,
sortOrder
,
spaceSeparated
=
false
)
}
object
SortSam
{
/** Returns default SortSam */
def
apply
(
root
:
Configurable
,
input
:
File
,
output
:
File
,
sortOrder
:
String
=
null
)
:
SortSam
=
{
def
apply
(
root
:
Configurable
,
input
:
File
,
output
:
File
)
:
SortSam
=
{
val
sortSam
=
new
SortSam
(
root
)
sortSam
.
input
=
input
sortSam
.
output
=
output
if
(
sortOrder
==
null
)
sortSam
.
sortOrder
=
"coordinate"
else
sortSam
.
sortOrder
=
sortOrder
sortSam
}
}
\ No newline at end of file
public/mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/Mapping.scala
View file @
9a3356a5
...
...
@@ -334,16 +334,18 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
bwaCommand
.
deps
=
deps
bwaCommand
.
R
=
Some
(
getReadGroupBwa
)
bwaCommand
.
isIntermediate
=
true
val
sortSam
=
new
SortSam
(
this
)
sortSam
.
output
=
output
if
(
config
(
"use_pipes"
,
default
=
true
).
asBoolean
)
{
val
samtoolsSort
=
new
SamtoolsSort
(
this
)
samtoolsSort
.
outputFormat
=
Some
(
"bam"
)
samtoolsSort
.
output
=
output
add
(
bwaCommand
|
samtoolsSort
)
add
(
bwaCommand
|
samtoolsSort
,
chunking
||
!
skipMarkduplicates
)
}
else
{
bwaCommand
.
output
=
swapExt
(
output
.
getParent
,
output
,
".bam"
,
".sam"
)
add
(
bwaCommand
)
val
sortSam
=
SortSam
(
this
,
bwaCommand
.
output
,
output
)
if
(
chunking
||
!
skipMarkduplicates
)
sortSam
.
isIntermediate
=
true
sortSam
.
input
=
bwaCommand
.
output
sortSam
.
isIntermediate
=
chunking
||
!
skipMarkduplicates
add
(
sortSam
)
}
output
...
...
Write
Preview
Supports
Markdown
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