I’m trying to convert particles extracted in cryosparc using the updated csparc2star.py and I’m running into an error that looks related to the new strip_path_uid function. The command and error are below. Does anyone have suggestions?
File "./csparc2star.py", line 128, in <module>
sys.exit(main(parser.parse_args()))
File "./csparc2star.py", line 61, in main
df = star.strip_path_uids(df, inplace=True, count=args.strip_uid)
File "/home/XXX/pyem/pyem/pyem/star.py", line 699, in strip_path_uids
df[Relion.MICROGRAPH_NAME] = df[Relion.MICROGRAPH_NAME].str.replace(pat, "", regex=True, count=count)
File "/home/XXX/pyem/lib/python3.8/site-packages/pandas/core/strings/accessor.py", line 116, in wrapper
return func(self, *args, **kwargs)
TypeError: replace() got an unexpected keyword argument 'count'
I have been getting the exact same error since yesterday. I am trying to convert particles that I refined using the newest version of Cryosparc (3.3.1). I can still, however, convert particles processed using previous versions (e.g 3.2.x). Nothing I’ve tried has worked so an update (pyem) may be required to fix?
This error was from the updated version of pyem that should be able to handle the numbers in the paths. It’s not really a solution but I was able to work around this by using the older version of pyem to get a converted file containing UIDs and then use a search and replace script to remove those.
@gptomaleri Yes, it’s fixed. And the UIDs are being stripped as well. In the future I will add the ability to specify a certain depth of UIDs to keep (since more UIDs are added with each export/import round), for now they will all be removed if --strip-uid is passed.
For --copy-micrograph-coordinates the stripped UIDs are always tried if it fails on the attempt with the raw path names.