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
2373dae2
Commit
2373dae2
authored
Nov 29, 2016
by
Peter van 't Hof
Browse files
Fixing BIOPET-481
parent
ebebec1a
Changes
3
Hide whitespace changes
Inline
Side-by-side
biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/ConfigUtils.scala
View file @
2373dae2
...
...
@@ -14,7 +14,7 @@
*/
package
nl.lumc.sasc.biopet.utils
import
java.io.
{
File
,
PrintWriter
}
import
java.io.
{
File
,
PrintWriter
}
import
java.util
import
argonaut.Argonaut._
...
...
biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/package.scala
View file @
2373dae2
...
...
@@ -15,6 +15,7 @@
package
nl.lumc.sasc.biopet
import
scala.util.
{
Failure
,
Success
,
Try
}
import
scala.math._
/**
* General utility functions.
...
...
@@ -29,6 +30,15 @@ package object utils {
/** Regular expression for matching entire decimal numbers (compatible with the scientific notation) */
val
isDecimal
=
"""^([-+]?\d*\.?\d+(?:[eE][-+]?[0-9]+)?)$"""
.
r
def
textToSize
(
text
:
String
)
:
Long
=
{
text
.
last
match
{
case
'g'
|
'G'
=>
((
1L
<<
30
)
*
text
.
stripSuffix
(
"g"
).
stripSuffix
(
"G"
).
toDouble
).
toLong
case
'm'
|
'M'
=>
((
1L
<<
20
)
*
text
.
stripSuffix
(
"g"
).
stripSuffix
(
"G"
).
toDouble
).
toLong
case
'k'
|
'K'
=>
((
1L
<<
10
)
*
text
.
stripSuffix
(
"g"
).
stripSuffix
(
"G"
).
toDouble
).
toLong
case
_
=>
text
.
toLong
}
}
/**
* Tries to convert the given string with the given conversion functions recursively.
*
...
...
mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/Mapping.scala
View file @
2373dae2
...
...
@@ -19,11 +19,11 @@ import java.util.Date
import
nl.lumc.sasc.biopet.core._
import
nl.lumc.sasc.biopet.core.summary.SummaryQScript
import
nl.lumc.sasc.biopet.extensions.bowtie.
{
Bowtie
2
,
Bowtie
}
import
nl.lumc.sasc.biopet.extensions.bwa.
{
BwaAln
,
BwaMem
,
BwaSampe
,
BwaSamse
}
import
nl.lumc.sasc.biopet.extensions.bowtie.
{
Bowtie
,
Bowtie
2
}
import
nl.lumc.sasc.biopet.extensions.bwa.
{
BwaAln
,
BwaMem
,
BwaSampe
,
BwaSamse
}
import
nl.lumc.sasc.biopet.extensions.gmap.Gsnap
import
nl.lumc.sasc.biopet.extensions.hisat.Hisat2
import
nl.lumc.sasc.biopet.extensions.picard.
{
AddOrReplaceReadGroups
,
MarkDuplicates
,
MergeSamFiles
,
ReorderSam
,
SortSam
}
import
nl.lumc.sasc.biopet.extensions.picard.
{
AddOrReplaceReadGroups
,
MarkDuplicates
,
MergeSamFiles
,
ReorderSam
,
SortSam
}
import
nl.lumc.sasc.biopet.extensions.tools.FastqSplitter
import
nl.lumc.sasc.biopet.extensions._
import
nl.lumc.sasc.biopet.pipelines.bammetrics.BamMetrics
...
...
@@ -31,6 +31,7 @@ import nl.lumc.sasc.biopet.pipelines.bamtobigwig.Bam2Wig
import
nl.lumc.sasc.biopet.pipelines.flexiprep.Flexiprep
import
nl.lumc.sasc.biopet.pipelines.gears.GearsSingle
import
nl.lumc.sasc.biopet.pipelines.mapping.scripts.TophatRecondition
import
nl.lumc.sasc.biopet.utils.textToSize
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
org.broadinstitute.gatk.queue.QScript
...
...
@@ -163,10 +164,10 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
if
(
numberChunks
.
isEmpty
)
{
if
(
config
.
contains
(
"numberchunks"
))
numberChunks
=
config
(
"numberchunks"
,
default
=
None
)
else
{
val
chunkSize
:
Int
=
config
(
"chunksize"
,
1
<<
30
)
val
chunkSize
:
String
=
config
(
"chunksize"
,
default
=
"5G"
)
val
filesize
=
if
(
inputR1
.
getName
.
endsWith
(
".gz"
)
||
inputR1
.
getName
.
endsWith
(
".gzip"
))
inputR1
.
length
*
3
else
inputR1
.
length
numberChunks
=
Option
(
ceil
(
filesize
.
toDouble
/
chunkSize
).
toInt
)
numberChunks
=
Option
(
ceil
(
filesize
.
toDouble
/
textToSize
(
chunkSize
)
)
.
toInt
)
}
}
logger
.
debug
(
"Chunks: "
+
numberChunks
.
getOrElse
(
1
))
...
...
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