Hi,
we have an issue with csparc2star.py. We extracted particles in Relion, then imported them in Cryosparc where we did 2D classification. We would like to convert selected particles back into .star file, but we get the an error (copied below).
We have the latest pyem installed.
csparc2star.py particles_selected.cs csparc.star
Defocus values not found
Traceback (most recent call last):
File "/media/Data/software/pyem/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 2897, in get_loc
return self._engine.get_loc(key)
File "pandas/_libs/index.pyx", line 107, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 131, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1607, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1614, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'rlnMicrographName'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/media/Data/software/pyem/pyem/csparc2star.py", line 105, in <module>
sys.exit(main(parser.parse_args()))
File "/media/Data/software/pyem/pyem/csparc2star.py", line 79, in main
star.write_star(args.output, df, resort_records=True)
File "/media/Data/software/pyem/pyem/pyem/star.py", line 288, in write_star
df = sort_records(df, inplace=True)
File "/media/Data/software/pyem/pyem/pyem/star.py", line 420, in sort_records
df = natsort_values(df, Relion.MICROGRAPH_NAME, inplace=True)
File "/media/Data/software/pyem/pyem/pyem/util/util.py", line 132, in natsort_values
idx = np.array(natsort.index_natsorted(df[col]))
File "/media/Data/software/pyem/lib/python3.7/site-packages/pandas/core/frame.py", line 2995, in __getitem__
indexer = self.columns.get_loc(key)
File "/media/Data/software/pyem/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 2899, in get_loc
return self._engine.get_loc(self._maybe_cast_indexer(key))
File "pandas/_libs/index.pyx", line 107, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 131, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1607, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1614, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'rlnMicrographName'
Any ideas what could be wrong?
Thank you!