Hi Daniel,
Yes it looks the same error, sorry I didn’t notice it and thanks for sharing.
But I still cannot resolve the error in my case.
As you suggested in the other topic, I used the flag --loglevel debug, the error is copied below.
- You suggest to use .cs file from a step before. In our case, we did particle extraction in Relion, so I used imported_particles.cs file. I get the same error as when using particles_selected.cs after 2D classification, therefore I assume that micrograph names are already missing in the first .cs?
csparc2star.py imported_particles.cs csparc.star --loglevel debug
Detected CryoSPARC 2+ .cs file
Reading primary file
Classification parameters not found
Directly copied fields: rlnVoltage, rlnAmplitudeContrast, ucsfImageIndex, rlnSphericalAberration, rlnPhaseShift, ucsfImagePath, ucsfUid, rlnDetectorPixelSize, rlnDefocusAngle, rlnDefocusU, rlnDefocusV, rlnMagnification
Converting DEFOCUSANGLE from degrees to radians
Converting PHASESHIFT from degrees to radians
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
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’
- I also tried the command with --copy-micrograph-coordinates flag together with imported particles.star file and this is the error in this case:
csparc2star.py --copy-micrograph-coordinates particles.star particles_selected.cs csparc.star --loglevel debug
Detected CryoSPARC 2+ .cs file
Reading primary file
Classification parameters not found
Directly copied fields: rlnDetectorPixelSize, ucsfImagePath, ucsfImageIndex, ucsfUid, rlnMagnification
Defocus values not found
Coordinates merge key: None
Traceback (most recent call last):
File “/media/Data/software/pyem/pyem/csparc2star.py”, line 105, in
sys.exit(main(parser.parse_args()))
File “/media/Data/software/pyem/pyem/csparc2star.py”, line 68, in main
df = star.smart_merge(df, coord_star, fields=fields, key=key)
File “/media/Data/software/pyem/pyem/pyem/star.py”, line 101, in smart_merge
s2 = s2.set_index(key, drop=False)
File “/media/Data/software/pyem/lib/python3.7/site-packages/pandas/core/frame.py”, line 4411, in set_index
raise KeyError(“None of {} are in the columns”.format(missing))
KeyError: ‘None of [None] are in the columns’
Thanks for the help!