From ef0d1cb6cd93f2747e360445268c39852593120d Mon Sep 17 00:00:00 2001 From: bbimber Date: Wed, 6 Dec 2023 11:06:11 -0800 Subject: [PATCH 01/10] Improve handling of mGAP releases with or without lucene indexes --- .../src/org/labkey/jbrowse/model/JsonFile.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/jbrowse/src/org/labkey/jbrowse/model/JsonFile.java b/jbrowse/src/org/labkey/jbrowse/model/JsonFile.java index 8d0136f2b..d17f3bafa 100644 --- a/jbrowse/src/org/labkey/jbrowse/model/JsonFile.java +++ b/jbrowse/src/org/labkey/jbrowse/model/JsonFile.java @@ -964,10 +964,23 @@ public File prepareResource(User u, Logger log, boolean throwIfNotPrepared, bool } else if (existingLuceneDir != null && existingLuceneDir.exists()) { + if (doesLuceneIndexExist()) + { + log.info("Deleting existing lucene index dir: " + luceneDir.getPath()); + try + { + FileUtils.deleteDirectory(luceneDir); + } + catch (IOException e) + { + throw new PipelineJobException(e); + } + } + log.debug("Creating symlink to existing index: " + existingLuceneDir.getPath()); try { - Files.createSymbolicLink(existingLuceneDir.toPath(), existingLuceneDir.toPath()); + Files.createSymbolicLink(existingLuceneDir.toPath(), luceneDir.toPath()); } catch (IOException e) { From 77d08dc7a2a7ef353613c43dfd9671e52fac2791 Mon Sep 17 00:00:00 2001 From: bbimber Date: Wed, 6 Dec 2023 15:39:25 -0800 Subject: [PATCH 02/10] Bugfixes around mGAP lucene indexes --- jbrowse/src/org/labkey/jbrowse/model/JsonFile.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jbrowse/src/org/labkey/jbrowse/model/JsonFile.java b/jbrowse/src/org/labkey/jbrowse/model/JsonFile.java index d17f3bafa..aeae248f2 100644 --- a/jbrowse/src/org/labkey/jbrowse/model/JsonFile.java +++ b/jbrowse/src/org/labkey/jbrowse/model/JsonFile.java @@ -980,7 +980,7 @@ else if (existingLuceneDir != null && existingLuceneDir.exists()) log.debug("Creating symlink to existing index: " + existingLuceneDir.getPath()); try { - Files.createSymbolicLink(existingLuceneDir.toPath(), luceneDir.toPath()); + Files.createSymbolicLink(luceneDir.toPath(), existingLuceneDir.toPath()); } catch (IOException e) { From e9121a6ed0b2f49f959db40c9ee8856b662d6a16 Mon Sep 17 00:00:00 2001 From: bbimber Date: Wed, 6 Dec 2023 17:06:56 -0800 Subject: [PATCH 03/10] Bugfixes around JBrowse and lucene indexes --- .../run/RestoreSraDataHandler.java | 22 ++++++++++++++----- .../org/labkey/jbrowse/model/JsonFile.java | 11 +++++++++- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/SequenceAnalysis/src/org/labkey/sequenceanalysis/run/RestoreSraDataHandler.java b/SequenceAnalysis/src/org/labkey/sequenceanalysis/run/RestoreSraDataHandler.java index 0cf3fd015..8f6a28ca8 100644 --- a/SequenceAnalysis/src/org/labkey/sequenceanalysis/run/RestoreSraDataHandler.java +++ b/SequenceAnalysis/src/org/labkey/sequenceanalysis/run/RestoreSraDataHandler.java @@ -307,15 +307,18 @@ public void complete(PipelineJob job, List readsets, List toAdd = new ArrayList<>(rd.getFileId1()); if (rd.getFileId2() != null) { toAdd.add(rd.getFileId2()); } + job.getLogger().debug("adding metrics for " + toAdd.size() + " total fastq files"); for (int dataId : toAdd) { //then delete/add: + job.getLogger().debug("adding metrics for: " + dataId); ReadsetCreationTask.addQualityMetricsForReadset(rs, dataId, job, true); } } @@ -332,15 +335,22 @@ public void complete(PipelineJob job, List readsets, List Date: Thu, 7 Dec 2023 06:31:44 -0800 Subject: [PATCH 04/10] Bugfix to CalculateGeneComponentScores when selecting multiple components --- jbrowse/src/org/labkey/jbrowse/JBrowseLuceneSearch.java | 7 ++++--- singlecell/resources/chunks/CalculateGeneComponentScores.R | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/jbrowse/src/org/labkey/jbrowse/JBrowseLuceneSearch.java b/jbrowse/src/org/labkey/jbrowse/JBrowseLuceneSearch.java index 8a306ca01..0459b4b36 100644 --- a/jbrowse/src/org/labkey/jbrowse/JBrowseLuceneSearch.java +++ b/jbrowse/src/org/labkey/jbrowse/JBrowseLuceneSearch.java @@ -105,7 +105,7 @@ private String tryUrlDecode(String input) { //special case for urls containing +; this isn't necessary for strings sent from the client-side, but URLs //sent via unit tests autodecode, and strings containing + rather than the URL-encoded symbol are unsafe //to pass through URLDecoded.decode - if(input.contains("+")) { + if (input.contains("+")) { return input; } @@ -202,7 +202,7 @@ public JSONObject doSearch(User u, String searchString, final int pageSize, fina { query = queryParser.parse(queryString); } - else if(numericQueryParserFields.contains(fieldName)) + else if (numericQueryParserFields.contains(fieldName)) { try { @@ -212,7 +212,8 @@ else if(numericQueryParserFields.contains(fieldName)) { e.printStackTrace(); } - } else + } + else { throw new IllegalArgumentException("No such field(s), or malformed query."); } diff --git a/singlecell/resources/chunks/CalculateGeneComponentScores.R b/singlecell/resources/chunks/CalculateGeneComponentScores.R index 2c305aafa..f49d12043 100644 --- a/singlecell/resources/chunks/CalculateGeneComponentScores.R +++ b/singlecell/resources/chunks/CalculateGeneComponentScores.R @@ -2,7 +2,9 @@ for (datasetId in names(seuratObjects)) { printName(datasetId) seuratObj <- readSeuratRDS(seuratObjects[[datasetId]]) - seuratObj <- RIRA::ScoreUsingSavedComponent(seuratObj, componentOrName = savedComponent, fieldName = savedComponent) + for (sc in savedComponent) { + seuratObj <- RIRA::ScoreUsingSavedComponent(seuratObj, componentOrName = sc, fieldName = sc) + } saveData(seuratObj, datasetId) From a7b31b6f7bb0c40f8b7bb3f3230b1928ddb543db Mon Sep 17 00:00:00 2001 From: bbimber Date: Thu, 7 Dec 2023 11:42:19 -0800 Subject: [PATCH 05/10] Change default on cell hashing params --- .../src/org/labkey/singlecell/CellHashingServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/singlecell/src/org/labkey/singlecell/CellHashingServiceImpl.java b/singlecell/src/org/labkey/singlecell/CellHashingServiceImpl.java index 3b4716835..4657ddf8f 100644 --- a/singlecell/src/org/labkey/singlecell/CellHashingServiceImpl.java +++ b/singlecell/src/org/labkey/singlecell/CellHashingServiceImpl.java @@ -953,7 +953,9 @@ public List getHashingCallingParams(boolean allowMethod ToolParameterDescriptor.create("skipNormalizationQc", "Skip Normalization QC", null, "checkbox", null, true), ToolParameterDescriptor.create("doTSNE", "Do tSNE", "If true, tSNE will be performed as part of QC", "checkbox", null, true), ToolParameterDescriptor.create("retainRawCountFile", "Retain Raw Counts File", null, "checkbox", null, false), - ToolParameterDescriptor.create("failIfUnexpectedHtosFound", "Fail If Unexpected HTOs Found", "If checked and if there are any HTOs (testing all known HTOs) with counts above the HTOs expected in this experiment, then an error will be thrown", "checkbox", null, false) + ToolParameterDescriptor.create("failIfUnexpectedHtosFound", "Fail If Unexpected HTOs Found", "If checked and if there are any HTOs (testing all known HTOs) with counts above the HTOs expected in this experiment, then an error will be thrown", "checkbox", new JSONObject(){{ + put("checked", true); + }}, true) )); final List allMethods = Arrays.stream(CALLING_METHOD.values()).filter(x -> allowMethodsNeedingGex || !x.isRequiresH5()).map(Enum::name).toList(); From ffdfc6fbec650e3635466458ea31e23a5d4b12e9 Mon Sep 17 00:00:00 2001 From: bbimber Date: Mon, 11 Dec 2023 10:10:58 -0800 Subject: [PATCH 06/10] Also copy VCF index to local cache dir if using a VCF --- .../labkey/sequenceanalysis/ScatterGatherUtils.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SequenceAnalysis/src/org/labkey/sequenceanalysis/ScatterGatherUtils.java b/SequenceAnalysis/src/org/labkey/sequenceanalysis/ScatterGatherUtils.java index f2a799e43..ded2f7cf0 100644 --- a/SequenceAnalysis/src/org/labkey/sequenceanalysis/ScatterGatherUtils.java +++ b/SequenceAnalysis/src/org/labkey/sequenceanalysis/ScatterGatherUtils.java @@ -54,6 +54,17 @@ public static void possiblyCacheSupportFiles(SequenceOutputHandler.JobContext ct try { FileUtils.copyFile(inputFile, localCopy); + if (inputFile.getPath().toLowerCase().endsWith("vcf.gz")) + { + File inputFileIdx = new File(inputFile.getPath() + ".tbi"); + File localCopyIdx = new File(ScatterGatherUtils.getLocalCopyDir(ctx, true), inputFile.getName() + ".tbi"); + if (!inputFileIdx.exists()) + { + throw new PipelineJobException("Unable to find file: " + inputFileIdx.getPath()); + } + + FileUtils.copyFile(inputFileIdx, localCopyIdx); + } FileUtils.touch(doneFile); } catch (IOException e) From 66e70e92bc26055b11bd3d0fbf895f6483d0bde7 Mon Sep 17 00:00:00 2001 From: bbimber Date: Mon, 11 Dec 2023 13:27:49 -0800 Subject: [PATCH 07/10] Allow SnpEff to be optional in LoFreq pipeline --- .../run/analysis/LofreqAnalysis.java | 45 ++++++++++++------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/SequenceAnalysis/src/org/labkey/sequenceanalysis/run/analysis/LofreqAnalysis.java b/SequenceAnalysis/src/org/labkey/sequenceanalysis/run/analysis/LofreqAnalysis.java index 7abaa1bb5..561b7cf7d 100644 --- a/SequenceAnalysis/src/org/labkey/sequenceanalysis/run/analysis/LofreqAnalysis.java +++ b/SequenceAnalysis/src/org/labkey/sequenceanalysis/run/analysis/LofreqAnalysis.java @@ -94,7 +94,7 @@ public class LofreqAnalysis extends AbstractCommandPipelineStep provider, PipelineContext ctx) { super(provider, ctx, new LofreqWrapper(ctx.getLogger())); } @@ -108,7 +108,7 @@ public Provider() {{ put("extensions", Arrays.asList("gtf", "gff", "gbk")); put("width", 400); - put("allowBlank", false); + put("allowBlank", true); }}, null), ToolParameterDescriptor.create("minCoverage", "Min Coverage For Consensus", "If provided, a consensus will only be called over regions with at least this depth", "ldk-integerfield", new JSONObject(){{ put("minValue", 0); @@ -212,7 +212,6 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc File outputVcfRaw = new File(outputDir, FileUtil.getBaseName(inputBam) + ".lofreq.vcf.gz"); File outputVcfFiltered = new File(outputDir, FileUtil.getBaseName(inputBam) + ".lofreq.filtered.vcf.gz"); - File outputVcfSnpEff = new File(outputDir, FileUtil.getBaseName(inputBam) + ".lofreq.snpeff.vcf.gz"); //LoFreq call getWrapper().execute(inputBam, outputVcfRaw, referenceGenome.getWorkingFastaFile(), SequencePipelineService.get().getMaxThreads(getPipelineCtx().getLogger())); @@ -222,6 +221,9 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc output.addIntermediateFile(outputVcfRaw); output.addIntermediateFile(new File(outputVcfRaw.getPath() + ".tbi")); + output.addIntermediateFile(outputVcfFiltered); + output.addIntermediateFile(new File(outputVcfFiltered.getPath() + ".tbi")); + //Add depth for downstream use: File coverageOut = new File(outputDir, SequenceAnalysisService.get().getUnzippedBaseName(outputVcfRaw.getName()) + ".coverage"); runDepthOfCoverage(getPipelineCtx(), output, outputDir, referenceGenome, inputBam, coverageOut); @@ -438,24 +440,35 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc } //SnpEff: + File activeVCF = outputVcfFiltered; Integer geneFileId = getProvider().getParameterByName(SNPEffStep.GENE_PARAM).extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), Integer.class); - File snpEffBaseDir = SNPEffStep.checkOrCreateIndex(getPipelineCtx().getSequenceSupport(), getPipelineCtx().getLogger(), referenceGenome, geneFileId); + if (geneFileId != null) + { + File outputVcfSnpEff = new File(outputDir, FileUtil.getBaseName(inputBam) + ".lofreq.snpeff.vcf.gz"); - SnpEffWrapper snpEffWrapper = new SnpEffWrapper(getPipelineCtx().getLogger()); - snpEffWrapper.runSnpEff(referenceGenome.getGenomeId(), geneFileId, snpEffBaseDir, outputVcfFiltered, outputVcfSnpEff, null); + File snpEffBaseDir = SNPEffStep.checkOrCreateIndex(getPipelineCtx().getSequenceSupport(), getPipelineCtx().getLogger(), referenceGenome, geneFileId); + SnpEffWrapper snpEffWrapper = new SnpEffWrapper(getPipelineCtx().getLogger()); + snpEffWrapper.runSnpEff(referenceGenome.getGenomeId(), geneFileId, snpEffBaseDir, outputVcfFiltered, outputVcfSnpEff, null); - try - { - SequenceAnalysisService.get().ensureVcfIndex(outputVcfSnpEff, getPipelineCtx().getLogger()); + try + { + SequenceAnalysisService.get().ensureVcfIndex(outputVcfSnpEff, getPipelineCtx().getLogger()); + } + catch (IOException e) + { + throw new PipelineJobException(e); + } + + output.addIntermediateFile(outputVcfSnpEff); + output.addIntermediateFile(new File(outputVcfSnpEff.getPath() + ".tbi")); + + activeVCF = outputVcfSnpEff; } - catch (IOException e) + else { - throw new PipelineJobException(e); + getPipelineCtx().getLogger().info("No GTF provided, skipping SnpEff"); } - output.addIntermediateFile(outputVcfFiltered); - output.addIntermediateFile(new File(outputVcfFiltered.getPath() + ".tbi")); - double minFractionForConsensus = getProvider().getParameterByName("minFractionForConsensus").extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), Double.class, 0.0); Integer primerDataId = getProvider().getParameterByName("primerBedFile").extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), Integer.class); @@ -508,7 +521,7 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc SAMSequenceDictionary dict = SAMSequenceDictionaryExtractor.extractDictionary(referenceGenome.getSequenceDictionary().toPath()); VariantContextWriterBuilder writerBuilderConsensus = new VariantContextWriterBuilder().setOutputFile(loFreqConsensusVcf).setReferenceDictionary(dict); VariantContextWriterBuilder writerBuilderAll = new VariantContextWriterBuilder().setOutputFile(loFreqAllVcf).setReferenceDictionary(dict); - try (VCFFileReader reader = new VCFFileReader(outputVcfSnpEff);CloseableIterator it = reader.iterator();VariantContextWriter writerConsensus = writerBuilderConsensus.build();VariantContextWriter writerAll = writerBuilderAll.build()) + try (VCFFileReader reader = new VCFFileReader(activeVCF);CloseableIterator it = reader.iterator();VariantContextWriter writerConsensus = writerBuilderConsensus.build();VariantContextWriter writerAll = writerBuilderAll.build()) { VCFHeader header = reader.getFileHeader(); @@ -706,8 +719,6 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc getPipelineCtx().getLogger().warn("Consensus ambiguities from bcftools and lofreq did not match: " + bcfToolsConsensusNs + " / " + lofreqConsensusNs); } - output.addIntermediateFile(outputVcfSnpEff); - output.addIntermediateFile(new File(outputVcfSnpEff.getPath() + ".tbi")); output.addSequenceOutput(coverageOut, "Depth of Coverage: " + rs.getName(), "Depth of Coverage", rs.getReadsetId(), null, referenceGenome.getGenomeId(), null); output.addSequenceOutput(consensusFastaLoFreq, "Consensus: " + rs.getName(), "Viral Consensus Sequence", rs.getReadsetId(), null, referenceGenome.getGenomeId(), description); From 310020e2394bcaad82f4b1d3f5a8e4d665c0b901 Mon Sep 17 00:00:00 2001 From: bbimber Date: Tue, 12 Dec 2023 10:17:07 -0800 Subject: [PATCH 08/10] Reduce maintenance job warning --- .../sequenceanalysis/SequenceAnalysisMaintenanceTask.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SequenceAnalysis/src/org/labkey/sequenceanalysis/SequenceAnalysisMaintenanceTask.java b/SequenceAnalysis/src/org/labkey/sequenceanalysis/SequenceAnalysisMaintenanceTask.java index 637752206..8a0d749c0 100644 --- a/SequenceAnalysis/src/org/labkey/sequenceanalysis/SequenceAnalysisMaintenanceTask.java +++ b/SequenceAnalysis/src/org/labkey/sequenceanalysis/SequenceAnalysisMaintenanceTask.java @@ -172,7 +172,8 @@ else if (!d.getFile().exists()) { if (d != null && d.getFile() != null && d.getFile().exists()) { - log.error("ReadData marked as archived, but file exists: " + rd.getRowid() + ", " + rd.getFileId1() + ", " + d.getFile().getPath() + " for container: " + (c == null ? rd.getContainer() : c.getPath())); + // NOTE: ultimately remove this: + log.info("ReadData marked as archived, but file exists: " + rd.getRowid() + ", " + rd.getFileId1() + ", " + d.getFile().getPath() + " for container: " + (c == null ? rd.getContainer() : c.getPath())); } } } From 7e4c1bc8093939978e9590fc99b76283e7eea412 Mon Sep 17 00:00:00 2001 From: bbimber Date: Thu, 14 Dec 2023 07:48:31 -0800 Subject: [PATCH 09/10] Remove flags from bcftools install --- SequenceAnalysis/pipeline_code/sequence_tools_install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SequenceAnalysis/pipeline_code/sequence_tools_install.sh b/SequenceAnalysis/pipeline_code/sequence_tools_install.sh index bc3adf8a8..feef079c7 100755 --- a/SequenceAnalysis/pipeline_code/sequence_tools_install.sh +++ b/SequenceAnalysis/pipeline_code/sequence_tools_install.sh @@ -512,13 +512,12 @@ then wget $WGET_OPTS https://github.com/samtools/bcftools/releases/download/1.18/bcftools-1.18.tar.bz2 tar xjvf bcftools-1.18.tar.bz2 - bzip2 bcftools-1.18.tar chmod 755 bcftools-1.18 cd bcftools-1.18 rm -f plugins/liftover.c wget $WGET_OPTS -P plugins https://raw.githubusercontent.com/freeseek/score/master/liftover.c - ./configure CFLAGS="-g -Wall -O2 -std=c99" + ./configure make install ./bcftools $LKTOOLS_DIR From b4bcf0915b69923719961f5e386b7945479a52be Mon Sep 17 00:00:00 2001 From: hextraza Date: Thu, 14 Dec 2023 07:49:54 -0800 Subject: [PATCH 10/10] Refactor field regex (#253) * Add extractFieldName instead of regex * Add API unit and selenium tests --------- Co-authored-by: Sebastian Benjamin Co-authored-by: bbimber --- .../VariantSearch/components/FilterForm.tsx | 3 + .../labkey/jbrowse/JBrowseLuceneSearch.java | 27 +- .../external/labModules/JBrowseTest.java | 248 ++++++++++++++++-- 3 files changed, 243 insertions(+), 35 deletions(-) diff --git a/jbrowse/src/client/JBrowse/VariantSearch/components/FilterForm.tsx b/jbrowse/src/client/JBrowse/VariantSearch/components/FilterForm.tsx index c2e86e5a6..977324dc7 100644 --- a/jbrowse/src/client/JBrowse/VariantSearch/components/FilterForm.tsx +++ b/jbrowse/src/client/JBrowse/VariantSearch/components/FilterForm.tsx @@ -265,6 +265,7 @@ const FilterForm = (props: FilterFormProps ) => { Value @@ -321,6 +323,7 @@ const FilterForm = (props: FilterFormProps ) => { ) : ( 0 ? parts[0].trim() : null; + } public JSONObject doSearch(User u, String searchString, final int pageSize, final int offset) throws IOException, ParseException { @@ -180,18 +194,7 @@ public JSONObject doSearch(User u, String searchString, final int pageSize, fina String queryString = tokenizer.nextToken(); Query query = null; - // Type is defined by the first field in the lucene query - // "First" field is defined by getting the first consecutive string of ASCII characters or underscores terminated by a colon - // we might just want to return the field(s) in the form instead - Pattern pattern = Pattern.compile("[\\p{ASCII}&&[^\\s:*+-]][\\p{ASCII}&&[^:\\p{Punct}*]]*:"); - - Matcher matcher = pattern.matcher(queryString); - - String fieldName = null; - if (matcher.find()) - { - fieldName = matcher.group().substring(0, matcher.group().length() - 1); - } + String fieldName = extractFieldName(queryString); if (VARIABLE_SAMPLES.equals(fieldName)) { diff --git a/jbrowse/test/src/org/labkey/test/tests/external/labModules/JBrowseTest.java b/jbrowse/test/src/org/labkey/test/tests/external/labModules/JBrowseTest.java index d5dceb55e..7661f9f11 100644 --- a/jbrowse/test/src/org/labkey/test/tests/external/labModules/JBrowseTest.java +++ b/jbrowse/test/src/org/labkey/test/tests/external/labModules/JBrowseTest.java @@ -1525,24 +1525,17 @@ private void testLuceneSearchUI(String sessionId) openTrackMenuItem("Variant Search", true); - // Now test UI: - waitForElement(Locator.tagWithText("span", "0.029")); - + // VariableSamples in set !TestGroup! waitAndClick(Locator.tagWithText("button", "Search")); waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); - waitForElement(Locator.tagWithText("li", "Ref Allele")).click(); - + waitForElement(Locator.tagWithText("li", "Samples With Variant")).click(); waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); - waitForElement(Locator.tagWithText("li", "equals")).click(); - - waitForElement(Locator.tagWithClass("input", "MuiInputBase-inputSizeSmall")).sendKeys("C"); - + waitForElement(Locator.tagWithText("li", "in set")).click(); + waitForElement(Locator.tagWithId("div", "value-select-0")).click(); + waitForElement(Locator.tagWithText("li", "!TestGroup!")).click(); waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); - - // indicates row is filtered: - waitForElementToDisappear(Locator.tagWithText("span", "2")); - - clearFilterDialog("ref equals C"); + waitForElementToDisappear(Locator.tagWithText("span", "173")); + clearFilterDialog("variableSamples in set !TestGroup!"); // VariableSamples variable in m000001 waitAndClick(Locator.tagWithText("button", "Search")); @@ -1554,9 +1547,20 @@ private void testLuceneSearchUI(String sessionId) waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys(Keys.ENTER); waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); waitForElement(Locator.tagWithText("span", "0.553")); - clearFilterDialog("variableSamples variable in m00001"); + // VariableSamples not variable in m05710 + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Samples With Variant")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", "not variable in")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("m05710"); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys(Keys.ENTER); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElementToDisappear(Locator.tagWithText("span", "3.277E-4")); + clearFilterDialog("variableSamples not variable in m05710"); + // VariableSamples li usage + variable in all of waitAndClick(Locator.tagWithText("button", "Search")); waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); @@ -1569,21 +1573,49 @@ private void testLuceneSearchUI(String sessionId) waitForElement(Locator.tagWithText("div", "m00004")).click(); waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); waitForElement(Locator.tagWithText("span", "0.3")); - clearFilterDialog("variableSamples variable in all of m00005,m00004"); - // VariableSamples not variable in m05710 + // VariableSamples variable in any of m00004,m00007 waitAndClick(Locator.tagWithText("button", "Search")); waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); waitForElement(Locator.tagWithText("li", "Samples With Variant")).click(); waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); - waitForElement(Locator.tagWithText("li", "not variable in")).click(); - waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("m05710"); - waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys(Keys.ENTER); + waitForElement(Locator.tagWithText("li", "variable in any of")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("m000"); + waitForElement(Locator.tagWithText("div", "m00004")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("m000"); + waitForElement(Locator.tagWithText("div", "m00007")).click(); waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); - waitForElementToDisappear(Locator.tagWithText("span", "3.277E-4")); + waitForElement(Locator.tagWithText("span", "2")); + clearFilterDialog("variableSamples variable in any of m00004,m00007"); - clearFilterDialog("variableSamples not variable in m05710"); + // VariableSamples not variable in any of m00005,m00004 + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Samples With Variant")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", "not variable in any of")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("m000"); + waitForElement(Locator.tagWithText("div", "m00005")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("m000"); + waitForElement(Locator.tagWithText("div", "m00004")).click(); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElementToDisappear(Locator.tagWithText("span", "2")); + clearFilterDialog("variableSamples not variable in any of m00005,m00004"); + + // VariableSamples not variable in one of m03660,m00001 + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Samples With Variant")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", "not variable in one of")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("m036"); + waitForElement(Locator.tagWithText("div", "m03660")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("m000"); + waitForElement(Locator.tagWithText("div", "m00001")).click(); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElementToDisappear(Locator.tagWithText("span", "609")); + clearFilterDialog("variableSamples not variable in one of m03660,m00001"); // samples with variant isEmpty waitAndClick(Locator.tagWithText("button", "Search")); @@ -1593,7 +1625,177 @@ private void testLuceneSearchUI(String sessionId) waitForElement(Locator.tagWithText("li", "is empty")).click(); waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); waitForElementToDisappear(Locator.tagWithText("span", "2")); - clearFilterDialog("variableSamples is empty"); + + // Start = 2 + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Start")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", "=")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("2"); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElementToDisappear(Locator.tagWithText("span", "4")); + clearFilterDialog("start = 2"); + + // Start != 2 + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Start")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", "!=")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("2"); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElementToDisappear(Locator.tagWithText("span", "2")); + clearFilterDialog("start != 2"); + + // Start < 173 + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Start")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", "<")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("173"); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElementToDisappear(Locator.tagWithText("span", "173")); + clearFilterDialog("start < 173"); + + // Start > 502 + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Start")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", ">")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("502"); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElementToDisappear(Locator.tagWithText("span", "502")); + clearFilterDialog("start > 502"); + + // Start <= 440 + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Start")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", "<=")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("440"); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElementToDisappear(Locator.tagWithText("span", "502")); + clearFilterDialog("start <= 440"); + + // Start >= 609 + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Start")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", ">=")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("609"); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElementToDisappear(Locator.tagWithText("span", "2")); + clearFilterDialog("start >= 609"); + + // Ref Allele equals GAAAA + waitForElement(Locator.tagWithText("span", "0.029")); + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Ref Allele")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", "equals")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("GAAAA"); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElement(Locator.tagWithText("span", "4506")); + clearFilterDialog("ref equals GAAAA"); + + // Impact equals HIGH + waitForElement(Locator.tagWithText("span", "0.029")); + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Impact on Protein Coding")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", "equals")).click(); + waitForElement(Locator.tagWithId("div", "value-select-0")).click(); + waitForElement(Locator.tagWithText("li", "HIGH")).click(); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElementToDisappear(Locator.tagWithText("span", "4")); + clearFilterDialog("IMPACT equals HIGH"); + + // Ref Allele does not equal A + waitForElement(Locator.tagWithText("span", "0.029")); + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Ref Allele")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", "does not equal")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("A"); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElement(Locator.tagWithText("span", "858")); + clearFilterDialog("ref does not equal A"); + + // Alt Allele contains TT + waitForElement(Locator.tagWithText("span", "0.029")); + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Alt Allele")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", "contains")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("TT"); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElement(Locator.tagWithText("span", "22559")); + clearFilterDialog("alt contains TT"); + + // Alt Allele does not contain T + waitForElement(Locator.tagWithText("span", "0.029")); + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Alt Allele")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", "does not contain")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("T"); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElementToDisappear(Locator.tagWithText("span", "2")); + clearFilterDialog("alt does not contain T"); + + // Ref Allele starts with GA + waitForElement(Locator.tagWithText("span", "0.029")); + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Ref Allele")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", "starts with")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("GA"); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElement(Locator.tagWithText("span", "14716")); + clearFilterDialog("ref starts with GA"); + + // Ref Allele ends with AAA + waitForElement(Locator.tagWithText("span", "0.029")); + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Ref Allele")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", "ends with")).click(); + waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("AAA"); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElement(Locator.tagWithText("span", "4506")); + clearFilterDialog("ref ends with AAA"); + + // Alt Allele is empty + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Alt Allele")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", "is empty")).click(); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElement(Locator.tagWithText("span", "18235")); + clearFilterDialog("alt is empty"); + + // IMPACT is not empty + waitAndClick(Locator.tagWithText("button", "Search")); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click(); + waitForElement(Locator.tagWithText("li", "Impact on Protein Coding")).click(); + waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click(); + waitForElement(Locator.tagWithText("li", "is not empty")).click(); + waitAndClick(Locator.tagWithClass("button", "filter-form-select-button")); + waitForElement(Locator.tagWithText("span", "914")); + clearFilterDialog("IMPACT is not empty"); } } \ No newline at end of file