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
e0437d5e
Commit
e0437d5e
authored
Jun 23, 2014
by
Peter van 't Hof
Browse files
Added bz2 support
parent
cde95be1
Changes
5
Hide whitespace changes
Inline
Side-by-side
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/Pbzip2.scala
0 → 100644
View file @
e0437d5e
package
nl.lumc.sasc.biopet.function
import
nl.lumc.sasc.biopet.core._
import
nl.lumc.sasc.biopet.core.config._
//import org.broadinstitute.sting.queue.function.CommandLineFunction
import
org.broadinstitute.sting.commandline._
import
java.io.File
class
Pbzip2
(
val
root
:
Configurable
)
extends
BiopetCommandLineFunction
{
@Input
(
doc
=
"Zipped file"
)
var
input
:
File
=
_
@Output
(
doc
=
"Unzipped file"
)
var
output
:
File
=
_
executeble
=
config
(
"exe"
,
"pbzip2"
)
var
decomrpess
=
true
var
memory
:
Int
=
config
(
"memory"
,
1000
)
override
val
defaultVmem
=
(
memory
*
2
/
1000
)
+
"G"
override
val
defaultThreads
=
2
def
cmdLine
=
required
(
executeble
)
+
conditional
(
decomrpess
,
"-d"
)
+
conditional
(!
decomrpess
,
"-z"
)
+
optional
(
"-p"
,
threads
,
spaceSeparated
=
false
)
+
optional
(
"-m"
,
memory
,
spaceSeparated
=
false
)
+
required
(
"-c"
,
output
)
+
required
(
input
)
}
object
Pbzip2
{
def
apply
(
root
:
Configurable
,
input
:
File
,
output
:
File
)
:
Pbzip2
=
{
val
pbzip2
=
new
Pbzip2
(
root
)
pbzip2
.
input
=
input
pbzip2
.
output
=
output
return
pbzip2
}
}
\ No newline at end of file
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/Zcat.scala
View file @
e0437d5e
...
...
@@ -16,4 +16,13 @@ class Zcat(val root:Configurable) extends BiopetCommandLineFunction {
executeble
=
config
(
"exe"
,
"zcat"
)
def
cmdLine
=
required
(
executeble
)
+
required
(
input
)
+
" > "
+
required
(
output
)
}
object
Zcat
{
def
apply
(
root
:
Configurable
,
input
:
File
,
output
:
File
)
:
Zcat
=
{
val
zcat
=
new
Zcat
(
root
)
zcat
.
input
=
input
zcat
.
output
=
output
return
zcat
}
}
\ No newline at end of file
flexiprep/examples/test.json
View file @
e0437d5e
{
"fastqc"
:
{
"exe"
:
"/home/pjvan_thof/Downloads/FastQC/fastqc"
},
"gatk"
:
{
"flexiprep"
:
{
"sdfg"
:
{
"exe"
:
"gatk"
}}},
"pbzip2"
:
{
"exe"
:
"/home/pjvan_thof/pipelines/test/test"
},
"flexiprep"
:
{
"fastqc"
:
{
"exe"
:
"/home/pjvan_thof/pipelines/test/test"
},
"cutadapt"
:
{
"exe"
:
"/home/pjvan_thof/pipelines/test/test"
},
...
...
flexiprep/nbactions.xml
View file @
e0437d5e
...
...
@@ -10,7 +10,7 @@
<goal>
org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
</goal>
</goals>
<properties>
<exec.args>
-classpath %classpath nl.lumc.sasc.biopet.pipelines.flexiprep.Flexiprep -R2 bla.fastq.gz -R1 ../input_R1.fastq -outputDir /home/pjvan_thof/pipelines/test -config /home/pjvan_thof/pipelines/biopet/flexiprep/examples/test.json -l DEBUG
</exec.args>
<exec.args>
-classpath %classpath nl.lumc.sasc.biopet.pipelines.flexiprep.Flexiprep -R2 bla.fastq.gz -R1 ../input_R1.fastq
.bz2
-outputDir /home/pjvan_thof/pipelines/test -config /home/pjvan_thof/pipelines/biopet/flexiprep/examples/test.json -l DEBUG
</exec.args>
<exec.executable>
java
</exec.executable>
<exec.workingdir>
/home/pjvan_thof/pipelines/test
</exec.workingdir>
</properties>
...
...
@@ -25,7 +25,7 @@
<goal>
org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
</goal>
</goals>
<properties>
<exec.args>
-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath nl.lumc.sasc.biopet.pipelines.flexiprep.Flexiprep -R2 bla.fastq.gz -R1 ../input_R1.fastq -outputDir /home/pjvan_thof/pipelines/test -config /home/pjvan_thof/pipelines/biopet/flexiprep/examples/test.json -l DEBUG
</exec.args>
<exec.args>
-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath nl.lumc.sasc.biopet.pipelines.flexiprep.Flexiprep -R2 bla.fastq.gz -R1 ../input_R1.fastq
.bz2
-outputDir /home/pjvan_thof/pipelines/test -config /home/pjvan_thof/pipelines/biopet/flexiprep/examples/test.json -l DEBUG
</exec.args>
<exec.executable>
java
</exec.executable>
<jpda.listen>
true
</jpda.listen>
<exec.workingdir>
/home/pjvan_thof/pipelines/test
</exec.workingdir>
...
...
@@ -41,7 +41,7 @@
<goal>
org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
</goal>
</goals>
<properties>
<exec.args>
-classpath %classpath nl.lumc.sasc.biopet.pipelines.flexiprep.Flexiprep -R2 bla.fastq.gz -R1 ../input_R1.fastq -outputDir /home/pjvan_thof/pipelines/test -config /home/pjvan_thof/pipelines/biopet/flexiprep/examples/test.json -l DEBUG
</exec.args>
<exec.args>
-classpath %classpath nl.lumc.sasc.biopet.pipelines.flexiprep.Flexiprep -R2 bla.fastq.gz -R1 ../input_R1.fastq
.bz2
-outputDir /home/pjvan_thof/pipelines/test -config /home/pjvan_thof/pipelines/biopet/flexiprep/examples/test.json -l DEBUG
</exec.args>
<exec.executable>
java
</exec.executable>
<exec.workingdir>
/home/pjvan_thof/pipelines/test
</exec.workingdir>
</properties>
...
...
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala
View file @
e0437d5e
...
...
@@ -60,8 +60,8 @@ class Flexiprep(val root:Configurable) extends QScript with BiopetQScript {
def
biopetScript
()
{
runInitialFastqc
()
outputFiles
+=
(
"fastq_input_R1"
->
zca
tIfNeeded
(
input_R1
,
outputDir
))
if
(
paired
)
outputFiles
+=
(
"fastq_input_R2"
->
zca
tIfNeeded
(
input_R2
,
outputDir
))
outputFiles
+=
(
"fastq_input_R1"
->
extrac
tIfNeeded
(
input_R1
,
outputDir
))
if
(
paired
)
outputFiles
+=
(
"fastq_input_R2"
->
extrac
tIfNeeded
(
input_R2
,
outputDir
))
addSeqstat
(
outputFiles
(
"fastq_input_R1"
),
"seqstat_R1"
)
if
(
paired
)
addSeqstat
(
outputFiles
(
"fastq_input_R2"
),
"seqstat_R2"
)
...
...
@@ -237,17 +237,20 @@ class Flexiprep(val root:Configurable) extends QScript with BiopetQScript {
return
fastqcCommand
}
def
zca
tIfNeeded
(
file
:
File
,
runDir
:
String
)
:
File
=
{
def
extrac
tIfNeeded
(
file
:
File
,
runDir
:
String
)
:
File
=
{
if
(
file
.
getName
().
endsWith
(
".gz"
)
||
file
.
getName
().
endsWith
(
".gzip"
))
{
var
newFile
:
File
=
swapExt
(
file
,
".gz"
,
""
)
if
(
file
.
getName
().
endsWith
(
".gzip"
))
newFile
=
swapExt
(
file
,
".gzip"
,
""
)
val
zcatCommand
=
new
Zcat
(
this
)
zcatCommand
.
input
=
file
zcatCommand
.
output
=
new
File
(
runDir
+
newFile
)
//zcatCommand.jobOutputFile = outputDir + "." + file.getName + ".out"
var
newFile
:
File
=
swapExt
(
runDir
,
file
,
".gz"
,
""
)
if
(
file
.
getName
().
endsWith
(
".gzip"
))
newFile
=
swapExt
(
runDir
,
file
,
".gzip"
,
""
)
val
zcatCommand
=
Zcat
(
this
,
file
,
newFile
)
if
(!
this
.
skipClip
||
!
this
.
skipTrim
)
zcatCommand
.
isIntermediate
=
true
add
(
zcatCommand
)
return
zcatCommand
.
output
return
newFile
}
else
if
(
file
.
getName
().
endsWith
(
".bz2"
))
{
var
newFile
=
swapExt
(
runDir
,
file
,
".bz2"
,
""
)
val
pbzip2
=
Pbzip2
(
this
,
file
,
newFile
)
if
(!
this
.
skipClip
||
!
this
.
skipTrim
)
pbzip2
.
isIntermediate
=
true
add
(
pbzip2
)
return
newFile
}
else
return
file
}
...
...
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