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

Completes #5260 on GitHub. #5464

Merged
merged 4 commits into from
Nov 30, 2018
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -5,6 +5,8 @@

import java.util.Set;
import java.util.LinkedHashSet;
import java.util.*;
import java.util.stream.*;

/**
* Keep only variants with any of these IDs.
Expand All @@ -22,6 +24,9 @@ public VariantIDsVariantFilter(Set<String> keepIDs) {

@Override
public boolean test(final VariantContext vc) {
if (vc.getID().indexOf(';') > 0) {
return Arrays.stream(vc.getID().split(";")).anyMatch(includeIDs::contains);
}
return includeIDs.contains(vc.getID());
MartonKN marked this conversation as resolved.
Show resolved Hide resolved
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ public final class HaplotypeCallerEngine implements AssemblyRegionEvaluator {
private static final Allele FAKE_REF_ALLELE = Allele.create("N", true); // used in isActive function to call into UG Engine. Should never appear anywhere in a VCF file
private static final Allele FAKE_ALT_ALLELE = Allele.create("<FAKE_ALT>", false); // used in isActive function to call into UG Engine. Should never appear anywhere in a VCF file

public static final int MINIMUM_READ_LENGTH = 10;
MartonKN marked this conversation as resolved.
Show resolved Hide resolved

/**
* Create and initialize a new HaplotypeCallerEngine given a collection of HaplotypeCaller arguments, a reads header,
* and a reference file
Expand Down Expand Up @@ -523,7 +525,7 @@ public List<VariantContext> callRegion(final AssemblyRegion region, final Featur

final List<VariantContext> givenAlleles = new ArrayList<>();
if ( hcArgs.genotypingOutputMode == GenotypingOutputMode.GENOTYPE_GIVEN_ALLELES ) {
features.getValues(hcArgs.alleles).stream().filter(vc -> hcArgs.genotypeFilteredAlleles || vc.isNotFiltered()).forEach(givenAlleles::add);
features.getValues(hcArgs.alleles).stream().filter(vc -> (hcArgs.genotypeFilteredAlleles || vc.isNotFiltered()) && (vc.getEnd() - vc.getStart() + 1 >= MINIMUM_READ_LENGTH)).forEach(givenAlleles::add);

// No alleles found in this region so nothing to do!
if ( givenAlleles.isEmpty() ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
1 10044557 . C T 62.22 . AF=0.50;AlleleBalance=0.68;DoC=31;HomopolymerRun=16;MAPQ0=0;NS=1;RMSMAPQ=85.34;SB=-0.00;SpanningDeletions=0 GT:DP:GQ ./. ./. 0/1:31:15
1 10045603 . AAAA A 40.26 PASS AF=0.50 GT:DP:GQ 0/1:15:8 0/0:15:8 1/1:15:8
1 10045604 . A ACAT 41.26 PASS AF=0.50 GT:DP:GQ 1/1:14:7 0/0:15:8 1/0:15:8
1 10046982 testid0;testid1 C T 32.01 PASS AF=0.40;AlleleBalance=0.37;DoC=21;HomopolymerRun=0;MAPQ0=8;NS=1;RMSMAPQ=12.31;SB=-4.2;SpanningDeletions=0 GT:DP:GQ 1/0:3:49 ./. ./.
1 10048142 . A G 126.81 foo AF=1.00;DoC=36;HomopolymerRun=4;MAPQ0=0;NS=1;RMSMAPQ=82.11;SB=-85.45;SpanningDeletions=0 GT:DP:GQ 0/1:15:8 0/0:15:8 1/1:15:8
1 10048580 . T A 72.22 bar;baz AF=0.50;AlleleBalance=0.69;DoC=33;HomopolymerRun=6;MAPQ0=0;NS=1;RMSMAPQ=84.45;SB=-27.41;SpanningDeletions=0 GT:DP:GQ 0/1:15:8 0/0:15:8 1/1:15:8
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
##source=ArbitrarySource
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA00001 NA00002 NA00003
1 10001292 testid1 G A 12.22 PASS AF=0.50;AlleleBalance=0.57;DoC=23;HomopolymerRun=0;MAPQ0=8;NS=1;RMSMAPQ=46.31;SB=-24.92;SpanningDeletions=0 GT:DP:GQ 1/0:23:19 ./. ./.
1 10046982 testid0;testid1 C T 32.01 PASS AF=0.40;AlleleBalance=0.37;DoC=21;HomopolymerRun=0;MAPQ0=8;NS=1;RMSMAPQ=12.31;SB=-4.2;SpanningDeletions=0 GT:DP:GQ 1/0:3:49 ./. ./.