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
90eaaf09
Commit
90eaaf09
authored
Oct 19, 2015
by
bow
Browse files
Remove R1_ext and R2_ext from Flexiprep
parent
487324b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala
View file @
90eaaf09
...
...
@@ -21,7 +21,6 @@ import nl.lumc.sasc.biopet.extensions.{ Zcat, Gzip }
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
nl.lumc.sasc.biopet.extensions.tools.
{
SeqStat
,
FastqSync
}
import
org.apache.commons.io.FilenameUtils.getExtension
import
org.broadinstitute.gatk.queue.QScript
class
Flexiprep
(
val
root
:
Configurable
)
extends
QScript
with
SummaryQScript
with
SampleLibraryTag
{
...
...
@@ -80,25 +79,22 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
/**
* Given a file object and a set of compression extensions, return the filename without any of the compression
* extensions
and the filename's extension
.
* extensions.
*
* Examples:
* - my_file.fq.gz returns
(
"my_file.fq"
, ".fq")
* - my_other_file.fastq returns
(
"my_file.fastq"
, ".fastq")
* - my_file.fq.gz returns "my_file.fq"
* - my_other_file.fastq returns "my_file.fastq"
*
* @param f Input file object.
* @param exts Possible compression extensions to trim.
* @return Filename without compression
extension and its
extension.
* @return Filename without compression extension.
*/
private
def
get
NameAndExt
(
f
:
File
,
exts
:
Set
[
String
]
=
zipExtensions
)
:
(
String
,
String
)
=
{
val
unzippedFilename
=
zipExtensions
private
def
get
UncompressedName
(
f
:
File
,
exts
:
Set
[
String
]
=
zipExtensions
)
:
String
=
zipExtensions
.
foldLeft
(
f
.
toString
)
{
case
(
fname
,
ext
)
=>
if
(
fname
.
toLowerCase
.
endsWith
(
ext
))
fname
.
dropRight
(
ext
.
length
)
else
fname
}
val
unzippedExt
=
"."
+
getExtension
(
unzippedFilename
)
(
unzippedFilename
,
unzippedExt
)
}
ensuring
(
_
.
_2
.
length
>
1
,
"Flexiprep input files must have an extension when uncompressed."
)
if
(
fname
.
toLowerCase
.
endsWith
(
ext
))
fname
.
dropRight
(
ext
.
length
)
else
fname
}
/** Function that's need to be executed before the script is accessed */
def
init
()
{
...
...
@@ -112,10 +108,10 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
inputFiles
:+=
new
InputFile
(
input_R1
)
input_R2
.
foreach
(
inputFiles
:+=
new
InputFile
(
_
))
(
R1_ext
,
R1_name
)
=
get
NameAndExt
(
input_R1
)
R1_name
=
get
UncompressedName
(
input_R1
)
input_R2
.
foreach
{
fileR2
=>
paired
=
true
(
R2_ext
,
R2_name
)
=
get
NameAndExt
(
fileR2
)
R2_name
=
get
UncompressedName
(
fileR2
)
}
}
...
...
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