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
564081d7
Commit
564081d7
authored
Jan 18, 2016
by
Wai Yi Leung
Browse files
Update Cutadapt wrapper
parent
defe2788
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/Cutadapt.scala
View file @
564081d7
...
...
@@ -26,9 +26,10 @@ import scala.collection.mutable
import
scala.io.Source
/**
* Extension for cutadept
* Based on version 1.5
*/
* Extension for cutadapt
* Started with version 1.5
* Updated to version 1.9 (18-01-2016 by wyleung)
* */
class
Cutadapt
(
val
root
:
Configurable
)
extends
BiopetCommandLineFunction
with
Summarizable
with
Version
{
@Input
(
doc
=
"Input fastq file"
)
var
fastq_input
:
File
=
_
...
...
@@ -51,19 +52,113 @@ class Cutadapt(val root: Configurable) extends BiopetCommandLineFunction with Su
var
opt_anywhere
:
Set
[
String
]
=
config
(
"anywhere"
,
default
=
Nil
)
var
opt_front
:
Set
[
String
]
=
config
(
"front"
,
default
=
Nil
)
var
errorRate
:
Option
[
Double
]
=
config
(
"error_rate"
)
var
noIndels
:
Boolean
=
config
(
"no_indels"
,
default
=
false
)
var
times
:
Option
[
Int
]
=
config
(
"times"
)
var
overlap
:
Option
[
Int
]
=
config
(
"overlap"
)
var
matchReadWildcards
:
Boolean
=
config
(
"match_read_wildcards"
,
default
=
false
)
var
noMatchAdapterWildcards
:
Boolean
=
config
(
"no_match_adapter_wildcards"
,
default
=
false
)
// specific for 1.9
/** Options for filtering of processed reads */
var
opt_discard
:
Boolean
=
config
(
"discard"
,
default
=
false
)
var
trimmed_only
:
Boolean
=
config
(
"trimmed_only"
,
default
=
false
)
var
opt_minimum_length
:
Int
=
config
(
"minimum_length"
,
1
)
var
opt_maximum_length
:
Option
[
Int
]
=
config
(
"maximum_length"
)
var
noTrim
:
Boolean
=
config
(
"no_trim"
,
default
=
false
)
var
maxN
:
Option
[
Int
]
=
config
(
"max_n"
)
// specific for 1.9
var
maskAdapter
:
Boolean
=
config
(
"mask_adapter"
,
default
=
false
)
/** Options that influence what gets output to where */
var
quiet
:
Boolean
=
config
(
"quiet"
,
default
=
false
)
// var output: File // see up @Output
var
infoFile
:
Option
[
File
]
=
config
(
"info_file"
)
var
restFile
:
Option
[
File
]
=
config
(
"rest_file"
)
var
wildcardFile
:
Option
[
File
]
=
config
(
"wildcard_file"
)
var
tooShortOutput
:
Option
[
File
]
=
config
(
"too_short_output"
)
var
tooLongOutput
:
Option
[
File
]
=
config
(
"too_long_output"
)
var
untrimmedOutput
:
Option
[
File
]
=
config
(
"untrimmed_output"
)
/** Additional read modifications */
var
cut
:
Option
[
Int
]
=
config
(
"cut"
)
var
qualityCutoff
:
Option
[
String
]
=
config
(
"quality_cutoff"
)
var
qualityBase
:
Option
[
Int
]
=
config
(
"quality_base"
)
var
trimN
:
Boolean
=
config
(
"trim_n"
,
default
=
false
)
var
prefix
:
Option
[
String
]
=
config
(
"prefix"
)
var
suffix
:
Option
[
String
]
=
config
(
"suffix"
)
var
stripSuffix
:
Set
[
String
]
=
config
(
"strip_suffix"
)
var
lengthTag
:
Option
[
String
]
=
config
(
"length_tag"
)
/** Colorspace options */
var
colorspace
:
Boolean
=
config
(
"colorspace"
,
default
=
false
)
var
doubleEncode
:
Boolean
=
config
(
"double_encode"
,
default
=
false
)
var
trimPrimer
:
Boolean
=
config
(
"trim_primer"
,
default
=
false
)
var
stripF3
:
Boolean
=
config
(
"strip_f3"
,
default
=
false
)
var
maq
:
Boolean
=
config
(
"maq"
,
default
=
false
)
var
bwa
:
Boolean
=
config
(
"bwa"
,
default
=
false
)
var
noZeroCap
:
Boolean
=
config
(
"no_zero_cap"
,
default
=
false
)
var
zeroCap
:
Boolean
=
config
(
"zero_cap"
,
default
=
false
)
/** Paired end options */
var
peAdapter
:
Set
[
String
]
=
config
(
"pe_adapter"
,
default
=
Nil
)
var
peAdapterFront
:
Set
[
String
]
=
config
(
"pe_adapter_front"
,
default
=
Nil
)
var
peAdapterBoth
:
Set
[
String
]
=
config
(
"pe_adapter_both"
,
default
=
Nil
)
var
peCut
:
Boolean
=
config
(
"pe_cut"
,
default
=
false
)
var
pairedOutput
:
Option
[
File
]
=
config
(
"paired_output"
)
var
interleaved
:
Boolean
=
config
(
"interleaved"
,
default
=
false
)
var
untrimmedPairedOutput
:
Option
[
File
]
=
config
(
"untrimmed_paired_output"
)
/** return commandline to execute */
def
cmdLine
=
required
(
executable
)
+
//
o
ptions
//
O
ptions
that influence how the adapters are found
repeat
(
"-a"
,
opt_adapter
)
+
repeat
(
"-b"
,
opt_anywhere
)
+
repeat
(
"-g"
,
opt_front
)
+
optional
(
"--error-rate"
,
errorRate
)
+
conditional
(
noIndels
,
"--no-indels"
)
+
optional
(
"--times"
,
times
)
+
optional
(
"--overlap"
,
overlap
)
+
conditional
(
matchReadWildcards
,
"--match-read-wildcards"
)
+
conditional
(
noMatchAdapterWildcards
,
"--no-match-adapter-wildcards"
)
+
// Options for filtering of processed reads
conditional
(
opt_discard
,
"--discard"
)
+
conditional
(
trimmed_only
,
"--trimmed-only"
)
+
optional
(
"-m"
,
opt_minimum_length
)
+
optional
(
"-M"
,
opt_maximum_length
)
+
conditional
(
noTrim
,
"--no-trim"
)
+
optional
(
"--max-n"
,
maxN
)
+
conditional
(
maskAdapter
,
"--mask-adapter"
)
+
conditional
(
quiet
,
"--quiet"
)
+
optional
(
"--info-file"
,
infoFile
)
+
optional
(
"--rest-file"
,
restFile
)
+
optional
(
"--wildcard-file"
,
wildcardFile
)
+
optional
(
"--too-short-output"
,
tooShortOutput
)
+
optional
(
"--too-long-output"
,
tooLongOutput
)
+
optional
(
"--untrimmed-output"
,
untrimmedOutput
)
+
// Additional read modifications
optional
(
"--cut"
,
cut
)
+
optional
(
"--quality-cutoff"
,
qualityCutoff
)
+
conditional
(
trimN
,
"--trim-n"
)
+
optional
(
"--prefix"
,
prefix
)
+
optional
(
"--suffix"
,
suffix
)
+
optional
(
"--strip-suffix"
,
stripSuffix
)
+
optional
(
"--length-tag"
,
lengthTag
)
+
// Colorspace options
conditional
(
colorspace
,
"--colorspace"
)
+
conditional
(
doubleEncode
,
"--double-encode"
)
+
conditional
(
trimPrimer
,
"--trim-primer"
)
+
conditional
(
stripF3
,
"--strip-f3"
)
+
conditional
(
maq
,
"--maq"
)
+
conditional
(
bwa
,
"--bwa"
)
+
conditional
(
noZeroCap
,
"--no-zero-cap"
)
+
conditional
(
zeroCap
,
"--zero-cap"
)
+
// Paired-end options
repeat
(
"-A"
,
peAdapter
)
+
repeat
(
"-G"
,
peAdapterFront
)
+
repeat
(
"-B"
,
peAdapterBoth
)
+
conditional
(
interleaved
,
"--interleaved"
)
+
optional
(
"--paired-output"
,
pairedOutput
)
+
optional
(
"--untrimmed-paired-output"
,
untrimmedPairedOutput
)
+
// input / output
required
(
fastq_input
)
+
(
if
(
outputAsStsout
)
""
else
required
(
"--output"
,
fastq_output
)
+
...
...
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