Hi, is there any way to convert the csv metadata file generated with CryoSPARC to a star file? For example, if I want to compare refinement of a class isolated by heterogeneous reconstruction in CryoSPARC in both RELION and CryoSPARC?
(I guess I can write a script to do this myself if needed, but I don’t want to re-invent the wheel…)
This is something that’s on our TODO list to be able to handle directly inside cryoSPARC. In the mean time, Daniel Asarnow (UCSF) wrote a python script that does this. See the csparc2star.py in https://github.com/asarnow/pyem Note that we’ve not reviewed or used this ourself so if you have any issues with it you’ll need to contact Daniel directly.
Thanks Marcus - I have tried this script but with no luck I’m afraid - it seems to be looking for a key, data_input_rel_path, which is not present in the csv. The key that is present instead is data_input_idx, which is an integer. My csv file was generated from a star referring to a single stack of all the particle images - am I correct in thinking that this field refers to the particle number in the stack? Or is it something else?
Yes the data_input_idx is the (zero based) index into the original star file you used to set up the dataset. data_input_rel_path would be set if the original star file had references multiple different mrc stacks.
Maybe it would be good to keep data_input_rel_path in there, even when it is constant? Would make it easier for star file conversion (because otherwise the stack name needs to be supplied separately).
Daniel has now kindly updated the script to take account of this situation:
“With the new version, the --data-path option is used to give the stack location, like:
csparc2star.py --data-path Particles/Micrographs/single_stack.mrcs cryosparc.csv output.star”
I used Daniel’s script and it works well. However, it seems the original cSPARC .csv files have 3 empty lines at the end, which need to be removed for script to work.
There is something wrong with the conversion script, the distribution of angles of the output star file fall into a vary narrow range. Does anyone know how to fix this? Thanks,
Hi @jcoleman Have you reported it to the author of the script, Daniel Asarnow? I noticed that continuing refinements from the resulting star file was unsuccessful, and I wonder if this is related to the issue you observe.
I am trying to use the $ python csparc2star.py <cryosparc_exp000211_006.csv> (that is the metadata from the homogeneous refinement output). It gives me this error: -bash: syntax error near unexpected token `newline’
Am I doing something wrong?
You don’t need to run the program with python, because it has a #! line already that calls env python2.7. The error you get indicates that bash is trying to interpret the command, not python. Perhaps, you have misinterpreted the money sign $ as part of the command. It’s just a symbol for the bash command prompt.
I have been trying csparc2star.py. It runs fine, but when I use the resultant star file to re-extract particles in relion, I get images attached. What could be the problem?
@zehre It seems your star file is still missing the particle coordinates and micrograph name. In this case, Relion tries to re-extract from the particle images. Relion always replicates the last column or row when images aren’t large enough to shift, so you get streaks.
Please follow the tutorial on my wiki page (in particular the “merge micrograph information” section) and let us know if it works.