Skip to content

Commit

Permalink
Make SamWriter stop checking sort order when emitting pre-sorted reco…
Browse files Browse the repository at this point in the history
…rds. (#820)
  • Loading branch information
tfenne authored Mar 29, 2022
1 parent bb36b51 commit beecb49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ lazy val root = Project(id="fgbio", base=file("."))
"org.scala-lang.modules" %% "scala-collection-compat" % "2.1.1",
"com.fulcrumgenomics" %% "commons" % "1.4.0",
"com.fulcrumgenomics" %% "sopt" % "1.1.0",
"com.github.samtools" % "htsjdk" % "2.24.1" excludeAll(htsjdkExcludes: _*),
"com.github.samtools" % "htsjdk" % "2.24.1-26-ga38c78d-SNAPSHOT" excludeAll(htsjdkExcludes: _*),
"org.apache.commons" % "commons-math3" % "3.6.1",
"com.beachape" %% "enumeratum" % "1.7.0",
"com.intel.gkl" % "gkl" % "0.8.8",
Expand Down
6 changes: 4 additions & 2 deletions src/main/scala/com/fulcrumgenomics/bam/api/SamWriter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@ object SamWriter extends LazyLogging {
factory.setCreateMd5File(md5)
tmp.foreach(dir => factory.setTempDirectory(dir.toFile))

new SamWriter(writer=factory.makeWriter(header, true, path.toFile, ref.map(_.toFile).orNull),
sorter=sorter, sortProgress=sortProgress, writeProgress=writeProgress)
val htsJdkWriter = factory.makeWriter(header, true, path.toFile, ref.map(_.toFile).orNull)
htsJdkWriter.setSortOrderChecking(false)

new SamWriter(writer=htsJdkWriter, sorter=sorter, sortProgress=sortProgress, writeProgress=writeProgress)
}
}

Expand Down

0 comments on commit beecb49

Please sign in to comment.