From 0ffbdcf6905df1f43e6290f224cddde13fa26205 Mon Sep 17 00:00:00 2001 From: Guillaume Poirier-Morency Date: Wed, 2 Aug 2023 14:24:49 -0700 Subject: [PATCH] Omit sub-clauses related to the category that is being retrieved Make browsingOptions.filter an array so that it can be adjusted as necessary when retrieving counts for platforms, taxa, etc. Rename blacklistedTerms to excludedTerms. --- src/App.vue | 6 +- src/components/AnnotationSelector.vue | 45 ++-- src/components/AppBar.vue | 3 +- src/components/DownloadButton.vue | 6 +- src/components/PlatformSelector.vue | 115 ++++++---- src/components/SearchSettings.vue | 32 ++- src/components/TaxonSelector.vue | 156 +++++++------ src/components/TechnologyTypeSelector.vue | 64 ++++++ src/config/gemma.js | 4 +- src/models.js | 5 +- src/utils.js | 15 +- src/views/Browser.vue | 258 +++++++++++++--------- 12 files changed, 442 insertions(+), 267 deletions(-) create mode 100644 src/components/TechnologyTypeSelector.vue diff --git a/src/App.vue b/src/App.vue index 798d4d2..bf3edef 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,6 +9,7 @@ import "vuetify/dist/vuetify.css"; import "material-icons"; import AppBar from "@/components/AppBar.vue"; +import { mapMutations } from "vuex"; function renderError(err) { return { @@ -23,8 +24,9 @@ function renderError(err) { export default { components: { AppBar }, - errorCaptured(err, vm, info) { - this.$store.commit("setLastError", renderError(err)); + methods: mapMutations(["setLastError"]), + errorCaptured(err) { + this.setLastError(renderError(err)); } }; diff --git a/src/components/AnnotationSelector.vue b/src/components/AnnotationSelector.vue index 1df1e94..818ace5 100644 --- a/src/components/AnnotationSelector.vue +++ b/src/components/AnnotationSelector.vue @@ -1,26 +1,38 @@ diff --git a/src/components/SearchSettings.vue b/src/components/SearchSettings.vue index 59f68af..9eee4c0 100644 --- a/src/components/SearchSettings.vue +++ b/src/components/SearchSettings.vue @@ -27,9 +27,13 @@ + -

- Annotations -

- - + :selectedCategories.sync="searchSettings.categories"/> +

+ No annotations available +

+
+
+ +
\ No newline at end of file diff --git a/src/config/gemma.js b/src/config/gemma.js index 92c6078..8ba8cdc 100644 --- a/src/config/gemma.js +++ b/src/config/gemma.js @@ -33,12 +33,12 @@ marked.use({ export { marked }; /** - * Blacklisted categories and terms. + * Excluded categories and terms. * * Inference is applied in the backend to include all the subclasses of the following terms. Thus, one must be careful * to not put a term that is too general. */ -export let blacklistedTerms = [ +export let excludedTerms = [ "http://gemma.msl.ubc.ca/ont/TGEMO_00001", // homozygous negative "http://gemma.msl.ubc.ca/ont/TGEMO_00003", // heterozygous "http://gemma.msl.ubc.ca/ont/TGEMO_00004", // overexpression diff --git a/src/models.js b/src/models.js index fb8ff4b..d562897 100644 --- a/src/models.js +++ b/src/models.js @@ -11,6 +11,7 @@ export function Taxon(commonName, scientificName) { this.commonName = commonName; this.scientificName = scientificName; + this.numberOfExpressionExperiments = 0; } /** @@ -71,10 +72,10 @@ export function SearchSettings(query, resultTypes) { this.platforms = []; this.taxon = null; this.quality = [0, 3]; - this.technologyTypes = []; + this.technologyType = null; this.annotations = []; this.categories = []; - this.includeBlacklistedTerms = false; + this.ignoreExcludedTerms = false; } export const ExpressionExperimentType = "ubic.gemma.model.expression.experiment.ExpressionExperiment"; diff --git a/src/utils.js b/src/utils.js index edc1421..70d1220 100644 --- a/src/utils.js +++ b/src/utils.js @@ -18,8 +18,8 @@ export function downloadAs(data, filename) { } const numberFormat = new Intl.NumberFormat(); -const percentFormatter = Intl.NumberFormat(undefined, { style: "percent" }); -const decimalFormatter = Intl.NumberFormat(undefined, { maximumFractionDigits: 2 }); +const percentFormatter = new Intl.NumberFormat(undefined, { style: "percent" }); +const decimalFormatter = new Intl.NumberFormat(undefined, { maximumFractionDigits: 2 }); export function formatNumber(n) { return numberFormat.format(n); @@ -62,4 +62,13 @@ export function compressArg(f) { return f; } }); -} \ No newline at end of file +} + +/** + * + * @param filter + * @returns {Promise} + */ +export function compressFilter(filter) { + return compressArg(filter.map(a => a.join(" or ")).join(" and ")); +} diff --git a/src/views/Browser.vue b/src/views/Browser.vue index bf8dd84..55a77bf 100644 --- a/src/views/Browser.vue +++ b/src/views/Browser.vue @@ -24,11 +24,10 @@ :options.sync="options" :server-items-length="totalNumberOfExpressionExperiments" :footer-props="footerProps" - :disable-sort="query && query.length > 0" show-expand fixed-header - dense class="mb-3" - > + dense class="browser-data-table" + >