Skip to content

Commit

Permalink
Remove duplicated variableSamples field (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbimber authored Feb 12, 2024
1 parent e941521 commit ec6e3f9
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ else if (line.getCountType() == VCFHeaderLineCount.INTEGER || line.getCountType(

if (variant.hasGenotypes()) {
variant.getGenotypes().stream().filter(g -> !g.isFiltered() && !g.isNoCall() && g.getAlleles().contains(alt)).map(Genotype::getSampleName).sorted().forEach(sample -> doc.add(new TextField("variableSamples", sample, Field.Store.YES)));
variant.getGenotypes().stream().filter(g -> !g.isFiltered() && !g.isNoCall() && g.getAlleles().contains(alt) && g.isHomVar()).map(Genotype::getSampleName).sorted().forEach(sample -> doc.add(new TextField("homozygousVarSamples", sample, Field.Store.YES)));

long nHet = variant.getGenotypes().stream().filter(g -> !g.isFiltered() && !g.isNoCall() && g.getAlleles().contains(alt) && g.isHet()).count();
doc.add(new IntPoint("nHet", (int)nHet));
Expand All @@ -272,8 +273,6 @@ else if (line.getCountType() == VCFHeaderLineCount.INTEGER || line.getCountType(
float fractionHet = (float) nHet / (float) (nHet + nHomVar);
doc.add(new FloatPoint("fractionHet", fractionHet));
doc.add(new StoredField("fractionHet", fractionHet));

variant.getGenotypes().stream().filter(g -> !g.isFiltered() && !g.isNoCall() && g.getAlleles().contains(alt)).map(Genotype::getSampleName).sorted().forEach(sample -> doc.add(new TextField("variableSamples", sample, Field.Store.YES)));
}

try {
Expand Down

0 comments on commit ec6e3f9

Please sign in to comment.