Import .cs file type

Is it possible to import cryosparc particles to another cryosparc database? Using the “Import Particle Stack” .cs extension is not recognized.

Traceback (most recent call last):
  File "cryosparc2_master/cryosparc2_compute/run.py", line 78, in cryosparc2_compute.run.main
  File "cryosparc2_compute/jobs/imports/run.py", line 196, in run_import_particles
    assert False, "Cannot import file of type %s " % ext
AssertionError: Cannot import file of type cs 
2 Likes

I’ve found that I also can not import .cs files back intro cryosparc.

Safi

Hi @safmas, @mturk, sorry you have run into this missing feature… it’s part of a list of many basic utilities (star file export, etc) that we are adding in a hurry. Look out for it in the next release.

Dear Ali,

It seems the import/export between projects and programs is still not implemented in version 2.8.0. Any estimate on the release time frame for these functionalities?

Best,

Petya

Have these efforts been dropped?

I notice its still not possible to import .cs particle properties into cryosparc and there is also no option to export to .star files even though csparc2star.py support has also been abandoned

On the Structura side, you’ve been able to directly import cryosparc jobs back into cryosparc for some time now. And csparc2star.py is certainly not abandoned.

I know you can import project directories but we were ot able to find a way to import just the Exported particles job alone. We did end up importing the particles using csparc2star to convert the particles_passthough.cs to a star file since the Import Particles job does not take .cs files.

On your second note, support for pyem has in fact stopped as stated in the GitHub for pyem back in November of 2020 under the assumption that an export to star functionality was coming to the cryopsarc user interface. Correct me if I missed something, but I have not yet found this function embedded in cryosparc and judging by the forum it is still not part of cryosparc

Hi @schiracha,

As @DanielAsarnow mentioned, for quite a while cryoSPARC has the “import result group” job type that lets you import any cryoSPARC output .cs/.csg file (particles, movies, micrographs, templates, etc).
You can also import an individual job or an entire project.
Daniel has also been continuing to support and improve pyem (thanks Daniel!!) and it is fully functional. We have not yet been able to integrate .star file output in cryoSPARC itself.

4 Likes

Hi @apunjani,

I tried importing a cs file however I do have troubles with it. I selected particles from it based on an outside analysis. Its a particle.cs file. When I try to import through the import result group: I get the following error:

Traceback (most recent call last):
  File "cryosparc_master/cryosparc_compute/run.py", line 84, in cryosparc_compute.run.main
  File "/home/svc_cryosparc/cryosparc2_master/cryosparc_compute/jobs/imports/run.py", line 1021, in run_import_result_group
    cs_group = yaml.safe_load(openfile)
  File "/home/svc_cryosparc/cryosparc2_master/deps/anaconda/envs/cryosparc_master_env/lib/python3.7/site-packages/yaml/__init__.py", line 162, in safe_load
    return load(stream, SafeLoader)
  File "/home/svc_cryosparc/cryosparc2_master/deps/anaconda/envs/cryosparc_master_env/lib/python3.7/site-packages/yaml/__init__.py", line 112, in load
    loader = Loader(stream)
  File "/home/svc_cryosparc/cryosparc2_master/deps/anaconda/envs/cryosparc_master_env/lib/python3.7/site-packages/yaml/loader.py", line 34, in __init__
    Reader.__init__(self, stream)
  File "/home/svc_cryosparc/cryosparc2_master/deps/anaconda/envs/cryosparc_master_env/lib/python3.7/site-packages/yaml/reader.py", line 85, in __init__
    self.determine_encoding()
  File "/home/svc_cryosparc/cryosparc2_master/deps/anaconda/envs/cryosparc_master_env/lib/python3.7/site-packages/yaml/reader.py", line 124, in determine_encoding
    self.update_raw()
  File "/home/svc_cryosparc/cryosparc2_master/deps/anaconda/envs/cryosparc_master_env/lib/python3.7/site-packages/yaml/reader.py", line 178, in update_raw
    data = self.stream.read(size)
  File "/home/svc_cryosparc/cryosparc2_master/deps/anaconda/envs/cryosparc_master_env/lib/python3.7/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x93 in position 0: invalid start byte

However I am getting the same error when I try importing the original untouched cs file. Any idea what could be done?

I manged. I wrote a csg file referrring to the new cs file and it worked! Sorry for bothering.