diff --git a/src/Ot2Rec/aretomo.py b/src/Ot2Rec/aretomo.py index fa4bc71..c9353b6 100644 --- a/src/Ot2Rec/aretomo.py +++ b/src/Ot2Rec/aretomo.py @@ -157,16 +157,6 @@ def _get_aretomo_recon_command(self, i): # WBP cmd.append('-Wbp') cmd.append('1') - - out_imod = self.params['AreTomo_setup']['out_imod'] - if out_imod != "N/A": - outimod_lookup = { - "RELION4": "1", - "Warp": "2", - "Local alignment": "3", - } - cmd.append('-OutImod') - cmd.append(outimod_lookup[out_imod]) return cmd @@ -184,6 +174,16 @@ def _run_aretomo(self, i): recon_cmd = self._get_aretomo_recon_command(i) cmd = recon_cmd + out_imod = self.params['AreTomo_setup']['out_imod'] + if out_imod != "N/A": + outimod_lookup = { + "RELION4": "1", + "Warp": "2", + "Local alignment": "3", + } + cmd.append('-OutImod') + cmd.append(outimod_lookup[out_imod]) + # Add extra kwargs kwargs = self.params["AreTomo_kwargs"].keys() for kwarg in kwargs: @@ -206,11 +206,11 @@ def _run_aretomo(self, i): # If STA files are generated save folder names to move to common folder if self.params["AreTomo_setup"]["out_imod"] != "N/A": - input_mrc = self.params["AreTomo_setup"]["input_mrc"][i] + output_mrc = self.params["AreTomo_setup"]["output_mrc"][i] self.sta[curr_ts] = ( f'{self.basis_folder}/' f'{self.rootname}_{curr_ts:04d}{self.suffix}/' - f'{os.path.splitext(os.path.basename(input_mrc))[0]}_rec_Imod/' + f'{os.path.splitext(os.path.basename(output_mrc))[0]}_Imod/' ) self.logObj(f"\nStdOut:{aretomo_run.stdout}\n")