Skip to content

TASK-5925 - Execute aggregation-family without ArchiveTable for non-gVCF files #288

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

Open
wants to merge 3 commits into
base: release-4.x.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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 @@ -15,7 +15,7 @@ public class VariantDeduplicationTask implements Task<Variant, Variant> {
private final DuplicatedVariantsResolver resolver;
private final CircularSortedArrayQueue<Variant> queue;

private static final Comparator<Variant> VARIANT_COMPARATOR = Comparator
public static final Comparator<Variant> VARIANT_COMPARATOR = Comparator
.comparing(Variant::getChromosome, (chr1, chr2) -> chr1.equals(chr2) ? 0 : -1)
.thenComparing(Variant::getStart)
.thenComparing(Variant::getEnd)
Expand Down Expand Up @@ -44,8 +44,13 @@ public VariantDeduplicationTask(DuplicatedVariantsResolver duplicatedVariantsRes
}

public VariantDeduplicationTask(DuplicatedVariantsResolver duplicatedVariantsResolver, int bufferSize) {
this(duplicatedVariantsResolver, bufferSize, VARIANT_COMPARATOR);
}

public VariantDeduplicationTask(DuplicatedVariantsResolver duplicatedVariantsResolver, int bufferSize,
Comparator<Variant> variantComparator) {
resolver = duplicatedVariantsResolver;
queue = new CircularSortedArrayQueue<>(bufferSize, VARIANT_COMPARATOR);
queue = new CircularSortedArrayQueue<>(bufferSize, variantComparator);
}

@FunctionalInterface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package org.opencb.biodata.tools.variant;

import org.opencb.biodata.models.variant.Variant;

import java.util.Comparator;

/**
* Variant sorter task.
* Perform a minimal sorting on variants.
Expand All @@ -13,4 +17,8 @@ public class VariantSorterTask extends VariantDeduplicationTask {
public VariantSorterTask(int bufferSize) {
super(variants -> variants, bufferSize);
}

public VariantSorterTask(int bufferSize, Comparator<Variant> variantComparator) {
super(variants -> variants, bufferSize, variantComparator);
}
}
Loading