def create_CRANE_denoised_file(tof, param_set1, param_set2):
    ms1_denoiser = initialise_denoiser_crane(param_set1)
    ms2_denoiser = initialise_denoiser_crane(param_set2)
    tof_path = tof_dir + tof

    if ms1_denoiser.levels > 7:
        split_size = ms1_denoiser.levels ** 2
    else:
        split_size = 128

    if len(tof_path) > 0:
        denoiser = App(
            tof_fname=tof_path,
            srl_paths=[srl_path, irt_srl_path],
            denoiser=ms2_denoiser,
            mass_range_calculator=MassRangeCalculatorNonOverlappingPPMFullWidth(
                ppm_full_width=100,
                split_size=split_size,
            ),
            ms1_denoiser=ms1_denoiser,  # None = same as MS2
            denoised_fname=tof_path.replace(
                '.tof',
                '.crane_MS1_{}_MS2_{}_64var.tof'.format(param_set1, param_set2)
            ),
            window_name=None,
            include_ms1=True,
        )
        if not os.path.isfile(denoiser.denoised_fname):
            print('Denoising:', denoiser.denoised_fname)
            denoiser.run()
            return denoiser.denoised_fname + ' created successfully'
        else:
            return denoiser.denoised_fname + ' already exists'
def create_BEADS_denoised_file(tof):
    ms1_denoiser = BEADS()
    ms2_denoiser = BEADS()
    tof_path = tof_dir + tof
    split_size = 128

    if len(tof_path) > 0:
        denoiser = App(
            tof_fname=tof_path,
            srl_paths=[srl_path, irt_srl_path],
            denoiser=ms2_denoiser,
            mass_range_calculator=MassRangeCalculatorNonOverlappingPPMFullWidth(
                ppm_full_width=100,
                split_size=split_size,
            ),
            ms1_denoiser=ms1_denoiser,  # None = same as MS2
            denoised_fname=tof_path.replace('.tof', '.BEADS_64fix.tof'),
            window_name=None,
            include_ms1=True,
        )
        if not os.path.isfile(denoiser.denoised_fname):
            print('Denoising:', denoiser.denoised_fname)
            denoiser.run()
            return denoiser.denoised_fname + ' created successfully'
        else:
            return denoiser.denoised_fname + ' already exists'