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
f60b77cc
Commit
f60b77cc
authored
10 years ago
by
Peter van 't Hof
Browse files
Options
Downloads
Patches
Plain Diff
Remove Queue command args
parent
449202bd
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/mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/Mapping.scala
+66
-67
66 additions, 67 deletions
...scala/nl/lumc/sasc/biopet/pipelines/mapping/Mapping.scala
with
66 additions
and
67 deletions
public/mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/Mapping.scala
+
66
−
67
View file @
f60b77cc
...
...
@@ -38,60 +38,59 @@ class Mapping(val root: Configurable) extends QScript with BiopetQScript {
@Input
(
doc
=
"R2 fastq file"
,
shortName
=
"R2"
,
required
=
false
)
var
input_R2
:
File
=
_
@Argument
(
doc
=
"Output name"
,
shortName
=
"outputName"
,
required
=
false
)
/** Output name */
var
outputName
:
String
=
_
@Argument
(
doc
=
"Skip flexiprep"
,
shortName
=
"skipflexiprep"
,
required
=
false
)
var
skipFlexiprep
:
Boolean
=
false
/** Skip flexiprep */
protected
var
skipFlexiprep
:
Boolean
=
config
(
"skip_flexiprep"
,
default
=
false
)
@Argument
(
doc
=
"
Skip mark duplicates
"
,
shortName
=
"skipmarkduplicates"
,
required
=
false
)
var
skipMarkduplicates
:
Boolean
=
false
/**
Skip mark duplicates
*/
protected
var
skipMarkduplicates
:
Boolean
=
config
(
"skip_markduplicates"
,
default
=
false
)
@Argument
(
doc
=
"Skip metrics"
,
shortName
=
"skipmetrics"
,
required
=
false
)
var
skipMetrics
:
Boolean
=
false
/** Skip metrics */
protected
var
skipMetrics
:
Boolean
=
config
(
"skip_metrics"
,
default
=
false
)
@Argument
(
doc
=
"Aligner"
,
shortName
=
"ALN"
,
required
=
false
)
var
aligner
:
String
=
config
(
"aligner"
,
default
=
"bwa"
)
/** Aligner */
protected
var
aligner
:
String
=
config
(
"aligner"
,
default
=
"bwa"
)
@Argument
(
doc
=
"Reference"
,
shortName
=
"R"
,
required
=
false
)
var
reference
:
File
=
config
(
"reference"
)
/** Reference */
protected
var
reference
:
File
=
config
(
"reference"
)
@Argument
(
doc
=
"Chunking"
,
shortName
=
"chunking"
,
required
=
false
)
var
chunking
:
Boolean
=
config
(
"chunking"
,
false
)
/** Number of chunks, when not defined pipeline will automatic calculate number of chunks */
protected
var
numberChunks
:
Option
[
Int
]
=
config
(
"number_chunks"
)
@ClassType
(
classOf
[
Int
])
@Argument
(
doc
=
"Number of chunks, when not defined pipeline will automatic calculate number of chunks"
,
shortName
=
"numberChunks"
,
required
=
false
)
var
numberChunks
:
Option
[
Int
]
=
None
/** Enable chunking */
protected
var
chunking
:
Boolean
=
config
(
"chunking"
,
numberChunks
.
getOrElse
(
1
)
>
1
)
// Readgroup items
@Argument
(
doc
=
"Readgroup ID"
,
shortName
=
"RGID"
,
required
=
false
)
var
RGID
:
String
=
config
(
"RGID"
)
/** Readgroup ID */
protected
var
readgroupId
:
String
=
_
@Argument
(
doc
=
"Readgroup Library"
,
shortName
=
"RGLB"
,
required
=
false
)
var
RGLB
:
String
=
config
(
"RGLB"
)
/** Readgroup Library */
var
libraryId
:
String
=
_
@Argument
(
doc
=
"
Readgroup Platform
"
,
shortName
=
"RGPL"
,
required
=
false
)
var
RGPL
:
String
=
config
(
"
RGPL
"
,
default
=
"illumina"
)
/**
Readgroup Platform
*/
protected
var
platform
:
String
=
config
(
"
platform
"
,
default
=
"illumina"
)
@Argument
(
doc
=
"
Readgroup platform unit
"
,
shortName
=
"RGPU"
,
required
=
false
)
var
RGPU
:
String
=
config
(
"
RGPU
"
,
default
=
"na"
)
/**
Readgroup platform unit
*/
protected
var
platformUnit
:
String
=
config
(
"
platform_unit
"
,
default
=
"na"
)
@Argument
(
doc
=
"Readgroup sample"
,
shortName
=
"RGSM"
,
required
=
false
)
var
RGSM
:
String
=
config
(
"RGSM"
)
/**Readgroup sample */
var
sampleId
:
String
=
_
@Argument
(
doc
=
"
Readgroup sequencing center
"
,
shortName
=
"RGCN"
,
required
=
false
)
var
RGCN
:
String
=
config
(
"
RGCN
"
)
/**
Readgroup sequencing center
*/
protected
var
readgroupSequencingCenter
:
Option
[
String
]
=
config
(
"
readgroup_sequencing_center
"
)
@Argument
(
doc
=
"
Readgroup description
"
,
shortName
=
"RGDS"
,
required
=
false
)
var
RGDS
:
String
=
config
(
"
RGDS
"
)
/**
Readgroup description
*/
protected
var
readgroupDescription
:
Option
[
String
]
=
config
(
"
readgroup_description
"
)
@Argument
(
doc
=
"
Readgroup sequencing date
"
,
shortName
=
"RGDT"
,
required
=
false
)
var
RGDT
:
Date
=
_
/**
Readgroup sequencing date
*/
protected
var
readgroupDate
:
Date
=
_
@Argument
(
doc
=
"
Readgroup predicted insert size
"
,
shortName
=
"RGPI"
,
required
=
false
)
var
RGPI
:
Option
[
Int
]
=
config
(
"
RGPI
"
)
/**
Readgroup predicted insert size
*/
protected
var
predictedInsertsize
:
Option
[
Int
]
=
config
(
"
predicted_insertsize
"
)
var
paired
:
Boolean
=
false
protected
var
paired
:
Boolean
=
false
val
flexiprep
=
new
Flexiprep
(
this
)
def
init
()
{
...
...
@@ -100,12 +99,12 @@ class Mapping(val root: Configurable) extends QScript with BiopetQScript {
if
(
input_R1
==
null
)
throw
new
IllegalStateException
(
"Missing FastQ R1 on mapping module"
)
paired
=
(
input_R2
!=
null
)
if
(
RGLB
==
null
)
throw
new
IllegalStateException
(
"Missing Readgroup library on mapping module
"
)
if
(
RGLB
==
null
)
throw
new
IllegalStateException
(
"Missing Readgroup sample on mapping module
"
)
if
(
RGID
==
null
&&
RGSM
!=
null
&&
RGLB
!=
null
)
RGID
=
RGSM
+
"-"
+
RGLB
else
if
(
RGID
==
null
)
throw
new
IllegalStateException
(
"Missing Readgroup ID on mapping module
"
)
if
(
libraryId
==
null
)
libraryId
=
config
(
"library_id
"
)
if
(
sampleId
==
null
)
sampleId
=
config
(
"sample_id
"
)
if
(
readgroupId
==
null
&&
sampleId
!=
null
&&
libraryId
!=
null
)
readgroupId
=
sampleId
+
"-"
+
libraryId
else
if
(
readgroupId
==
null
)
readgroupId
=
config
(
"readgroup_id
"
)
if
(
outputName
==
null
)
outputName
=
RGID
if
(
outputName
==
null
)
outputName
=
readgroupId
if
(
chunking
)
{
if
(
numberChunks
.
isEmpty
)
{
...
...
@@ -126,8 +125,8 @@ class Mapping(val root: Configurable) extends QScript with BiopetQScript {
flexiprep
.
outputDir
=
outputDir
+
"flexiprep/"
flexiprep
.
input_R1
=
input_R1
if
(
paired
)
flexiprep
.
input_R2
=
input_R2
flexiprep
.
sampleName
=
this
.
RGSM
flexiprep
.
libraryName
=
this
.
RGLB
flexiprep
.
sampleName
=
this
.
sampleId
flexiprep
.
libraryName
=
this
.
libraryId
flexiprep
.
init
flexiprep
.
runInitialJobs
}
...
...
@@ -275,15 +274,15 @@ class Mapping(val root: Configurable) extends QScript with BiopetQScript {
def
addStampy
(
R1
:
File
,
R2
:
File
,
output
:
File
,
deps
:
List
[
File
])
:
File
=
{
var
RG
:
String
=
"ID:"
+
RGID
+
","
RG
+=
"SM:"
+
RGSM
+
","
RG
+=
"LB:"
+
RGLB
+
","
if
(
RGDS
!=
null
)
RG
+=
"DS"
+
RGDS
+
","
RG
+=
"PU:"
+
RGPU
+
","
if
(
RGPI
>
0
)
RG
+=
"PI:"
+
RGPI
+
","
if
(
RGCN
!=
null
)
RG
+=
"CN:"
+
RGCN
+
","
if
(
RGDT
!=
null
)
RG
+=
"DT:"
+
RGDT
+
","
RG
+=
"PL:"
+
RGPL
var
RG
:
String
=
"ID:"
+
readgroupId
+
","
RG
+=
"SM:"
+
sampleId
+
","
RG
+=
"LB:"
+
libraryId
+
","
if
(
readgroupDescription
!=
null
)
RG
+=
"DS"
+
readgroupDescription
+
","
RG
+=
"PU:"
+
platformUnit
+
","
if
(
predictedInsertsize
.
getOrElse
(
0
)
>
0
)
RG
+=
"PI:"
+
predictedInsertsize
.
get
+
","
if
(
readgroupSequencingCenter
.
isDefined
)
RG
+=
"CN:"
+
readgroupSequencingCenter
.
get
+
","
if
(
readgroupDate
!=
null
)
RG
+=
"DT:"
+
readgroupDate
+
","
RG
+=
"PL:"
+
platform
val
stampyCmd
=
new
Stampy
(
this
)
stampyCmd
.
R1
=
R1
...
...
@@ -327,13 +326,13 @@ class Mapping(val root: Configurable) extends QScript with BiopetQScript {
val
addOrReplaceReadGroups
=
AddOrReplaceReadGroups
(
this
,
input
,
output
)
addOrReplaceReadGroups
.
createIndex
=
true
addOrReplaceReadGroups
.
RGID
=
RGID
addOrReplaceReadGroups
.
RGLB
=
RGLB
addOrReplaceReadGroups
.
RGPL
=
RGPL
addOrReplaceReadGroups
.
RGPU
=
RGPU
addOrReplaceReadGroups
.
RGSM
=
RGSM
if
(
RGCN
!=
null
)
addOrReplaceReadGroups
.
RGCN
=
RGCN
if
(
RGDS
!=
null
)
addOrReplaceReadGroups
.
RGDS
=
RGDS
addOrReplaceReadGroups
.
RGID
=
readgroupId
addOrReplaceReadGroups
.
RGLB
=
libraryId
addOrReplaceReadGroups
.
RGPL
=
platform
addOrReplaceReadGroups
.
RGPU
=
platformUnit
addOrReplaceReadGroups
.
RGSM
=
sampleId
if
(
readgroupSequencingCenter
.
isDefined
)
addOrReplaceReadGroups
.
RGCN
=
readgroupSequencingCenter
.
get
if
(
readgroupDescription
.
isDefined
)
addOrReplaceReadGroups
.
RGDS
=
readgroupDescription
.
get
if
(!
skipMarkduplicates
)
addOrReplaceReadGroups
.
isIntermediate
=
true
add
(
addOrReplaceReadGroups
)
...
...
@@ -341,15 +340,15 @@ class Mapping(val root: Configurable) extends QScript with BiopetQScript {
}
def
getReadGroup
()
:
String
=
{
var
RG
:
String
=
"@RG\\t"
+
"ID:"
+
RGID
+
"\\t"
RG
+=
"LB:"
+
RGLB
+
"\\t"
RG
+=
"PL:"
+
RGPL
+
"\\t"
RG
+=
"PU:"
+
RGPU
+
"\\t"
RG
+=
"SM:"
+
RGSM
+
"\\t"
if
(
RGCN
!=
null
)
RG
+=
"CN:"
+
RGCN
+
"\\t"
if
(
RGDS
!=
null
)
RG
+=
"DS"
+
RGDS
+
"\\t"
if
(
RGDT
!=
null
)
RG
+=
"DT"
+
RGDT
+
"\\t"
if
(
RGPI
.
isDefined
)
RG
+=
"PI"
+
RGPI
.
get
+
"\\t"
var
RG
:
String
=
"@RG\\t"
+
"ID:"
+
readgroupId
+
"\\t"
RG
+=
"LB:"
+
libraryId
+
"\\t"
RG
+=
"PL:"
+
platform
+
"\\t"
RG
+=
"PU:"
+
platformUnit
+
"\\t"
RG
+=
"SM:"
+
sampleId
+
"\\t"
if
(
readgroupSequencingCenter
.
isDefined
)
RG
+=
"CN:"
+
readgroupSequencingCenter
.
get
+
"\\t"
if
(
readgroupDescription
.
isDefined
)
RG
+=
"DS"
+
readgroupDescription
.
get
+
"\\t"
if
(
readgroupDate
!=
null
)
RG
+=
"DT"
+
readgroupDate
+
"\\t"
if
(
predictedInsertsize
.
isDefined
)
RG
+=
"PI"
+
predictedInsertsize
.
get
+
"\\t"
return
RG
.
substring
(
0
,
RG
.
lastIndexOf
(
"\\t"
))
}
...
...
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