@@ -110,13 +110,7 @@ var dockerode = new Dockerode({ socketPath: socketPath });
110110export 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 →" ,
@@ -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