Skip to content
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

Bump htsjdk to 3.0.3 #884

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,38 +32,28 @@ object JointVariantContextIterator {
def apply(iters: Seq[Iterator[VariantContext]],
dict: SequenceDictionary
): JointVariantContextIterator = {
new JointVariantContextIterator(
iters=iters,
dictOrComp = Left(dict)
)
new JointVariantContextIterator(iters = iters, dict = dict)
}

@deprecated("VariantContextComparator will no longer compare variant contexts on location alone.")
def apply(iters: Seq[Iterator[VariantContext]],
Copy link
Member Author

@clintval clintval Nov 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entrypoint was never used in this codebase. And it is no longer possible to use VariantContextComparator since it compares variants beyond location alone (source). Seems like my only option is deprecation and raising an exception.

comp: VariantContextComparator
): JointVariantContextIterator = {
new JointVariantContextIterator(
iters=iters,
dictOrComp = Right(comp)
)
throw new NotImplementedError("VariantContextComparator class can no longer order variant contexts on location alone.")
}
}

/**
* Iterates over multiple variant context iterators such that we return a list of contexts for the union of sites
* across the iterators. If samples is given, we subset each variant context to just that sample.
*/
class JointVariantContextIterator private(iters: Seq[Iterator[VariantContext]],
dictOrComp: Either[SequenceDictionary, VariantContextComparator]
)
class JointVariantContextIterator private(iters: Seq[Iterator[VariantContext]], dict: SequenceDictionary)
extends Iterator[Seq[Option[VariantContext]]] {

if (iters.isEmpty) throw new IllegalArgumentException("No iterators given")

private val iterators = iters.map(_.buffered)
private val ordering = dictOrComp match {
case Left(dict) => LocatableOrdering(dict)
case Right(comp) => comp
}
private val ordering = LocatableOrdering(dict)

def hasNext: Boolean = iterators.exists(_.nonEmpty)

Expand Down