Tophat.scala 13.9 KB
Newer Older
1
/**
2
3
4
5
6
7
8
9
10
11
12
13
14
  * Biopet is built on top of GATK Queue for building bioinformatic
  * pipelines. It is mainly intended to support LUMC SHARK cluster which is running
  * SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
  * should also be able to execute Biopet tools and pipelines.
  *
  * Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
  *
  * Contact us at: sasc@lumc.nl
  *
  * A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL
  * license; For commercial users or users who do not want to follow the AGPL
  * license, please contact us to obtain a separate license.
  */
15
16
17
package nl.lumc.sasc.biopet.extensions

import java.io.File
wyleung's avatar
wyleung committed
18

19
import nl.lumc.sasc.biopet.core.{Version, Reference, BiopetCommandLineFunction}
Peter van 't Hof's avatar
Peter van 't Hof committed
20
import nl.lumc.sasc.biopet.utils.config.Configurable
21
import org.broadinstitute.gatk.utils.commandline.{Argument, Input, Output}
wyleung's avatar
wyleung committed
22

Peter van 't Hof's avatar
Peter van 't Hof committed
23
/**
24
25
26
27
28
29
  * Extension for Tophat
  */
class Tophat(val parent: Configurable)
    extends BiopetCommandLineFunction
    with Reference
    with Version {
wyleung's avatar
wyleung committed
30

bow's avatar
bow committed
31
32
  executable = config("exe", default = "tophat", freeVar = false)

33
  def versionRegex = """TopHat v(.*)""".r
Peter van 't Hof's avatar
Peter van 't Hof committed
34
  override def versionExitcode = List(0, 1)
35
  def versionCommand = executable + " --version"
bow's avatar
bow committed
36

Peter van 't Hof's avatar
Peter van 't Hof committed
37
38
  override def defaultCoreMemory = 4.0
  override def defaultThreads = 8
bow's avatar
bow committed
39

40
41
  @Input(doc = "FastQ file(s) R1", shortName = "R1")
  var R1: List[File] = List.empty[File]
wyleung's avatar
wyleung committed
42

43
44
  @Input(doc = "FastQ file(s) R2", shortName = "R2", required = false)
  var R2: List[File] = List.empty[File]
wyleung's avatar
wyleung committed
45

bow's avatar
bow committed
46
  private def checkInputsOk(): Unit =
47
48
    require(R1.nonEmpty && outputDir != null,
            "Read 1 input(s) are defined and output directory is defined")
bow's avatar
bow committed
49

50
51
  /** output files, computed automatically from output directory */
  @Output(doc = "Output SAM/BAM file")
bow's avatar
bow committed
52
53
  lazy val outputAcceptedHits: File = {
    checkInputsOk()
Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
54
    new File(outputDir, if (noConvertBam) "accepted_hits.sam" else "accepted_hits.bam")
bow's avatar
bow committed
55
56
57
58
59
  }

  @Output(doc = "Unmapped SAM/BAM file")
  lazy val outputUnmapped: File = {
    checkInputsOk()
Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
60
    new File(outputDir, if (noConvertBam) "unmapped.sam" else "unmapped.bam")
bow's avatar
bow committed
61
62
63
64
65
  }

  @Output(doc = "Deletions BED file")
  lazy val outputDeletions: File = {
    checkInputsOk()
Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
66
    new File(outputDir, "deletions.bed")
bow's avatar
bow committed
67
68
69
70
71
  }

  @Output(doc = "Insertions BED file")
  lazy val outputInsertions: File = {
    checkInputsOk()
Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
72
    new File(outputDir, "insertions.bed")
bow's avatar
bow committed
73
74
75
76
77
  }

  @Output(doc = "Junctions BED file")
  lazy val outputJunctions: File = {
    checkInputsOk()
Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
78
    new File(outputDir, "junctions.bed")
bow's avatar
bow committed
79
80
81
82
83
  }

  @Output(doc = "Alignment summary file")
  lazy val outputAlignSummary: File = {
    checkInputsOk()
Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
84
    new File(outputDir, "align_summary.txt")
85
86
87
  }

  @Argument(doc = "Bowtie index", shortName = "bti", required = true)
Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
88
  var bowtieIndex: String = config("bowtie_index")
89
90

  /** write all output files to this directory [./] */
Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
91
  var outputDir: File = config("output_dir", default = new File("tophat_out"))
wyleung's avatar
wyleung committed
92

bow's avatar
bow committed
93
  var bowtie1: Boolean = config("bowtie1", default = false)
wyleung's avatar
wyleung committed
94

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
95
  var readMismatches: Option[Int] = config("read_mismatches")
96

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
97
  var readGapLength: Option[Int] = config("read_gap_length")
wyleung's avatar
wyleung committed
98

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
99
  var readEditDist: Option[Int] = config("read_edit_dist")
bow's avatar
bow committed
100

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
101
  var readRealignEditDist: Option[Int] = config("read_realign_edit_dist")
bow's avatar
bow committed
102

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
103
  var minAnchor: Option[Int] = config("min_anchor")
bow's avatar
bow committed
104

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
105
  var spliceMismatches: Option[String] = config("splice_mismatches")
bow's avatar
bow committed
106

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
107
  var minIntronLength: Option[Int] = config("min_intron_length")
bow's avatar
bow committed
108

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
109
  var maxIntronLength: Option[Int] = config("max_intron_length")
bow's avatar
bow committed
110

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
111
  var maxMultihits: Option[Int] = config("max_multihits")
bow's avatar
bow committed
112

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
113
  var suppressHits: Boolean = config("suppress_hits", default = false)
bow's avatar
bow committed
114

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
115
  var transcriptomeMaxHits: Option[Int] = config("transcriptome_max_hits")
bow's avatar
bow committed
116

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
117
  var preFilterMultihits: Boolean = config("prefilter_multihits", default = false)
bow's avatar
bow committed
118

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
119
  var maxInsertionLength: Option[Int] = config("max_insertion_length")
bow's avatar
bow committed
120

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
121
  var maxDeletionLength: Option[Int] = config("max_deletion_length")
bow's avatar
bow committed
122

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
123
  var solexaQuals: Boolean = config("solexa_quals", default = false)
bow's avatar
bow committed
124

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
125
  var solexa13Quals: Boolean = config("solexa1.3_quals", default = false)
bow's avatar
bow committed
126

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
127
  var phred64Quals: Boolean = config("phred64_quals", default = false)
bow's avatar
bow committed
128
129
130

  var quals: Boolean = config("quals", default = false)

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
131
  var integerQuals: Boolean = config("integer_quals", default = false)
bow's avatar
bow committed
132
133
134

  var color: Boolean = config("color", default = false)

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
135
  var colorOut: Boolean = config("color_out", default = false)
bow's avatar
bow committed
136

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
137
  var libraryType: Option[String] = config("library_type")
bow's avatar
bow committed
138
139
140
141
142

  var resume: Option[String] = config("resume")

  var GTF: Option[String] = config("GTF")

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
143
  var transcriptomeIndex: Option[String] = config("transcriptome_index")
bow's avatar
bow committed
144

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
145
  var transcriptomeOnly: Boolean = config("transcriptome_only", default = false)
bow's avatar
bow committed
146

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
147
  var rawJuncs: Option[String] = config("raw_juncs")
bow's avatar
bow committed
148
149
150
151
152

  var insertions: Option[String] = config("insertions")

  var deletions: Option[String] = config("deletions")

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
153
  var mateInnerDist: Option[Int] = config("mate_inner_dist")
bow's avatar
bow committed
154

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
155
  var mateStdDev: Option[Int] = config("mate_std_dev")
bow's avatar
bow committed
156

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
157
  var noNovelJuncs: Boolean = config("no_novel_juncs", default = false)
bow's avatar
bow committed
158

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
159
  var noNovelIndels: Boolean = config("no_novel_indels", default = false)
bow's avatar
bow committed
160

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
161
  var noGtfJuncs: Boolean = config("no_gtf_juncs", default = false)
bow's avatar
bow committed
162

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
163
  var noCoverageSearch: Boolean = config("no_coverage_search", default = false)
bow's avatar
bow committed
164

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
165
  var coverageSearch: Boolean = config("coverage_search", default = false)
bow's avatar
bow committed
166

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
167
  var microexonSearch: Boolean = config("microexon_search", default = false)
bow's avatar
bow committed
168

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
169
  var keepTmp: Boolean = config("keep_tmp", default = false)
bow's avatar
bow committed
170

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
171
  var tmpDir: Option[String] = config("tmp_dir")
bow's avatar
bow committed
172
173
174

  var zpacker: Option[String] = config("zpacker")

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
175
  var unmappedFifo: Boolean = config("unmapped_fifo", default = false)
bow's avatar
bow committed
176

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
177
  var reportSecondaryAlignments: Boolean = config("report_secondary_alignments", default = false)
bow's avatar
bow committed
178

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
179
  var noDiscordant: Boolean = config("no_discordant", default = false)
bow's avatar
bow committed
180

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
181
  var noMixed: Boolean = config("no_mixed", default = false)
bow's avatar
bow committed
182

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
183
  var segmentMismatches: Option[Int] = config("segment_mismatches")
bow's avatar
bow committed
184

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
185
  var segmentLength: Option[Int] = config("segment_length")
bow's avatar
bow committed
186

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
187
  var bowtieN: Boolean = config("bowtie_n", default = false)
bow's avatar
bow committed
188

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
189
  var minCoverageIntron: Option[Int] = config("min_coverage_intron")
bow's avatar
bow committed
190

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
191
  var maxCoverageIntron: Option[Int] = config("max_coverage_intron")
bow's avatar
bow committed
192

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
193
  var minSegmentIntron: Option[Int] = config("min_segment_intron")
bow's avatar
bow committed
194

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
195
  var maxSegmentIntron: Option[Int] = config("max_segment_intron")
bow's avatar
bow committed
196

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
197
  var noSortBam: Boolean = config("no_sort_bam", default = false)
bow's avatar
bow committed
198

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
199
  var noConvertBam: Boolean = config("no_convert_bam", default = false)
bow's avatar
bow committed
200

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
201
  var keepFastaOrder: Boolean = config("keep_fasta_order", default = false)
bow's avatar
bow committed
202

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
203
  var allowPartialMapping: Boolean = config("allow_partial_mapping", default = false)
bow's avatar
bow committed
204

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
205
  var b2VeryFast: Boolean = config("b2_very_fast", default = false)
bow's avatar
bow committed
206

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
207
  var b2Fast: Boolean = config("b2_fast", default = false)
bow's avatar
bow committed
208

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
209
  var b2Sensitive: Boolean = config("b2_sensitive", default = false)
bow's avatar
bow committed
210

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
211
  var b2VerySensitive: Boolean = config("b2_very_sensitive", default = false)
bow's avatar
bow committed
212

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
213
  var b2N: Option[Int] = config("b2_N")
bow's avatar
bow committed
214

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
215
  var b2L: Option[Int] = config("b2_L")
bow's avatar
bow committed
216

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
217
  var b2I: Option[String] = config("b2_i")
bow's avatar
bow committed
218

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
219
  var b2NCeil: Option[String] = config("b2_n_ceil")
bow's avatar
bow committed
220

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
221
  var b2Gbar: Option[Int] = config("b2_gbar")
bow's avatar
bow committed
222

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
223
  var b2Mp: Option[String] = config("b2_mp")
bow's avatar
bow committed
224

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
225
  var b2Np: Option[Int] = config("b2_np")
bow's avatar
bow committed
226

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
227
  var b2Rdg: Option[String] = config("b2_rdg")
bow's avatar
bow committed
228

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
229
  var b2Rfg: Option[String] = config("b2_rfg")
bow's avatar
bow committed
230

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
231
  var b2ScoreMin: Option[String] = config("b2_score_min")
bow's avatar
bow committed
232

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
233
  var b2D: Option[Int] = config("b2_D")
bow's avatar
bow committed
234

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
235
  var b2R: Option[Int] = config("b2_R")
bow's avatar
bow committed
236

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
237
  var fusionSearch: Boolean = config("fusion_search", default = false)
bow's avatar
bow committed
238

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
239
  var fusionAnchorLength: Option[Int] = config("fusion_anchor_length")
bow's avatar
bow committed
240

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
241
  var fusionMinDist: Option[Int] = config("fusion_min_dist")
bow's avatar
bow committed
242

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
243
  var fusionReadMismatches: Option[Int] = config("fusion_read_mismatches")
bow's avatar
bow committed
244

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
245
  var fusionMultireads: Option[Int] = config("fusion_multireads")
bow's avatar
bow committed
246

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
247
  var fusionMultipairs: Option[Int] = config("fusion_multipairs")
bow's avatar
bow committed
248

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
249
  var fusionIgnoreChromosomes: Option[String] = config("fusion_ignore_chromosomes")
bow's avatar
bow committed
250

251
252
  var fusionDoNotResolveConflicts: Boolean =
    config("fusion_do_not_resolve_conflicts", default = false)
bow's avatar
bow committed
253

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
254
  var rgId: Option[String] = config("rg_id")
bow's avatar
bow committed
255

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
256
  var rgSample: Option[String] = config("rg_sample")
bow's avatar
bow committed
257

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
258
  var rgLibrary: Option[String] = config("rg_library")
bow's avatar
bow committed
259

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
260
  var rgDescription: Option[String] = config("rg_description")
bow's avatar
bow committed
261

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
262
  var rgPlatformUnit: Option[String] = config("rg_platform_unit")
bow's avatar
bow committed
263

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
264
  var rgCenter: Option[String] = config("rg_center")
bow's avatar
bow committed
265

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
266
  var rgDate: Option[String] = config("rg_date")
wyleung's avatar
wyleung committed
267

Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
268
  var rgPlatform: Option[String] = config("rg_platform")
wyleung's avatar
wyleung committed
269

270
271
  override def beforeGraph: Unit = {
    super.beforeGraph
272
273
274
275
276
    if (bowtie1 && !new File(bowtieIndex).getParentFile
          .list()
          .toList
          .filter(_.startsWith(new File(bowtieIndex).getName))
          .exists(_.endsWith(".ebwt")))
277
      throw new IllegalArgumentException("No bowtie1 index found for tophat")
278
279
280
281
282
    else if (!new File(bowtieIndex).getParentFile
               .list()
               .toList
               .filter(_.startsWith(new File(bowtieIndex).getName))
               .exists(_.endsWith(".bt2")))
283
      throw new IllegalArgumentException("No bowtie2 index found for tophat")
284
285
286
    if (R2.nonEmpty && mateInnerDist.isEmpty) {
      logger.warn("The parameter 'mate_inner_dist' is not set in the configuration, TopHat will use it's default value - 50bp, please check if this value for inner mate distance is correct for the current data.")
    }
287
288
  }

289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
  def cmdLine: String =
    required(executable) +
      optional("-o", outputDir) +
      conditional(bowtie1, "--bowtie1") +
      optional("--read-mismatches", readMismatches) +
      optional("--read-gap-length", readGapLength) +
      optional("--read-edit-dist", readEditDist) +
      optional("--read-realign-edit-dist", readRealignEditDist) +
      optional("--min-anchor", minAnchor) +
      optional("--splice-mismatches", spliceMismatches) +
      optional("--min-intron-length", minIntronLength) +
      optional("--max-intron-length", maxIntronLength) +
      optional("--max-multihits", maxMultihits) +
      conditional(suppressHits, "--suppress-hits") +
      optional("--transcriptome-max-hits", transcriptomeMaxHits) +
      conditional(preFilterMultihits, "--prefilter-multihits") +
      optional("--max-insertion-length", maxInsertionLength) +
      optional("--max-deletion-length", maxDeletionLength) +
      conditional(solexaQuals, "--solexa-quals") +
      conditional(solexa13Quals, "--solexa1.3-quals") +
      conditional(phred64Quals, "--phred64-quals") +
      conditional(quals, "--quals") +
      conditional(integerQuals, "--integer-quals") +
      conditional(color, "--color") +
      conditional(colorOut, "--color-out") +
      optional("--library-type", libraryType) +
      optional("--num-threads", threads) +
      optional("--resume", resume) +
      optional("--GTF", GTF) +
      optional("--transcriptome-index", transcriptomeIndex) +
      conditional(transcriptomeOnly, "--transcriptome-only") +
      optional("--raw-juncs", rawJuncs) +
      optional("--insertions", insertions) +
      optional("--deletions", deletions) +
      optional("--mate-inner-dist", mateInnerDist) +
      optional("--mate-std-dev", mateStdDev) +
      conditional(noNovelJuncs, "--no-novel-juncs") +
      conditional(noNovelIndels, "--no-novel-indels") +
      conditional(noGtfJuncs, "--no-gtf-juncs") +
      conditional(noCoverageSearch, "--no-coverage-search") +
      conditional(coverageSearch, "--coverage-search") +
      conditional(microexonSearch, "--microexon-search") +
      conditional(keepTmp, "--keep-tmp") +
      optional("--tmp-dir", tmpDir) +
      optional("--zpacker", zpacker) +
      conditional(unmappedFifo, "--unmapped-fifo") +
      conditional(reportSecondaryAlignments, "--report-secondary-alignments") +
      conditional(noDiscordant, "--no-discordant") +
      conditional(noMixed, "--no-mixed") +
      optional("--segment-mismatches", segmentMismatches) +
      optional("--segment-length", segmentLength) +
      conditional(bowtieN, "--bowtie-n") +
      optional("--min-coverage-intron", minCoverageIntron) +
      optional("--max-coverage-intron", maxCoverageIntron) +
      optional("--min-segment-intron", minSegmentIntron) +
      optional("--max-segment-intron", maxSegmentIntron) +
      conditional(noSortBam, "--no-sort-bam") +
      conditional(noConvertBam, "--no-convert-bam") +
      conditional(keepFastaOrder, "--keep-fasta-order") +
      conditional(allowPartialMapping, "--allow-partial-mapping") +
      conditional(b2VeryFast, "--b2-very-fast") +
      conditional(b2Fast, "--b2-fast") +
      conditional(b2Sensitive, "--b2-sensitive") +
      conditional(b2VerySensitive, "--b2-very-sensitive") +
      optional("--b2-N", b2N) +
      optional("--b2-L", b2L) +
      optional("--b2-i", b2I) +
      optional("--b2-n-ceil", b2NCeil) +
      optional("--b2-gbar", b2Gbar) +
      optional("--b2-mp", b2Mp) +
      optional("--b2-np", b2Np) +
      optional("--b2-rdg", b2Rdg) +
      optional("--b2-rfg", b2Rfg) +
      optional("--b2-score-min", b2ScoreMin) +
      optional("--b2-D", b2D) +
      optional("--b2-R", b2R) +
      conditional(fusionSearch, "--fusion-search") +
      optional("--fusion-anchor-length", fusionAnchorLength) +
      optional("--fusion-min-dist", fusionMinDist) +
      optional("--fusion-read-mismatches", fusionReadMismatches) +
      optional("--fusion-multireads", fusionMultireads) +
      optional("--fusion-multipairs", fusionMultipairs) +
      optional("--fusion-ignore-chromosomes", fusionIgnoreChromosomes) +
      conditional(fusionDoNotResolveConflicts, "--fusion-do-not-resolve-conflicts") +
      optional("--rg-id", rgId) +
      optional("--rg-sample", rgSample) +
      optional("--rg-library", rgLibrary) +
      optional("--rg-description", rgDescription) +
      optional("--rg-platform-unit", rgPlatformUnit) +
      optional("--rg-center", rgCenter) +
      optional("--rg-date", rgDate) +
      optional("--rg-platform", rgPlatform) +
      required(bowtieIndex) +
      required(R1.mkString(",")) +
      optional(R2.mkString(","))
wyleung's avatar
wyleung committed
384
}