Open james-vincent opened 12 months ago
Hi James, Thanks for the report - I think I know what the bug is: PickTomo will look for rlnTomoReconstructedTomogram in your tomogram.star file, but you don't have that header as you have generated tomograms for denoising, and generated denoised tomograms but not generated tomograms not for denoising which is a slightly convoluted requirement from us!...I will fix this soon so pick tomo reads the denoised tomo or one of the half tomograms, but for now, you just rename the header 'rlnTomoReconstructedTomogramDenoised' in the tomogram.star file to 'rlnTomoReconstructedTomogram' and that should fix it. Let me know how it goes. Thanks Euan
Thanks for the quick response. I'm the go between for a user. This user reports:
I should note I get the same error with tomograms which have not been denoised. The issue seems to be specific to particle picking mode rather than the "type" of tomogram input/
Ah ok. So the tomo pipeline isn't finished yet and the PickTomo function is probably the most unfinished part of it (most of the rest is functional). For now I'd recommend doing the picking in another program (maybe Dynamo or ArtiaX), and ensure your picked coordinates are given in unbinned pixels. For later, make sure you extract particles WITHOUT the 2D stack function turned on (this is also not finished) but the rest should be fully functional.
Is there any update on this I encountered almost the same error and the rlnTomoReconstructedTomogram header is there: ╭───────────────────── Traceback (most recent call last) ──────────────────────╮ │ /programs/x86_64-linux/relion/5.0-beta_cu12.2/relion_extlib/miniconda3-4.10. │ │ 3-orl6/envs/relion-5.0/lib/python3.10/site-packages/pandas/core/indexes/base │ │ .py:3790 in get_loc │ │ │ │ 3787 │ │ """ │ │ 3788 │ │ casted_key = self._maybe_cast_indexer(key) │ │ 3789 │ │ try: │ │ ❱ 3790 │ │ │ return self._engine.get_loc(casted_key) │ │ 3791 │ │ except KeyError as err: │ │ 3792 │ │ │ if isinstance(casted_key, slice) or ( │ │ 3793 │ │ │ │ isinstance(casted_key, abc.Iterable) │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ casted_key = 'global' │ │ │ │ key = 'global' │ │ │ │ self = Index(['rlnTomoName', 'rlnVoltage', │ │ │ │ 'rlnSphericalAberration', │ │ │ │ │ 'rlnAmplitudeContrast', │ │ │ │ 'rlnMicrographOriginalPixelSize', 'rlnTomoHand', │ │ │ │ │ 'rlnTomoTiltSeriesPixelSize', │ │ │ │ 'rlnTomoTiltSeriesStarFile', │ │ │ │ │ 'rlnTomoTomogramBinning', 'rlnTomoSizeX', │ │ │ │ 'rlnTomoSizeY', │ │ │ │ │ 'rlnTomoSizeZ', 'rlnTomoReconstructedTomogram'], │ │ │ │ │ dtype='object') │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ in pandas._libs.index.IndexEngine.get_loc:152 │ │ │ │ in pandas._libs.index.IndexEngine.get_loc:181 │ │ │ │ in pandas._libs.hashtable.PyObjectHashTable.get_item:7080 │ │ │ │ in pandas._libs.hashtable.PyObjectHashTable.get_item:7088 │ ╰──────────────────────────────────────────────────────────────────────────────╯ KeyError: 'global'
The above exception was the direct cause of the following exception:
╭───────────────────── Traceback (most recent call last) ──────────────────────╮ │ in combine_particle_annotations:2 │ │ ╭─────────────────────────────── locals ───────────────────────────────╮ │ │ │ annotations_directory = PosixPath('PickTomo/job013/annotations') │ │ │ │ output_directory = PosixPath('PickTomo/job013') │ │ │ │ pipeline_control = PosixPath('PickTomo/job013') │ │ │ │ tilt_series_star_file = PosixPath('Tomograms/job011/tomograms.star') │ │ │ ╰──────────────────────────────────────────────────────────────────────╯ │ │ │ │ /programs/x86_64-linux/relion/5.0-beta_cu12.2/relion_extlib/miniconda3-4.10. │ │ 3-orl6/envs/relion-5.0/lib/python3.10/site-packages/tomography_python_progra │ │ ms/_utils/relion.py:75 in pipeline_job │ │ │ │ 72 │ │ │ job_directory.mkdir(parents=True, exist_ok=True) │ │ 73 │ │ try: │ │ 74 │ │ │ pipeline_directory = kwargs.pop(PIPELINE_CONTROL_KEYWORD_AR │ │ ❱ 75 │ │ │ func(*args, *kwargs) │ │ 76 │ │ │ if job_directory is not None and pipeline_directory is not │ │ 77 │ │ │ │ write_job_success_file(job_directory) │ │ 78 │ │ except BaseException: │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ args = () │ │ │ │ func = <function combine_particle_annotations at │ │ │ │ 0x7f14622f4430> │ │ │ │ job_directory = PosixPath('PickTomo/job013') │ │ │ │ kwargs = { │ │ │ │ │ 'tilt_series_star_file': │ │ │ │ PosixPath('Tomograms/job011/tomograms.star'), │ │ │ │ │ 'annotations_directory': │ │ │ │ PosixPath('PickTomo/job013/annotations'), │ │ │ │ │ 'output_directory': │ │ │ │ PosixPath('PickTomo/job013') │ │ │ │ } │ │ │ │ pipeline_directory = PosixPath('PickTomo/job013') │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /programs/x86_64-linux/relion/5.0-beta_cu12.2/relion_extlib/miniconda3-4.10. │ │ 3-orl6/envs/relion-5.0/lib/python3.10/site-packages/tomography_python_progra │ │ ms/get_particle_poses/particles.py:27 in combine_particle_annotations │ │ │ │ 24 │ ) │ │ 25 ): │ │ 26 │ star = starfile.read(tilt_series_star_file) │ │ ❱ 27 │ global_table = star['global'].set_index('rlnTomoName') │ │ 28 │ annotation_files = annotations_directory.glob('_particles.star') │ │ 29 │ dfs = [] │ │ 30 │ for file in annotation_files: │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ annotations_directory = PosixPath('PickTomo/job013/annotations') │ │ │ │ output_directory = PosixPath('PickTomo/job013') │ │ │ │ star = │ rlnTomoName ... │ │ │ │ rlnTomoReconstructedTomogram │ │ │ │ 0 Position_1 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1.mrc │ │ │ │ 1 Position_1_10 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_10.mrc │ │ │ │ 2 Position_1_11 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_11.mrc │ │ │ │ 3 Position_1_12 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_12.mrc │ │ │ │ 4 Position_1_13 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_13.mrc │ │ │ │ 5 Position_1_2 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_2.mrc │ │ │ │ 6 Position_1_3 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_3.mrc │ │ │ │ 7 Position_1_4 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_4.mrc │ │ │ │ 8 Position_1_5 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_5.mrc │ │ │ │ 9 Position_1_6 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_6.mrc │ │ │ │ 10 Position_1_7 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_7.mrc │ │ │ │ 11 Position_1_8 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_8.mrc │ │ │ │ 12 Position_1_9 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_9.mrc │ │ │ │ │ │ │ │ [13 rows x 13 columns] │ │ │ │ tilt_series_star_file = PosixPath('Tomograms/job011/tomograms.star') │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /programs/x86_64-linux/relion/5.0-beta_cu12.2/relion_extlib/miniconda3-4.10. │ │ 3-orl6/envs/relion-5.0/lib/python3.10/site-packages/pandas/core/frame.py:389 │ │ 3 in getitem │ │ │ │ 3890 │ │ if is_single_key: │ │ 3891 │ │ │ if self.columns.nlevels > 1: │ │ 3892 │ │ │ │ return self._getitem_multilevel(key) │ │ ❱ 3893 │ │ │ indexer = self.columns.get_loc(key) │ │ 3894 │ │ │ if is_integer(indexer): │ │ 3895 │ │ │ │ indexer = [indexer] │ │ 3896 │ │ else: │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ is_mi = False │ │ │ │ is_single_key = True │ │ │ │ key = 'global' │ │ │ │ self = │ rlnTomoName ... │ │ │ │ rlnTomoReconstructedTomogram │ │ │ │ 0 Position_1 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1.mrc │ │ │ │ 1 Position_1_10 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_10.mrc │ │ │ │ 2 Position_1_11 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_11.mrc │ │ │ │ 3 Position_1_12 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_12.mrc │ │ │ │ 4 Position_1_13 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_13.mrc │ │ │ │ 5 Position_1_2 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_2.mrc │ │ │ │ 6 Position_1_3 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_3.mrc │ │ │ │ 7 Position_1_4 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_4.mrc │ │ │ │ 8 Position_1_5 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_5.mrc │ │ │ │ 9 Position_1_6 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_6.mrc │ │ │ │ 10 Position_1_7 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_7.mrc │ │ │ │ 11 Position_1_8 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_8.mrc │ │ │ │ 12 Position_1_9 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_9.mrc │ │ │ │ │ │ │ │ [13 rows x 13 columns] │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /programs/x86_64-linux/relion/5.0-beta_cu12.2/relion_extlib/miniconda3-4.10. │ │ 3-orl6/envs/relion-5.0/lib/python3.10/site-packages/pandas/core/indexes/base │ │ .py:3797 in get_loc │ │ │ │ 3794 │ │ │ │ and any(isinstance(x, slice) for x in casted_key) │ │ 3795 │ │ │ ): │ │ 3796 │ │ │ │ raise InvalidIndexError(key) │ │ ❱ 3797 │ │ │ raise KeyError(key) from err │ │ 3798 │ │ except TypeError: │ │ 3799 │ │ │ # If we have a listlike key, _check_indexing_error will r │ │ 3800 │ │ │ # InvalidIndexError. Otherwise we fall through and re-ra │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ casted_key = 'global' │ │ │ │ key = 'global' │ │ │ │ self = Index(['rlnTomoName', 'rlnVoltage', │ │ │ │ 'rlnSphericalAberration', │ │ │ │ │ 'rlnAmplitudeContrast', │ │ │ │ 'rlnMicrographOriginalPixelSize', 'rlnTomoHand', │ │ │ │ │ 'rlnTomoTiltSeriesPixelSize', │ │ │ │ 'rlnTomoTiltSeriesStarFile', │ │ │ │ │ 'rlnTomoTomogramBinning', 'rlnTomoSizeX', │ │ │ │ 'rlnTomoSizeY', │ │ │ │ │ 'rlnTomoSizeZ', 'rlnTomoReconstructedTomogram'], │ │ │ │ │ dtype='object') │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ ╰──────────────────────────────────────────────────────────────────────────────╯ KeyError: 'global' ╭───────────────────── Traceback (most recent call last) ──────────────────────╮ │ /programs/x86_64-linux/relion/5.0-beta_cu12.2/relion_extlib/miniconda3-4.10. │ │ 3-orl6/envs/relion-5.0/lib/python3.10/site-packages/pandas/core/indexes/base │ │ .py:3790 in get_loc │ │ │ │ 3787 │ │ """ │ │ 3788 │ │ casted_key = self._maybe_cast_indexer(key) │ │ 3789 │ │ try: │ │ ❱ 3790 │ │ │ return self._engine.get_loc(casted_key) │ │ 3791 │ │ except KeyError as err: │ │ 3792 │ │ │ if isinstance(casted_key, slice) or ( │ │ 3793 │ │ │ │ isinstance(casted_key, abc.Iterable) │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ casted_key = 'global' │ │ │ │ key = 'global' │ │ │ │ self = Index(['rlnTomoName', 'rlnVoltage', │ │ │ │ 'rlnSphericalAberration', │ │ │ │ │ 'rlnAmplitudeContrast', │ │ │ │ 'rlnMicrographOriginalPixelSize', 'rlnTomoHand', │ │ │ │ │ 'rlnTomoTiltSeriesPixelSize', │ │ │ │ 'rlnTomoTiltSeriesStarFile', │ │ │ │ │ 'rlnTomoTomogramBinning', 'rlnTomoSizeX', │ │ │ │ 'rlnTomoSizeY', │ │ │ │ │ 'rlnTomoSizeZ', 'rlnTomoReconstructedTomogram'], │ │ │ │ │ dtype='object') │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ in pandas._libs.index.IndexEngine.get_loc:152 │ │ │ │ in pandas._libs.index.IndexEngine.get_loc:181 │ │ │ │ in pandas._libs.hashtable.PyObjectHashTable.get_item:7080 │ │ │ │ in pandas._libs.hashtable.PyObjectHashTable.get_item:7088 │ ╰──────────────────────────────────────────────────────────────────────────────╯ KeyError: 'global'
The above exception was the direct cause of the following exception:
╭───────────────────── Traceback (most recent call last) ──────────────────────╮ │ in combine_particle_annotations:2 │ │ ╭─────────────────────────────── locals ───────────────────────────────╮ │ │ │ annotations_directory = PosixPath('PickTomo/job013/annotations') │ │ │ │ output_directory = PosixPath('PickTomo/job013') │ │ │ │ pipeline_control = PosixPath('PickTomo/job013') │ │ │ │ tilt_series_star_file = PosixPath('Tomograms/job011/tomograms.star') │ │ │ ╰──────────────────────────────────────────────────────────────────────╯ │ │ │ │ /programs/x86_64-linux/relion/5.0-beta_cu12.2/relion_extlib/miniconda3-4.10. │ │ 3-orl6/envs/relion-5.0/lib/python3.10/site-packages/tomography_python_progra │ │ ms/_utils/relion.py:75 in pipeline_job │ │ │ │ 72 │ │ │ job_directory.mkdir(parents=True, exist_ok=True) │ │ 73 │ │ try: │ │ 74 │ │ │ pipeline_directory = kwargs.pop(PIPELINE_CONTROL_KEYWORD_AR │ │ ❱ 75 │ │ │ func(*args, *kwargs) │ │ 76 │ │ │ if job_directory is not None and pipeline_directory is not │ │ 77 │ │ │ │ write_job_success_file(job_directory) │ │ 78 │ │ except BaseException: │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ args = () │ │ │ │ func = <function combine_particle_annotations at │ │ │ │ 0x7fd183f60430> │ │ │ │ job_directory = PosixPath('PickTomo/job013') │ │ │ │ kwargs = { │ │ │ │ │ 'tilt_series_star_file': │ │ │ │ PosixPath('Tomograms/job011/tomograms.star'), │ │ │ │ │ 'annotations_directory': │ │ │ │ PosixPath('PickTomo/job013/annotations'), │ │ │ │ │ 'output_directory': │ │ │ │ PosixPath('PickTomo/job013') │ │ │ │ } │ │ │ │ pipeline_directory = PosixPath('PickTomo/job013') │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /programs/x86_64-linux/relion/5.0-beta_cu12.2/relion_extlib/miniconda3-4.10. │ │ 3-orl6/envs/relion-5.0/lib/python3.10/site-packages/tomography_python_progra │ │ ms/get_particle_poses/particles.py:27 in combine_particle_annotations │ │ │ │ 24 │ ) │ │ 25 ): │ │ 26 │ star = starfile.read(tilt_series_star_file) │ │ ❱ 27 │ global_table = star['global'].set_index('rlnTomoName') │ │ 28 │ annotation_files = annotations_directory.glob('_particles.star') │ │ 29 │ dfs = [] │ │ 30 │ for file in annotation_files: │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ annotations_directory = PosixPath('PickTomo/job013/annotations') │ │ │ │ output_directory = PosixPath('PickTomo/job013') │ │ │ │ star = │ rlnTomoName ... │ │ │ │ rlnTomoReconstructedTomogram │ │ │ │ 0 Position_1 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1.mrc │ │ │ │ 1 Position_1_10 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_10.mrc │ │ │ │ 2 Position_1_11 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_11.mrc │ │ │ │ 3 Position_1_12 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_12.mrc │ │ │ │ 4 Position_1_13 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_13.mrc │ │ │ │ 5 Position_1_2 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_2.mrc │ │ │ │ 6 Position_1_3 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_3.mrc │ │ │ │ 7 Position_1_4 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_4.mrc │ │ │ │ 8 Position_1_5 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_5.mrc │ │ │ │ 9 Position_1_6 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_6.mrc │ │ │ │ 10 Position_1_7 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_7.mrc │ │ │ │ 11 Position_1_8 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_8.mrc │ │ │ │ 12 Position_1_9 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_9.mrc │ │ │ │ │ │ │ │ [13 rows x 13 columns] │ │ │ │ tilt_series_star_file = PosixPath('Tomograms/job011/tomograms.star') │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /programs/x86_64-linux/relion/5.0-beta_cu12.2/relion_extlib/miniconda3-4.10. │ │ 3-orl6/envs/relion-5.0/lib/python3.10/site-packages/pandas/core/frame.py:389 │ │ 3 in getitem │ │ │ │ 3890 │ │ if is_single_key: │ │ 3891 │ │ │ if self.columns.nlevels > 1: │ │ 3892 │ │ │ │ return self._getitem_multilevel(key) │ │ ❱ 3893 │ │ │ indexer = self.columns.get_loc(key) │ │ 3894 │ │ │ if is_integer(indexer): │ │ 3895 │ │ │ │ indexer = [indexer] │ │ 3896 │ │ else: │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ is_mi = False │ │ │ │ is_single_key = True │ │ │ │ key = 'global' │ │ │ │ self = │ rlnTomoName ... │ │ │ │ rlnTomoReconstructedTomogram │ │ │ │ 0 Position_1 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1.mrc │ │ │ │ 1 Position_1_10 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_10.mrc │ │ │ │ 2 Position_1_11 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_11.mrc │ │ │ │ 3 Position_1_12 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_12.mrc │ │ │ │ 4 Position_1_13 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_13.mrc │ │ │ │ 5 Position_1_2 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_2.mrc │ │ │ │ 6 Position_1_3 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_3.mrc │ │ │ │ 7 Position_1_4 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_4.mrc │ │ │ │ 8 Position_1_5 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_5.mrc │ │ │ │ 9 Position_1_6 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_6.mrc │ │ │ │ 10 Position_1_7 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_7.mrc │ │ │ │ 11 Position_1_8 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_8.mrc │ │ │ │ 12 Position_1_9 ... │ │ │ │ Tomograms/job011/tomograms/rec_Position_1_9.mrc │ │ │ │ │ │ │ │ [13 rows x 13 columns] │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /programs/x86_64-linux/relion/5.0-beta_cu12.2/relion_extlib/miniconda3-4.10. │ │ 3-orl6/envs/relion-5.0/lib/python3.10/site-packages/pandas/core/indexes/base │ │ .py:3797 in get_loc │ │ │ │ 3794 │ │ │ │ and any(isinstance(x, slice) for x in casted_key) │ │ 3795 │ │ │ ): │ │ 3796 │ │ │ │ raise InvalidIndexError(key) │ │ ❱ 3797 │ │ │ raise KeyError(key) from err │ │ 3798 │ │ except TypeError: │ │ 3799 │ │ │ # If we have a listlike key, _check_indexing_error will r │ │ 3800 │ │ │ # InvalidIndexError. Otherwise we fall through and re-ra │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ casted_key = 'global' │ │ │ │ key = 'global' │ │ │ │ self = Index(['rlnTomoName', 'rlnVoltage', │ │ │ │ 'rlnSphericalAberration', │ │ │ │ │ 'rlnAmplitudeContrast', │ │ │ │ 'rlnMicrographOriginalPixelSize', 'rlnTomoHand', │ │ │ │ │ 'rlnTomoTiltSeriesPixelSize', │ │ │ │ 'rlnTomoTiltSeriesStarFile', │ │ │ │ │ 'rlnTomoTomogramBinning', 'rlnTomoSizeX', │ │ │ │ 'rlnTomoSizeY', │ │ │ │ │ 'rlnTomoSizeZ', 'rlnTomoReconstructedTomogram'], │ │ │ │ │ dtype='object') │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ ╰──────────────────────────────────────────────────────────────────────────────╯ KeyError: 'global'
I ran the tutorial dataset pretty much as in the tutorial I just changed the surface picking to particle picking and get the same result. any idea whats wrong?
Additionally if I use another picker, how do I import the results @EuanPyle ?
Hi I didn't write the particle picker so in probably not the best person to deal with this. You may get some help from someone who knows that part a bit better if you post the issue to the CCPEM mailing list. Sorry, I know that's annoying. As for importing, that actually depends on which version you're using, as this seems to have changed relatively recently
Noting this for others who may experience this issue:
As per CCPEM, this issue has been fixed:
"The current version should not have this problem. Did you update the conda environment when you pulled the latest version? This concerns a python wrapper that gets reinstalled if you update (or re-make) conda with the environment .yml file."
Relion 5 Job type - PickTomo
Key global throws error in pandas. Appears to be coming from:
│ 26 │ star = starfile.read(tilt_series_star_file) │ │ ❱ 27 │ global_table = star['global'].set_index('rlnTomoName') │
╭───────────────────── Traceback (most recent call last) ──────────────────────╮ │ /programs/x86_64-linux/relion/5.0-beta_cu11.6/relion_extlib/miniconda3-4.10. │ │ 3-orl6/envs/relion-5.0/lib/python3.10/site-packages/pandas/core/indexes/base │ │ .py:3790 in get_loc │ │ │ │ 3787 │ │ """ │ │ 3788 │ │ casted_key = self._maybe_cast_indexer(key) │ │ 3789 │ │ try: │ │ ❱ 3790 │ │ │ return self._engine.get_loc(casted_key) │ │ 3791 │ │ except KeyError as err: │ │ 3792 │ │ │ if isinstance(casted_key, slice) or ( │ │ 3793 │ │ │ │ isinstance(casted_key, abc.Iterable) │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ casted_key = 'global' │ │ │ │ key = 'global' │ │ │ │ self = Index(['rlnTomoName', 'rlnVoltage', │ │ │ │ 'rlnSphericalAberration', │ │ │ │ │ 'rlnAmplitudeContrast', │ │ │ │ 'rlnMicrographOriginalPixelSize', 'rlnTomoHand', │ │ │ │ │ 'rlnTomoTiltSeriesPixelSize', │ │ │ │ 'rlnTomoTiltSeriesStarFile', │ │ │ │ │ 'rlnTomoTomogramBinning', 'rlnTomoSizeX', │ │ │ │ 'rlnTomoSizeY', │ │ │ │ │ 'rlnTomoSizeZ', 'rlnTomoReconstructedTomogramHalf1', │ │ │ │ │ 'rlnTomoReconstructedTomogramHalf2', │ │ │ │ │ 'rlnTomoReconstructedTomogramDenoised'], │ │ │ │ │ dtype='object') │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ in pandas._libs.index.IndexEngine.get_loc:152 │ │ │ │ in pandas._libs.index.IndexEngine.get_loc:181 │ │ │ │ in pandas._libs.hashtable.PyObjectHashTable.get_item:7080 │ │ │ │ in pandas._libs.hashtable.PyObjectHashTable.get_item:7088 │ ╰──────────────────────────────────────────────────────────────────────────────╯ KeyError: 'global'
The above exception was the direct cause of the following exception:
╭───────────────────── Traceback (most recent call last) ──────────────────────╮ │ in combine_particle_annotations:2 │ │ ╭──────────────────────────────── locals ────────────────────────────────╮ │ │ │ annotations_directory = PosixPath('PickTomo/job034/annotations') │ │ │ │ output_directory = PosixPath('PickTomo/job034') │ │ │ │ pipeline_control = PosixPath('PickTomo/job034') │ │ │ │ tilt_series_star_file = PosixPath('DenoiseTomo/job033/tomograms.star') │ │ │ ╰────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /programs/x86_64-linux/relion/5.0-beta_cu11.6/relion_extlib/miniconda3-4.10. │ │ 3-orl6/envs/relion-5.0/lib/python3.10/site-packages/tomography_python_progra │ │ ms/_utils/relion.py:75 in pipeline_job │ │ │ │ 72 │ │ │ job_directory.mkdir(parents=True, exist_ok=True) │ │ 73 │ │ try: │ │ 74 │ │ │ pipeline_directory = kwargs.pop(PIPELINE_CONTROL_KEYWORD_AR │ │ ❱ 75 │ │ │ func(*args, *kwargs) │ │ 76 │ │ │ if job_directory is not None and pipeline_directory is not │ │ 77 │ │ │ │ write_job_success_file(job_directory) │ │ 78 │ │ except BaseException: │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ args = () │ │ │ │ func = <function combine_particle_annotations at │ │ │ │ 0x7f85db938430> │ │ │ │ job_directory = PosixPath('PickTomo/job034') │ │ │ │ kwargs = { │ │ │ │ │ 'tilt_series_star_file': │ │ │ │ PosixPath('DenoiseTomo/job033/tomograms.star'), │ │ │ │ │ 'annotations_directory': │ │ │ │ PosixPath('PickTomo/job034/annotations'), │ │ │ │ │ 'output_directory': │ │ │ │ PosixPath('PickTomo/job034') │ │ │ │ } │ │ │ │ pipeline_directory = PosixPath('PickTomo/job034') │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /programs/x86_64-linux/relion/5.0-beta_cu11.6/relion_extlib/miniconda3-4.10. │ │ 3-orl6/envs/relion-5.0/lib/python3.10/site-packages/tomography_python_progra │ │ ms/get_particle_poses/particles.py:27 in combine_particle_annotations │ │ │ │ 24 │ ) │ │ 25 ): │ │ 26 │ star = starfile.read(tilt_series_star_file) │ │ ❱ 27 │ global_table = star['global'].set_index('rlnTomoName') │ │ 28 │ annotation_files = annotations_directory.glob('_particles.star') │ │ 29 │ dfs = [] │ │ 30 │ for file in annotation_files: │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ annotations_directory = PosixPath('PickTomo/job034/annotations') │ │ │ │ output_directory = PosixPath('PickTomo/job034') │ │ │ │ star = │ rlnTomoName ... │ │ │ │ rlnTomoReconstructedTomogramDenoised │ │ │ │ 0 9x9_ts_65_sort ... │ │ │ │ DenoiseTomo/job033/tomograms/rec_9x9_ts_65_sor.… │ │ │ │ │ │ │ │ [1 rows x 15 columns] │ │ │ │ tilt_series_star_file = PosixPath('DenoiseTomo/job033/tomograms.star') │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /programs/x86_64-linux/relion/5.0-beta_cu11.6/relion_extlib/miniconda3-4.10. │ │ 3-orl6/envs/relion-5.0/lib/python3.10/site-packages/pandas/core/frame.py:389 │ │ 3 in getitem │ │ │ │ 3890 │ │ if is_single_key: │ │ 3891 │ │ │ if self.columns.nlevels > 1: │ │ 3892 │ │ │ │ return self._getitem_multilevel(key) │ │ ❱ 3893 │ │ │ indexer = self.columns.get_loc(key) │ │ 3894 │ │ │ if is_integer(indexer): │ │ 3895 │ │ │ │ indexer = [indexer] │ │ 3896 │ │ else: │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ is_mi = False │ │ │ │ is_single_key = True │ │ │ │ key = 'global' │ │ │ │ self = │ rlnTomoName ... │ │ │ │ rlnTomoReconstructedTomogramDenoised │ │ │ │ 0 9x9_ts_65_sort ... │ │ │ │ DenoiseTomo/job033/tomograms/rec_9x9_ts_65_sor... │ │ │ │ │ │ │ │ [1 rows x 15 columns] │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /programs/x86_64-linux/relion/5.0-beta_cu11.6/relion_extlib/miniconda3-4.10. │ │ 3-orl6/envs/relion-5.0/lib/python3.10/site-packages/pandas/core/indexes/base │ │ .py:3797 in get_loc │ │ │ │ 3794 │ │ │ │ and any(isinstance(x, slice) for x in casted_key) │ │ 3795 │ │ │ ): │ │ 3796 │ │ │ │ raise InvalidIndexError(key) │ │ ❱ 3797 │ │ │ raise KeyError(key) from err │ │ 3798 │ │ except TypeError: │ │ 3799 │ │ │ # If we have a listlike key, _check_indexing_error will r │ │ 3800 │ │ │ # InvalidIndexError. Otherwise we fall through and re-ra │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ casted_key = 'global' │ │ │ │ key = 'global' │ │ │ │ self = Index(['rlnTomoName', 'rlnVoltage', │ │ │ │ 'rlnSphericalAberration', │ │ │ │ │ 'rlnAmplitudeContrast', │ │ │ │ 'rlnMicrographOriginalPixelSize', 'rlnTomoHand', │ │ │ │ │ 'rlnTomoTiltSeriesPixelSize', │ │ │ │ 'rlnTomoTiltSeriesStarFile', │ │ │ │ │ 'rlnTomoTomogramBinning', 'rlnTomoSizeX', │ │ │ │ 'rlnTomoSizeY', │ │ │ │ │ 'rlnTomoSizeZ', 'rlnTomoReconstructedTomogramHalf1', │ │ │ │ │ 'rlnTomoReconstructedTomogramHalf2', │ │ │ │ │ 'rlnTomoReconstructedTomogramDenoised'], │ │ │ │ │ dtype='object') │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ ╰──────────────────────────────────────────────────────────────────────────────╯ KeyError: 'global'