From ec6e3f9ae0621eee7a84b56942d47dfd6fabff7e Mon Sep 17 00:00:00 2001 From: bbimber Date: Mon, 12 Feb 2024 16:33:13 -0600 Subject: [PATCH] Remove duplicated variableSamples field (#304) --- .../java/com/github/discvrseq/walkers/VcfToLuceneIndexer.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/github/discvrseq/walkers/VcfToLuceneIndexer.java b/src/main/java/com/github/discvrseq/walkers/VcfToLuceneIndexer.java index 9747bc10..66307fd7 100644 --- a/src/main/java/com/github/discvrseq/walkers/VcfToLuceneIndexer.java +++ b/src/main/java/com/github/discvrseq/walkers/VcfToLuceneIndexer.java @@ -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)); @@ -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 {