Issues
CryoSPARC project needs to be moved¶
The easiest way to continue working with a CryoSPARC project after moving it to a different directory is to:
- Detach the project from CryoSPARC.
- Move the project directory to its new location.
- Reattach the project in CryoSPARC.
Recommended procedure
Always detach the project from CryoSPARC before moving its directory. This ensures that the project is properly removed from the CryoSPARC database before it is moved.
1. Detach the project¶
In CryoSPARC, open the project and select Detach Project.
2. Move the project directory¶
Move the project folder to its new location. For example:
3. Reattach the project¶
In CryoSPARC, use Attach Project to add the project from its new location.
CryoSPARC project was moved¶
If you moved the project directory before detaching it from CryoSPARC, the project may still be registered in the CryoSPARC database under its old location.
In this case, you can mark the project as deleted in the database and then attach it again from its new location.
Use with caution
The following procedure directly modifies the CryoSPARC database. Make sure that you specify the correct project ID and that the project directory has already been moved to its new location.
On a Merlin 7 login node, start the CryoSPARC interactive Python session:
CryoSPARC path
If your CryoSPARC installation is in a different directory, correct the path to cryosparc_master in the command above. For example, /data/user/$USER/cryosparc_beta/cryosparc_master/bin/cryosparcm icli
Once inside the interactive Python shell, specify the project ID you want to remove from the database. For example, for project P10:
Note
Replace P10 with the ID of the project you want to remove from the database.
After running the command, refresh your CryoSPARC browser session.
Next, navigate to the new project directory and remove the cs.lock file:
You can then use Attach Project in CryoSPARC to attach the project from its new location.
Check the project path
Before attaching the project, verify that you are selecting the correct project directory and that the project files are intact.
Correct symlinks¶
When raw data is imported into a CryoSPARC project, the data itself is not copied into the project directory. Instead, CryoSPARC creates symbolic links (symlinks) in the import job directory that point to the original data files.
If you move the data after importing it with an Import Particles, Import Micrographs, or Import Movies job, the original paths stored in these symlinks may no longer exist. As a result, the symlinks become broken and CryoSPARC can no longer access the imported data.
To repair these symlinks, use the replace_cryosparc_symlinks.py script provided on Merlin 7.
Start the CryoSPARC interactive Python session¶
Start a CryoSPARC interactive Python session by running:
CryoSPARC path
If your CryoSPARC installation is in a different directory, correct the path to cryosparc_master in the command above. For example, /data/user/$USER/cryosparc_beta/cryosparc_master/bin/cryosparcm icli
Once inside the interactive Python shell, indicated by the >>> prompt, execute the symlink-replacement script:
exec(open("/data/project/cls/shared/software/cryosparc/merlin-cryosparc-installation/scripts/replace_cryosparc_symlinks.py").read())
Follow the instructions displayed by the script to identify the affected project and jobs and to replace the outdated paths.
Example¶
Suppose you want to update all symlinks in every job within the project with ID P6.
Next, select all jobs that should be updated:
Specify the path that should be replaced. In this example, replace:
/data/project/bio with /data/project/cls
Review the proposed changes and confirm them to apply the replacements:
After the operation completes, the script displays a confirmation that the changes were applied successfully and that no errors occurred.
Check the replacement paths carefully
Make sure that the old and new paths are correct before confirming the changes. The script modifies the symlinks for the selected jobs, so an incorrect path replacement may cause the symlinks to point to the wrong files.