Skip to content

Commit 8cbedd4

Browse files
committed
quality check integration into vuex
1 parent f24cb65 commit 8cbedd4

File tree

3 files changed

+65
-28
lines changed

3 files changed

+65
-28
lines changed

src/store/index.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ Vue.use(Vuex);
88
export default new Vuex.Store({
99
state: {
1010
dockerStatus: "",
11+
Qcheck: {
12+
fileExtension: "",
13+
folderPath: "",
14+
reportReady: false,
15+
reportLoading: false,
16+
dockerActive: false,
17+
},
1118
runInfo: {
1219
active: false,
1320
type: null,
@@ -81,11 +88,12 @@ export default new Vuex.Store({
8188
},
8289
{
8390
name: "index_file_example",
84-
value: "https://pipecraft2-manual.readthedocs.io/en/stable/user_guide.html#indexes-file-example-fasta-formatted",
91+
value:
92+
"https://pipecraft2-manual.readthedocs.io/en/stable/user_guide.html#indexes-file-example-fasta-formatted",
8593
disabled: "never",
8694
type: "link",
8795
tooltip: "link to PipeCraft manual page, index file examples",
88-
},
96+
},
8997
{
9098
name: "index_mismatch",
9199
value: 0,
@@ -1857,11 +1865,12 @@ export default new Vuex.Store({
18571865
type: "file",
18581866
},
18591867
{
1860-
name: "index_file_example",
1861-
value: "https://pipecraft2-manual.readthedocs.io/en/stable/user_guide.html#indexes-file-example-fasta-formatted",
1862-
disabled: "never",
1863-
type: "link",
1864-
tooltip: "link to PipeCraft manual page, index file examples",
1868+
name: "index_file_example",
1869+
value:
1870+
"https://pipecraft2-manual.readthedocs.io/en/stable/user_guide.html#indexes-file-example-fasta-formatted",
1871+
disabled: "never",
1872+
type: "link",
1873+
tooltip: "link to PipeCraft manual page, index file examples",
18651874
},
18661875
{
18671876
name: "index_mismatch",
@@ -2640,6 +2649,8 @@ export default new Vuex.Store({
26402649
scriptName: "demux_paired_end_data.sh",
26412650
imageName: "pipecraft/cutadapt:3.5",
26422651
serviceName: "demultiplex",
2652+
manualLink:
2653+
"https://pipecraft2-manual.readthedocs.io/en/stable/user_guide.html#demultiplex",
26432654
disabled: "demultiplexed",
26442655
selected: false,
26452656
showExtra: false,
@@ -2681,11 +2692,12 @@ export default new Vuex.Store({
26812692
},
26822693
{
26832694
name: "index_file_example",
2684-
value: "https://pipecraft2-manual.readthedocs.io/en/stable/user_guide.html#indexes-file-example-fasta-formatted",
2695+
value:
2696+
"https://pipecraft2-manual.readthedocs.io/en/stable/user_guide.html#indexes-file-example-fasta-formatted",
26852697
disabled: "never",
26862698
type: "link",
26872699
tooltip: "link to PipeCraft manual page, index file examples",
2688-
},
2700+
},
26892701
{
26902702
name: "index_mismatch",
26912703
value: 0,

src/views/dada2Miseq.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,26 @@
6464
style="max-width: 34px; padding-top: 0; margin: 0"
6565
></v-checkbox>
6666
{{ service.serviceName.toUpperCase() }}
67+
<div v-if="service.manualLink">
68+
<v-tooltip left>
69+
<template v-slot:activator="{ on }">
70+
<v-icon
71+
v-on="on"
72+
right
73+
@click.stop
74+
@click="openLink(service.manualLink)"
75+
style="
76+
display: block;
77+
margin-left: auto;
78+
margin-right: 10px;
79+
"
80+
>mdi-help-circle-outline</v-icon
81+
>
82+
</template>
83+
<span>Check out the documentation for more info</span>
84+
</v-tooltip>
85+
</div>
86+
6787
<!-- <v-progress-circular
6888
v-if="
6989
$store.state.runInfo.active == true &&
@@ -264,6 +284,7 @@
264284
</template>
265285

266286
<script>
287+
const { shell } = require("electron");
267288
import InputNumeric from "../components/InputNumeric.vue";
268289
import InputLink from "../components/InputLink.vue";
269290
import InputBool from "../components/InputBool.vue";
@@ -301,6 +322,9 @@ export default {
301322
},
302323
},
303324
methods: {
325+
openLink(value) {
326+
shell.openExternal(value);
327+
},
304328
toggleExtra(index) {
305329
this.$store.commit("toggleExtraCustomWorkflow", {
306330
workflowName: this.$route.params.workflowName,

src/views/fastqcANDmultiqc.vue

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,7 @@ var dockerode = new Dockerode({ socketPath: socketPath });
110110
export default {
111111
name: "qualityPlots",
112112
data() {
113-
return {
114-
fileExtension: "",
115-
folderPath: "",
116-
reportReady: false,
117-
reportLoading: false,
118-
dockerActive: false,
119-
};
113+
return this.$store.state.Qcheck;
120114
},
121115
created() {
122116
var self = this;
@@ -133,7 +127,7 @@ export default {
133127
},
134128
methods: {
135129
folderSelect() {
136-
this.reportReady = false;
130+
this.$store.state.Qcheck.reportReady = false;
137131
Swal.mixin({
138132
input: "select",
139133
confirmButtonText: "Next &rarr;",
@@ -163,15 +157,20 @@ export default {
163157
.then(async (result) => {
164158
if (result.value) {
165159
console.log(result.value);
166-
this.fileExtension = result.value[0].replace("_", ".");
160+
this.$store.state.Qcheck.fileExtension = result.value[0].replace(
161+
"_",
162+
"."
163+
);
167164
dialog
168165
.showOpenDialog({
169166
title: "Select the folder containing your sequnece files",
170167
properties: ["openDirectory", "showHiddenFiles"],
171168
})
172169
.then((result) => {
173170
if (typeof result.filePaths[0] !== "undefined") {
174-
this.folderPath = slash(result.filePaths[0]);
171+
this.$store.state.Qcheck.folderPath = slash(
172+
result.filePaths[0]
173+
);
175174
}
176175
})
177176
.catch((err) => {
@@ -181,8 +180,8 @@ export default {
181180
});
182181
},
183182
async fastQualityCheck() {
184-
this.reportReady = false;
185-
this.reportLoading = true;
183+
this.$store.state.Qcheck.reportReady = false;
184+
this.$store.state.Qcheck.reportLoading = true;
186185
console.log("starting fastqc");
187186
let gotImg = await imageExists(dockerode, "staphb/fastqc:0.11.9");
188187
if (gotImg === false) {
@@ -211,9 +210,9 @@ export default {
211210
Tty: false,
212211
WorkingDir: "/input",
213212
HostConfig: {
214-
Binds: [`${this.folderPath}:/input`],
213+
Binds: [`${this.$store.state.Qcheck.folderPath}:/input`],
215214
},
216-
Env: [`format=${this.fileExtension}`],
215+
Env: [`format=${this.$store.state.Qcheck.fileExtension}`],
217216
}
218217
)
219218
.then(async ([res, container]) => {
@@ -243,9 +242,11 @@ export default {
243242
Tty: false,
244243
WorkingDir: "/input",
245244
HostConfig: {
246-
Binds: [`${this.folderPath}/quality_check:/input`],
245+
Binds: [
246+
`${this.$store.state.Qcheck.folderPath}/quality_check:/input`,
247+
],
247248
},
248-
Env: [`format=${this.fileExtension}`],
249+
Env: [`format=${this.$store.state.Qcheck.fileExtension}`],
249250
})
250251
.then(async ([res, container]) => {
251252
console.log(stdout.toString());
@@ -266,12 +267,12 @@ export default {
266267
return resObj;
267268
});
268269
console.log(result2);
269-
this.reportReady = true;
270-
this.reportLoading = false;
270+
this.$store.state.Qcheck.reportReady = true;
271+
this.$store.state.Qcheck.reportLoading = false;
271272
},
272273
openReport() {
273274
shell.openExternal(
274-
`file://${this.folderPath}/quality_check/multiqc_report.html`
275+
`file://${this.$store.state.Qcheck.folderPath}/quality_check/multiqc_report.html`
275276
);
276277
},
277278
},

0 commit comments

Comments
 (0)