@@ -20,8 +25,13 @@
+
diff --git a/src/components/LiftOver.vue b/src/components/LiftOver.vue
deleted file mode 100644
index 32fa706..0000000
--- a/src/components/LiftOver.vue
+++ /dev/null
@@ -1,144 +0,0 @@
-
-
-
- New Reference Id Available
-
-
-
-
- {{ updated_accession }}
-
-
- Lift to the new reference ID!
-
-
-
- {{ lifted_description }}
-
-
-
-
-
-
- View NCBI response as a tree
-
-
-
-
-
-
Work in progress.
-
-
-
-
-
-
diff --git a/src/components/ReferenceInformation.vue b/src/components/ReferenceInformation.vue
index 25eea0e..92a8598 100644
--- a/src/components/ReferenceInformation.vue
+++ b/src/components/ReferenceInformation.vue
@@ -1,83 +1,96 @@
-
-
- Reference ID: {{ record.id }}
-
-
-
- {{
- detail.name
- }}
- {{
- detail.value
- }}
-
-
-
-
+ v-if="progress"
+ >
+
+ Reference information not retrieved.
+
+
+
+
+ Reference ID: {{ record.id }}
+
+
+
+ {{
+ detail.name
+ }}
+ {{
+ detail.value
+ }}
+
+
+
+
-
- selected transcript gene name:
- {{ gene.id }}
-
-
-
- {{ detail.name }}
- {{
- detail.value
- }}
-
-
-
-
+
+ selected transcript gene name:
+ {{ gene.id }}
+
+
+
+ {{ detail.name }}
+ {{
+ detail.value
+ }}
+
+
+
+
-
- Selected transcript ID: {{ selector.id }}
-
-
-
- {{ detail.name }}
- {{
- detail.value
- }}
-
-
-
-
-
+
+ Selected transcript ID: {{ selector.id }}
+
+
+
+ {{ detail.name }}
+ {{
+ detail.value
+ }}
+
+
+
+
+
-
-
- View as a tree
-
-
-
-
-
+
+
+ View as a tree
+
+
+
+
+
+
@@ -100,6 +113,8 @@ export default {
record: null,
gene: null,
selector: null,
+ progress: true,
+ no_response: true,
};
},
created: function () {
@@ -122,19 +137,20 @@ export default {
};
}
MutalyzerService.referenceModel(params).then((response) => {
+ this.progress = false;
if (response.data) {
this.reference_model = response.data;
this.record = this.getRecord(this.reference_model);
this.gene = this.getGene(this.reference_model);
this.selector = this.getSelector(this.reference_model);
+ this.no_response = false;
+ } else {
+ this.no_response = true;
}
});
},
methods: {
getRecord(annotations) {
- if (annotations.type != "record") {
- return;
- }
let output = { id: annotations.id };
if (annotations.qualifiers) {
output.details = this.extractQualifiers(annotations.qualifiers);
diff --git a/src/components/Related.vue b/src/components/Related.vue
new file mode 100644
index 0000000..d85387b
--- /dev/null
+++ b/src/components/Related.vue
@@ -0,0 +1,248 @@
+
+
+
+
+
+
+
{{ source }}
+
+ {{
+ reference.id + "(" + reference.selector.id + ")"
+ }})
+ {{ reference.id }}
+
+
+
+
+ View response as a tree
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/SelectorShort.vue b/src/components/SelectorShort.vue
index a88bd53..ea6bc72 100644
--- a/src/components/SelectorShort.vue
+++ b/src/components/SelectorShort.vue
@@ -65,7 +65,7 @@ export default {
for (var i = 0; i < this.selector.exon.g.length; i++) {
if (this.selector.exon.c) {
output.push({
- name: i,
+ name: i + 1,
g_s: this.selector.exon.g[i][0],
g_e: this.selector.exon.g[i][1],
c_s: this.selector.exon.c[i][0],
@@ -73,7 +73,7 @@ export default {
});
} else if (this.selector.exon.n) {
output.push({
- name: i,
+ name: i + 1,
g_s: this.selector.exon.g[i][0],
g_e: this.selector.exon.g[i][1],
n_s: this.selector.exon.n[i][0],
@@ -81,7 +81,7 @@ export default {
});
} else {
output.push({
- name: i,
+ name: i + 1,
g_s: this.selector.exon.g[i][0],
g_e: this.selector.exon.g[i][1],
});
@@ -94,7 +94,6 @@ export default {
var output = [];
if (this.selector.cds) {
output.push({
- name: "0",
g_s: this.selector.cds.g[0][0],
g_e: this.selector.cds.g[0][1],
c_s: this.selector.cds.c[0][0],
@@ -143,11 +142,6 @@ export default {
if (this.selector.exon.c) {
output.push(
...[
- {
- text: "Number",
- value: "name",
- sortable: false,
- },
{ text: "Start (g.)", value: "g_s", sortable: false },
{ text: "End (g.)", value: "g_e", sortable: false },
{ text: "Start (c.)", value: "c_s", sortable: false },
diff --git a/src/components/ViewVariants.vue b/src/components/ViewVariants.vue
new file mode 100644
index 0000000..d2d3d1e
--- /dev/null
+++ b/src/components/ViewVariants.vue
@@ -0,0 +1,122 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/ViewVariantsCore.vue b/src/components/ViewVariantsCore.vue
new file mode 100644
index 0000000..e2326c7
--- /dev/null
+++ b/src/components/ViewVariantsCore.vue
@@ -0,0 +1,441 @@
+
+
+
+
+ {{ v.description }}
+ ;
+
+
+
+
mdi-arrow-right-bold
+
mdi-arrow-left-bold
+
+
+
+
+
+
+
+
+
+ {{ s }}{{ get_position(v, s_i, "sequence") }}
+
+
+
+
+
+ Get HGVS location
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ s }}{{ get_position(v, s_i, "left") }}
+
+
+
+
+
+ Get HGVS location
+
+
+
+
+
+
+
+
+
+ ...
+ other {{ get_position(v, null, "other") }} bases
+
+
+
+
+
+
+
+
+
+ {{ s }}{{ get_position(v, s_i, "right") }}
+
+
+
+
+
+ Get HGVS location
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ s }}
+ {{ get_position(v, s_i, "sequence") }}
+
+
+
+
+
+
+
+
+
+ {{ s }}
+ {{ get_position(v, s_i, "left") }}
+
+
+
+
+
+
+
+
+ ...
+ other {{ get_position(v, null, "other-deleted") }} bases
+
+
+
+
+
+
+
+
+ {{ s }}
+ {{ get_position(v, s_i, "right-deleted") }}
+
+
+
+
+
+ -
+
+
+
+
+ {{ s }}
+
+
+
+ {{ s }}
+
+
+
+
+
+
+ ...
+ other {{ get_position(v, null, "other-inserted") }} bases
+
+
+
+
+ {{ s }}
+
+
+
+ -
+
+
+
+
mdi-arrow-right-bold
+
mdi-arrow-left-bold
+
+
+
+
+
+
+
+
diff --git a/src/router/index.js b/src/router/index.js
index 0d775ff..e1a0c7d 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -5,6 +5,9 @@ import About from "../views/About.vue";
import NameChecker from "../views/NameChecker.vue";
import PositionConverter from "../views/PositionConverter.vue";
import DescriptionExtractor from "../views/DescriptionExtractor.vue";
+import Mapper from "../views/Mapper.vue";
+import BatchChecker from "../views/BatchChecker.vue";
+import Algebra from "../views/Algebra.vue";
Vue.use(VueRouter);
@@ -36,6 +39,24 @@ const routes = [
name: "DescriptionExtractor",
component: DescriptionExtractor,
},
+ {
+ path: "/mapper",
+ props: true,
+ name: "Mapper",
+ component: Mapper,
+ },
+ {
+ path: "/batchchecker",
+ props: true,
+ name: "BatchChecker",
+ component: BatchChecker,
+ },
+ {
+ path: "/algebra",
+ props: true,
+ name: "Algebra",
+ component: Algebra,
+ },
{
path: "/api",
},
diff --git a/src/services/MutalyzerService.js b/src/services/MutalyzerService.js
index 06dc7d8..92bb900 100644
--- a/src/services/MutalyzerService.js
+++ b/src/services/MutalyzerService.js
@@ -12,9 +12,17 @@ const apiClient = axios.create({
});
export default {
- nameCheck(description) {
+ compare(params) {
+ return apiClient.get("/compare/", { params });
+ },
+ nameCheckHgvs(description) {
return apiClient.get("/name_check/" + encodeURIComponent(description));
},
+ nameCheckSequence(description, params) {
+ return apiClient.get("/name_check/" + encodeURIComponent(description), {
+ params,
+ });
+ },
positionConvert(params) {
return apiClient.get("/position_convert/", { params });
},
@@ -27,7 +35,17 @@ export default {
getSelectors(referenceId) {
return apiClient.get("/get_selectors/" + encodeURIComponent(referenceId));
},
- lift(params) {
- return apiClient.get("/lift/", { params });
+ map(params) {
+ return apiClient.get("/map/", { params });
+ },
+ view(description, params) {
+ return apiClient.get("/view_variants/" + encodeURIComponent(description), {
+ params,
+ });
+ },
+ relatedReferences(reference_id) {
+ return apiClient.get(
+ "/related_references/" + encodeURIComponent(reference_id)
+ );
},
};
diff --git a/src/services/NcbiEutils.js b/src/services/NcbiEutils.js
new file mode 100644
index 0000000..05e5729
--- /dev/null
+++ b/src/services/NcbiEutils.js
@@ -0,0 +1,18 @@
+import axios from "axios";
+
+const ncbiDatasetsBaseUrl = `https://eutils.ncbi.nlm.nih.gov/entrez/eutils/`;
+
+const apiClient = axios.create({
+ baseURL: ncbiDatasetsBaseUrl,
+ withCredentials: false, // This is the default
+ headers: {
+ Accept: "application/json",
+ "Content-Type": "application/json",
+ },
+});
+
+export default {
+ get_gene_summary(id) {
+ return apiClient.get("/esummary.fcgi?db=gene&id=" + id + "&retmode=json");
+ },
+};
diff --git a/src/views/About.vue b/src/views/About.vue
index 3cc3ad9..5e4750f 100644
--- a/src/views/About.vue
+++ b/src/views/About.vue
@@ -2,9 +2,56 @@
- About Page
-
- Website version: {{ version }}
+ About Mutalyzer
+ Website version: {{ version }}
+
+ Contact
+
+ If you have a private question or a security related issue to discuss,
+ please use the private address
+ info@mutalyzer.nl.
+
+
+ Funding
+
+ This project was supported by the Fair Genomes project as financed in
+ the Personalised Medicine program from the the Netherlands
+ Organization for Health Research and Development (ZonMw) under grant
+ number
+ 846003201.
+
+ Recommended by
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/Algebra.vue b/src/views/Algebra.vue
new file mode 100644
index 0000000..94cc853
--- /dev/null
+++ b/src/views/Algebra.vue
@@ -0,0 +1,575 @@
+
+
+
+
+ Algebra
+ Compute the relation between variants.
+
+
+
+ {{ getTitleText() }}
+
+
+
+
+ mdi-dots-vertical
+
+
+
+
+
+ {{
+ getSwitchText()
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Compare
+
+
+
+ Example
+
+
+
+
+
+
+
+
+
+
+ Cancel
+
+
+
+
+
+
+
+
+
+ Comparison could not be performed
+
+
+
+
+
+
{{ key }}
+
+
+ {{ getMessage(error) }}
+
+
+
+
+
+
+
+ Details
+
+
+
Reference Sequence
+
+ {{ response.ref_seq }}
+
+
+
+
LHS Sequence
+
+ {{ response.lhs_seq }}
+
+
+
+
RHS Sequence
+
+ {{ response.rhs_seq }}
+
+
+
+
LHS Influence Interval
+
+ {{ response.influence_lhs.min_pos }},
+ {{ response.influence_lhs.max_pos }}
+
+
Equal.
+
+
+
RHS Influence Interval
+
+ {{ response.influence_rhs.min_pos }},
+ {{ response.influence_rhs.max_pos }}
+
+
Equal.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ connectionErrors.details }}
+
+
+
+
+
+
+ Raw Response
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/BatchChecker.vue b/src/views/BatchChecker.vue
new file mode 100644
index 0000000..2e44337
--- /dev/null
+++ b/src/views/BatchChecker.vue
@@ -0,0 +1,327 @@
+
+
+
+
+ Batch Checker
+
+ The Batch Checker can be used to process up to 50 descriptions with
+ the Name Checker.
+
+
+
+
+
+ Batch Check
+
+
+
+
+
+ A maximum number of 50 variant descriptions are supported.
+
+
+
+
+ Processing {{ variants.length }} variants ...
+ Done!
+
+
+
+
+ Show Details
+
+
+ Hide Details
+
+
+ Download
+
+
+
+
+
+
+ {{ variant.input }}
+
+
+
+
+
+
+
+
+ {{ variant.response.normalized_description }}
+
+
+ Different than the input description
+ Same as the input description
+
+
+
+
+
+
+ mdi-content-copy
+
+
+ Copy
+
+
+
+
+
+
+
+ Description could not be interpreted
+
+
+
+
+
+
+ {{ getMessage(error) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/DescriptionExtractor.vue b/src/views/DescriptionExtractor.vue
index 766b5ce..afb63eb 100644
--- a/src/views/DescriptionExtractor.vue
+++ b/src/views/DescriptionExtractor.vue
@@ -40,7 +40,13 @@
class="mt-5"
color="primary"
:disabled="!valid"
- @click.prevent="descriptionExtract()"
+ :to="{
+ name: 'DescriptionExtractor',
+ query: {
+ reference: reference,
+ observed: observed,
+ },
+ }"
>
Extract
@@ -52,7 +58,7 @@
- {{ summary }}
+
@@ -61,8 +67,12 @@
diff --git a/src/views/Mapper.vue b/src/views/Mapper.vue
new file mode 100644
index 0000000..89ceeba
--- /dev/null
+++ b/src/views/Mapper.vue
@@ -0,0 +1,514 @@
+
+
+
+
+ Mapper
+ Map a description to another reference.
+
+
+ Map
+
+
+
+
+
+
+
+
+
+
+
+ To
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Map
+
+
+
+ Example
+
+
+
+
+
+
+
+
+
+ Cancel
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mdi-details {{ showCorrections ? "mdi-rotate-180" : "" }}
+
+
+
+ {{ showCorrections ? "Hide" : "See" }} Details
+
+
+
+
+
+
+
+
+ {{ connectionErrors.details }}
+
+
+
+
+
+
+ Description could not be interpreted
+
+
+
+
+
+ mdi-details {{ showCorrections ? "mdi-rotate-180" : "" }}
+
+
+
+ {{ showCorrections ? "Hide" : "See" }} Details
+
+
+
+
+
+
+
+
+
+
+ Input Description
+
+
+ {{ inputDescription }}
+
+
+
Corrections / Info Messages
+
+ {{ getMessage(info) }}
+
+
+
+
Corrected Description
+
+ {{ response.corrected_description }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ getMessage(error) }}
+
+
+
+
+
+
+
+
+ Raw Response
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/NameChecker.vue b/src/views/NameChecker.vue
index ae7d505..f8080fe 100644
--- a/src/views/NameChecker.vue
+++ b/src/views/NameChecker.vue
@@ -7,44 +7,101 @@
The Name Checker takes the variant description as input and checks
whether it is correct.
-
-
+
+
+
+
+
+ mdi-dots-vertical
+
+
+
+
+
+ {{
+ getSwitchText()
+ }}
+
+
+
+
+
+
+
+
+
+
+ Examples:
+ {{ example }}
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- Examples:
- {{ example }}
-
-
-
- Normalize
-
+ Normalize
+
+
+
+ Example
+
+
@@ -63,30 +120,30 @@
prominent
tile
v-if="isNormalized()"
+ :color="getNormalizedColor()"
type="success"
>
- {{ response.normalized_description }}
-
-
-
-
-
-
- mdi-content-copy
-
-
- Copy
-
+
-
+
Description could not be interpreted
-
+
- Input Description
-
- {{ inputDescription }}
+
+ Input Description
-
Corrections
-
- {{ getMessage(info) }}
-
+ {{ inputDescription }}
+
+
+
Corrections / Info Messages
+
+ {{ getMessage(info) }}
+
+
Corrected Description
@@ -192,6 +254,7 @@
+
-
-
- Lift Over
-
-
-
-
-
-
Coding
Noncoding
Genomic
+
{{ c_s }}
-
- {{ equivalentDescription[0] }}
-
+
- {{ equivalentDescription }}
+
@@ -297,6 +329,76 @@
+
+
+ Back Translated Descriptions
+
+
+ {{ equivalentDescription }}
+
+
+
+
+
+
+
+ RNA Prediction
+
+
+
+
+ {{ getMessage(error) }}
+
+
+
+
+
+
+
+
+
+
+
Protein DetailsProtein Prediction
-
+
@@ -319,11 +421,11 @@
hover
class="mt-5 mb-5"
tile
- v-if="response && response.corrected_model"
+ v-if="showReferenceInformation()"
>
Reference InformationReference Sequence Information
@@ -335,6 +437,57 @@
+
+
+ Related reference sequences
+
+
+
+
+
+
+
+
+ View Variants Sequence Overview
+
+
+
+
+
+
Raw Response
@@ -355,7 +508,9 @@ import AffectedProtein from "../components/AffectedProtein.vue";
import SelectorShort from "../components/SelectorShort.vue";
import SyntaxError from "../components/SyntaxError.vue";
import ReferenceInformation from "../components/ReferenceInformation.vue";
-import LiftOver from "../components/LiftOver.vue";
+import Related from "../components/Related.vue";
+import ViewVariants from "../components/ViewVariants.vue";
+import Description from "../components/Description.vue";
export default {
components: {
@@ -364,24 +519,13 @@ export default {
AffectedProtein,
SyntaxError,
ReferenceInformation,
- LiftOver,
+ Related,
+ ViewVariants,
+ Description,
},
props: ["descriptionRouter"],
- created: function () {
- if (this.descriptionRouter && 0 !== this.descriptionRouter.length) {
- this.inputDescriptionTextBox = this.descriptionRouter;
- this.nameCheck();
- }
- },
- watch: {
- $route() {
- if (this.descriptionRouter && 0 !== this.descriptionRouter.length) {
- this.inputDescriptionTextBox = this.descriptionRouter;
- this.nameCheck();
- }
- },
- },
data: () => ({
+ valid: true,
inputDescriptionTextBox: null,
rules: [(value) => !!value || "Required."],
inputDescriptionTextBoxLabel: "HGVS Description",
@@ -394,13 +538,63 @@ export default {
response: null,
connectionErrors: null,
showCorrections: false,
+ sequence: null,
+ only_variants: false,
+ mode: "hgvs",
}),
+ created: function () {
+ this.run();
+ },
+ watch: {
+ $route() {
+ this.run();
+ },
+ },
methods: {
- selectDescriptionExample: function (i) {
- this.inputDescriptionTextBox = this.descriptionExamples[i];
- this.$refs.refInputDescriptionTextBox.focus();
+ run: function () {
+ this.setRouterParams();
+ this.nameCheck();
+ },
+ setRouterParams: function () {
+ if (
+ this.descriptionRouter &&
+ this.descriptionRouter.length !== 0 &&
+ !this.$route.query.only_variants &&
+ !this.$route.query.sequence
+ ) {
+ this.inputDescriptionTextBox = this.descriptionRouter;
+ this.mode = "hgvs";
+ } else if (
+ this.descriptionRouter &&
+ this.descriptionRouter.length !== 0 &&
+ this.$route.query.only_variants &&
+ this.$route.query.sequence &&
+ this.$route.query.sequence.length !== 0
+ ) {
+ this.inputDescriptionTextBox = this.descriptionRouter;
+ this.only_variants = this.$route.query.only_variants;
+ this.sequence = this.$route.query.sequence;
+ this.mode = "sequence";
+ } else if (
+ !this.descriptionRouter &&
+ !this.$route.query.only_variants &&
+ !this.$route.query.sequence
+ ) {
+ this.mode = "hgvs";
+ } else {
+ this.$router.push({
+ name: "NameChecker",
+ });
+ }
},
nameCheck: function () {
+ if (this.mode == "hgvs") {
+ this.nameCheckHgvs();
+ } else if (this.mode == "sequence") {
+ this.nameCheckSequence();
+ }
+ },
+ nameCheckHgvs: function () {
if (this.inputDescriptionTextBox !== null) {
this.loadingOverlay = true;
this.inputDescription = null;
@@ -409,7 +603,7 @@ export default {
this.showCorrections = false;
this.inputDescriptionTextBox = this.inputDescriptionTextBox.trim();
- MutalyzerService.nameCheck(this.inputDescriptionTextBox)
+ MutalyzerService.nameCheckHgvs(this.inputDescriptionTextBox)
.then((response) => {
if (response.data) {
this.loadingOverlay = false;
@@ -425,9 +619,66 @@ export default {
.catch((error) => {
this.loadingOverlay = false;
if (error.response) {
+ if (
+ error.response.status == 422 &&
+ error.response.data &&
+ error.response.data.custom
+ ) {
+ this.response = error.response.data.custom;
+ } else {
+ this.connectionErrors = {
+ details: "Some response error occured.",
+ };
+ }
+ } else if (error.request) {
this.connectionErrors = {
- details: "Some response error occured.",
+ details: "Some connection or server error occured.",
};
+ } else {
+ this.connectionErrors = { details: "Some error occured." };
+ }
+ });
+ }
+ },
+ nameCheckSequence: function () {
+ if (this.inputDescriptionTextBox !== null) {
+ this.loadingOverlay = true;
+ this.inputDescription = null;
+ this.response = null;
+ this.connectionErrors = null;
+ this.showCorrections = false;
+ this.inputDescriptionTextBox = this.inputDescriptionTextBox.trim();
+
+ MutalyzerService.nameCheckSequence(
+ this.inputDescriptionTextBox,
+ this.getParams()
+ )
+ .then((response) => {
+ if (response.data) {
+ this.loadingOverlay = false;
+ this.response = response.data;
+ this.inputDescription = this.inputDescriptionTextBox;
+ if (this.isNormalized()) {
+ this.$nextTick(() => {
+ this.$vuetify.goTo(this.$refs.successAlert, this.options);
+ });
+ }
+ }
+ })
+ .catch((error) => {
+ this.loadingOverlay = false;
+ if (error.response) {
+ if (
+ error.response.status == 422 &&
+ error.response.data &&
+ error.response.data.custom
+ ) {
+ this.response = error.response.data.custom;
+ } else {
+ this.connectionErrors = {
+ details: "Some response error occured.",
+ };
+ }
} else if (error.request) {
this.connectionErrors = {
details: "Some connection or server error occured.",
@@ -445,6 +696,15 @@ export default {
return false;
}
},
+ getNormalizedColor: function () {
+ if (this.isNormalized()) {
+ if (this.response.normalized_description == this.inputDescription) {
+ return "green";
+ } else {
+ return "blue";
+ }
+ }
+ },
correctionsPerformed: function () {
return (
this.response &&
@@ -452,6 +712,9 @@ export default {
this.response.corrected_description != this.inputDescription
);
},
+ infoMessages: function () {
+ return this.response && this.response.infos;
+ },
syntaxError: function () {
if (this.getSyntaxError()) {
return true;
@@ -530,6 +793,69 @@ export default {
}
}
},
+ showReferenceInformation() {
+ if (
+ this.response &&
+ this.response.corrected_description &&
+ !this.response.only_variants
+ ) {
+ if (this.response.errors) {
+ for (let error of this.response.errors) {
+ if (error.code && error.code == "ERETR") {
+ return false;
+ }
+ }
+ }
+ return true;
+ } else {
+ return false;
+ }
+ },
+ reset: function () {
+ this.inputDescriptionTextBox = null;
+ this.only_variants = false;
+ this.sequence = null;
+ this.response = null;
+ },
+ switchMode: function () {
+ if (this.mode == "sequence") {
+ this.mode = "hgvs";
+ this.reset();
+ if (this.$route.query.descriptionRouter) {
+ this.$router.push({
+ name: "NameChecker",
+ });
+ }
+ } else if (this.mode == "hgvs") {
+ this.mode = "sequence";
+ this.reset();
+ }
+ },
+ getSwitchText: function () {
+ if (this.mode == "hgvs") {
+ return "Switch to sequence mode";
+ } else if (this.mode == "sequence") {
+ return "Switch to HGVS mode";
+ }
+ },
+ getParams: function () {
+ if (this.mode == "hgvs") {
+ return {};
+ } else if (this.mode == "sequence") {
+ return {
+ only_variants: true,
+ sequence: this.sequence,
+ };
+ }
+ },
+ setSequenceExample: function () {
+ this.inputDescriptionTextBox = "2del";
+ this.sequence = "ATTAAC";
+ },
+ selectDescriptionExample: function (i) {
+ this.inputDescriptionTextBox = this.descriptionExamples[i];
+ this.$refs.refInputDescriptionTextBox.focus();
+ },
},
};
diff --git a/src/views/PositionConverter.vue b/src/views/PositionConverter.vue
index 759d8a5..433598e 100644
--- a/src/views/PositionConverter.vue
+++ b/src/views/PositionConverter.vue
@@ -41,7 +41,7 @@
@@ -567,9 +567,7 @@ export default {
if (response.data) {
this.loadingOverlay = false;
this.response = response.data;
- if (response.data.errors) {
- this.errorsHandler(response.data.errors);
- }
+
if (this.isConverted()) {
this.converted_description = this.modelToDescription(
this.response.converted_model
@@ -583,9 +581,18 @@ export default {
.catch((error) => {
this.loadingOverlay = false;
if (error.response) {
- this.connectionErrors = {
- details: "Some response error occured.",
- };
+ if (
+ error.response.status == 422 &&
+ error.response.data &&
+ error.response.data.custom &&
+ error.response.data.custom.errors
+ ) {
+ this.errorsHandler(error.response.data.custom.errors);
+ } else {
+ this.connectionErrors = {
+ details: "Some response error occured.",
+ };
+ }
} else if (error.request) {
this.connectionErrors = {
details: "Some connection or server error occured.",
@@ -687,11 +694,18 @@ export default {
this.availableSelectors &&
this.availableSelectors.reference !== this.referenceId
) {
- MutalyzerService.getSelectors(this.referenceId).then((response) => {
- if (response.data) {
- this.availableSelectors = response.data;
- }
- });
+ MutalyzerService.getSelectors(this.referenceId)
+ .then((response) => {
+ if (response.data) {
+ this.availableSelectors = response.data;
+ }
+ })
+ .catch((error) => {
+ this.availableSelectors = {
+ reference: this.referenceId,
+ error: error,
+ };
+ });
}
}
},