Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
Format Code
Browse files Browse the repository at this point in the history
  • Loading branch information
jmueller95 committed Sep 15, 2021
1 parent 4540532 commit a0942f2
Show file tree
Hide file tree
Showing 14 changed files with 2,860 additions and 2,059 deletions.
100 changes: 54 additions & 46 deletions EC50Histogram.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<histogram
<histogram
v-if="chartData"
id="ec50Histogram"
:chartData="chartData"
Expand All @@ -10,94 +10,102 @@
:minWidth="minWidth"
:title="title"
:xlabel="xlabel"
/>
/>
</template>

<script>
import axios from 'axios'
import histogram from '@/vue-d3-components/GenericHistogram'
import axios from "axios";
import histogram from "@/vue-d3-components/GenericHistogram";
export default {
name: 'ec50histogram',
name: "ec50histogram",
components: {
histogram: histogram
histogram: histogram,
},
props: {
minWidth: {
type: Number,
default: 200
type: Number,
default: 200,
},
minHeight: {
type: Number,
default: 200
type: Number,
default: 200,
},
title: {
type: String,
default: ''
type: String,
default: "",
},
xlabel: {
type: String,
default: ''
type: String,
default: "",
},
sModelIds: {
type: String,
default: ''
type: String,
default: "",
},
selectedDataset: {
type: Object,
default: null
type: Object,
default: null,
},
selectedLines: {
type: Array,
default: null
type: Array,
default: null,
},
minDose: {
type: Number,
default: 1e-20
type: Number,
default: 1e-20,
},
maxDose: {
type: Number,
default: 1e20
}
type: Number,
default: 1e20,
},
},
data: function () {
return {
chartData: null
}
chartData: null,
};
},
watch: {
sModelIds: function () {
this.getData()
this.getData();
},
selectedDataset: function () {
this.getData()
}
this.getData();
},
},
methods: {
getData: function () {
let that = this
let urlCurveData = this.$store.state.host + '/proteomicsdb/logic/ptmCurves/getEC50Data.xsjs'
getData: function () {
let that = this;
let urlCurveData =
this.$store.state.host +
"/proteomicsdb/logic/ptmCurves/getEC50Data.xsjs";
if (this.selectedDataset) {
axios.get(urlCurveData, {
params: {
experiment_design_id: this.selectedDataset.experimentDesignId,
min_dose: this.selectedDataset.minDose * this.getDoseUnitMultiplier(this.selectedDataset),
max_dose: this.selectedDataset.maxDose * this.getDoseUnitMultiplier(this.selectedDataset)
}})
.then(function (response) {
that.chartData = response.data
axios
.get(urlCurveData, {
params: {
experiment_design_id: this.selectedDataset.experimentDesignId,
min_dose:
this.selectedDataset.minDose *
this.getDoseUnitMultiplier(this.selectedDataset),
max_dose:
this.selectedDataset.maxDose *
this.getDoseUnitMultiplier(this.selectedDataset),
},
})
.then(function (response) {
that.chartData = response.data;
});
} else {
this.chartData = null
this.chartData = null;
}
},
getDoseUnitMultiplier: function(dataset) {
getDoseUnitMultiplier: function (dataset) {
if (dataset.doseUnit === "nanomolar") {
return 1e-9;
} else {
return 1.0;
}
}
}
}
},
},
};
</script>
106 changes: 55 additions & 51 deletions GeneFDRGraph.vue
Original file line number Diff line number Diff line change
@@ -1,94 +1,98 @@
<template>
<fdrplot
ref='fdrRef'
id='geneFDR'
:height='"300px"'
:data='geneFdrModel'
:targetName='targetName'
:targetPosition='targetScore'
:decoyPosition='decoyScore'
:enrichment='enrichment'
:qValue='qValue'
:xAxisLabel='"protein score (best Q-score)"'
:yAxisLabel='"# of proteins"'
ref="fdrRef"
id="geneFDR"
:height="'300px'"
:data="geneFdrModel"
:targetName="targetName"
:targetPosition="targetScore"
:decoyPosition="decoyScore"
:enrichment="enrichment"
:qValue="qValue"
:xAxisLabel="'protein score (best Q-score)'"
:yAxisLabel="'# of proteins'"
/>
</template>

<script>
import axios from 'axios'
import fdrplot from '@/vue-d3-components/FDRGraph'
import axios from "axios";
import fdrplot from "@/vue-d3-components/FDRGraph";
export default {
name: 'geneFdrPlot',
name: "geneFdrPlot",
components: {
fdrplot: fdrplot
fdrplot: fdrplot,
},
props: {
minWidth: {
type: Number,
default: 400
default: 400,
},
minHeight: {
type: Number,
default: 400
default: 400,
},
proteinId: {
type: String,
default: null
default: null,
},
targetName: {
type: String,
default: null
}
default: null,
},
},
data: function () {
return {
geneFdrModel: null,
targetScore: null,
decoyScore: null,
enrichment: null,
qValue: null
}
},
computed: {
},
watch: {
qValue: null,
};
},
computed: {},
watch: {},
methods: {
getData: function () {
let that = this
getData: function () {
let that = this;
let urlDatasets = this.$store.state.host+'/proteomicsdb/logic/fdr/getGeneFDR.xsjs'
axios.get(urlDatasets, {
let urlDatasets =
this.$store.state.host + "/proteomicsdb/logic/fdr/getGeneFDR.xsjs";
axios
.get(urlDatasets, {
params: {
proteinId: this.proteinId
}})
.then(function (response) {
that.geneFdrModel = response.data
proteinId: this.proteinId,
},
})
.then(function (response) {
that.geneFdrModel = response.data;
});
},
getGeneScores: function () {
let that = this
getGeneScores: function () {
let that = this;
let urlDatasets = this.$store.state.host+'/proteomicsdb/logic/fdr/getGeneFDRScore.xsjs'
axios.get(urlDatasets, {
let urlDatasets =
this.$store.state.host + "/proteomicsdb/logic/fdr/getGeneFDRScore.xsjs";
axios
.get(urlDatasets, {
params: {
proteinId: this.proteinId
}})
.then(function (response) {
that.targetScore = response.data.TARGET.SCORE
that.decoyScore = response.data.DECOY.SCORE
that.enrichment = response.data.enrichment
that.qValue = response.data.Q_VALUE
proteinId: this.proteinId,
},
})
.then(function (response) {
that.targetScore = response.data.TARGET.SCORE;
that.decoyScore = response.data.DECOY.SCORE;
that.enrichment = response.data.enrichment;
that.qValue = response.data.Q_VALUE;
});
},
getSVG: function() {
getSVG: function () {
return this.$refs.fdrRef.getSVG();
}
},
},
mounted() {
this.getData()
this.getGeneScores()
}
}
this.getData();
this.getGeneScores();
},
};
</script>
Loading

0 comments on commit a0942f2

Please sign in to comment.