-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't try to index BAM files that can't be indexed with HTSJDK. #520
Conversation
Codecov Report
@@ Coverage Diff @@
## master #520 +/- ##
==========================================
+ Coverage 95.06% 95.06% +<.01%
==========================================
Files 102 102
Lines 5770 5774 +4
Branches 411 401 -10
==========================================
+ Hits 5485 5489 +4
Misses 285 285
Continue to review full report at Codecov.
|
val hasChromsTooLong = header.getSequenceDictionary.getSequences.exists(_.getSequenceLength > GenomicIndexUtil.BIN_GENOMIC_SPAN) | ||
val wouldHaveIndexed = header.getSortOrder == SortOrder.coordinate && index | ||
if (wouldHaveIndexed && hasChromsTooLong) logger.warning(s"Cannot index $path as one or more chromosomes is too long.") | ||
wouldHaveIndexed && !hasChromsTooLong |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (header.getSortOrder != SortOrder.coordinate || !index) false else {
val hasChromsTooLong = header.getSequenceDictionary.getSequences.forall(_.getSequenceLength <= GenomicIndexUtil.BIN_GENOMIC_SPAN)
if (hasChromsTooLong) logger.warning(s"Cannot index $path as one or more chromosomes is too long.")
hasChromsTooLong
}
@@ -95,6 +95,7 @@ lazy val commonSettings = Seq( | |||
fork in Test := true, | |||
resolvers += Resolver.sonatypeRepo("public"), | |||
resolvers += Resolver.mavenLocal, | |||
resolvers += "broad-snapshots" at "https://artifactory.broadinstitute.org/artifactory/libs-snapshot/", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this to get htsjdk snapshots? Sucks, but I understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is indeed for htsjdk snapshots.
@nh13 The change here is quite simple. HTSJDK blows up if you ask it to index on the fly and hand it reference sequences that are beyond what BAI can handle. There's no CSI writing support yet either.
I'd also like to wait until samtools/htsjdk#1410 is merged, and update our HTSJDK dependency in this same PR if possible.