Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Expose sort option in picard FastqToSam task (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhipp authored Jul 22, 2021
1 parent 58065bf commit f639abd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tasks/src/main/scala/dagr/tasks/picard/FastqToSam.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import dagr.tasks.DataTypes.{Fastq, SamOrBam}
import dagr.tasks.DagrDef
import DagrDef.{PathToBam, PathToFastq}
import dagr.core.execsystem.{Cores, Memory}
import htsjdk.samtools.SAMFileHeader.SortOrder
import htsjdk.samtools.util.FastqQualityFormat

import scala.collection.mutable.ListBuffer
Expand All @@ -42,7 +43,8 @@ class FastqToSam(fastq1: PathToFastq,
readGroupName: Option[String] = None,
stripUnpairedMateNumber: Boolean = true,
useSequentialFastqs: Boolean = false,
qualityFormat: Option[FastqQualityFormat] = None)
qualityFormat: Option[FastqQualityFormat] = None,
sortOrder: Option[SortOrder] = Some(SortOrder.queryname))
extends PicardTask with Pipe[Fastq,SamOrBam] {
requires(Cores(1), Memory("2G"))

Expand All @@ -59,6 +61,6 @@ class FastqToSam(fastq1: PathToFastq,
library.foreach(lb => buffer.append("LB=" + lb))
if (useSequentialFastqs) buffer.append("USE_SEQUENTIAL_FASTQS=true")
buffer.append("STRIP_UNPAIRED_MATE_NUMBER=" + stripUnpairedMateNumber)
buffer.append("SO=queryname")
sortOrder.foreach(so => buffer.append("SO=" + so.name))
}
}

0 comments on commit f639abd

Please sign in to comment.