Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
biopet.biopet
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
biopet.biopet
Commits
90eaaf09
Commit
90eaaf09
authored
9 years ago
by
bow
Browse files
Options
Downloads
Patches
Plain Diff
Remove R1_ext and R2_ext from Flexiprep
parent
487324b4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala
+11
-15
11 additions, 15 deletions
...a/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala
with
11 additions
and
15 deletions
public/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala
+
11
−
15
View file @
90eaaf09
...
@@ -21,7 +21,6 @@ import nl.lumc.sasc.biopet.extensions.{ Zcat, Gzip }
...
@@ -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.utils.config.Configurable
import
nl.lumc.sasc.biopet.extensions.tools.
{
SeqStat
,
FastqSync
}
import
nl.lumc.sasc.biopet.extensions.tools.
{
SeqStat
,
FastqSync
}
import
org.apache.commons.io.FilenameUtils.getExtension
import
org.broadinstitute.gatk.queue.QScript
import
org.broadinstitute.gatk.queue.QScript
class
Flexiprep
(
val
root
:
Configurable
)
extends
QScript
with
SummaryQScript
with
SampleLibraryTag
{
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
...
@@ -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
* 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:
* Examples:
* - my_file.fq.gz returns
(
"my_file.fq"
, ".fq")
* - my_file.fq.gz returns "my_file.fq"
* - my_other_file.fastq returns
(
"my_file.fastq"
, ".fastq")
* - my_other_file.fastq returns "my_file.fastq"
*
*
* @param f Input file object.
* @param f Input file object.
* @param exts Possible compression extensions to trim.
* @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
)
=
{
private
def
get
UncompressedName
(
f
:
File
,
exts
:
Set
[
String
]
=
zipExtensions
)
:
String
=
val
unzippedFilename
=
zipExtensions
zipExtensions
.
foldLeft
(
f
.
toString
)
{
case
(
fname
,
ext
)
=>
.
foldLeft
(
f
.
toString
)
{
case
(
fname
,
ext
)
=>
if
(
fname
.
toLowerCase
.
endsWith
(
ext
))
fname
.
dropRight
(
ext
.
length
)
if
(
fname
.
toLowerCase
.
endsWith
(
ext
))
fname
.
dropRight
(
ext
.
length
)
else
fname
else
fname
}
}
val
unzippedExt
=
"."
+
getExtension
(
unzippedFilename
)
(
unzippedFilename
,
unzippedExt
)
}
ensuring
(
_
.
_2
.
length
>
1
,
"Flexiprep input files must have an extension when uncompressed."
)
/** Function that's need to be executed before the script is accessed */
/** Function that's need to be executed before the script is accessed */
def
init
()
{
def
init
()
{
...
@@ -112,10 +108,10 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
...
@@ -112,10 +108,10 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
inputFiles
:+=
new
InputFile
(
input_R1
)
inputFiles
:+=
new
InputFile
(
input_R1
)
input_R2
.
foreach
(
inputFiles
:+=
new
InputFile
(
_
))
input_R2
.
foreach
(
inputFiles
:+=
new
InputFile
(
_
))
(
R1_ext
,
R1_name
)
=
get
NameAndExt
(
input_R1
)
R1_name
=
get
UncompressedName
(
input_R1
)
input_R2
.
foreach
{
fileR2
=>
input_R2
.
foreach
{
fileR2
=>
paired
=
true
paired
=
true
(
R2_ext
,
R2_name
)
=
get
NameAndExt
(
fileR2
)
R2_name
=
get
UncompressedName
(
fileR2
)
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment