-
Notifications
You must be signed in to change notification settings - Fork 73
Save the current workspace and continue the analysis later
Think about following two cases:
-
After analyzing the data, you want to keep workspace so that you can continue refining the final results;
-
You run some analysis automatically on a computer cluster, but you still need some manual intervention using your own computer as a proof-reading step. Once it's done, you also need to send the results to cluster for an more CNMF-E iteration again. A pipeline like this requires copying data between your cluster and your local computer.
This tutorial targets these two applications.
saving the workspace is easy, just run
neuron.save_workspace();
This will create a mat file named current_date_time.mat in neuron.P.log_folder.
loading the workspace is easier. Just find the saved mat file and run
load saved_workspace_file.mat
In the second case mentioned at the beginning of this tutorial, we have to transfer data across different computers. If we don't have to load the whole data file on the second computer, we can o nly transfer the saved_workspace_file.mat and the log file. We can compress these two files and saved it as a zip file for easy file transfer.
on the first computer, which is the one does heavy work,
neuron.save_workspace('zip_file_name.zip')
This step will save the workspace and then zip it into zip_file_name.zip together with the log file.
on the second computer, we first have to load the zip file. You can do so by running a script
zip_file_path = 'zip_file_name.zip';
cnmfe_unzip_results;
These two lines of code unzip the results and load the whole workspace. Now you can do all kinds of visualization (except those operations requiring the raw data) and manual intervention. Once it's done. You can save the results and zip it again.
cnmfe_zip_results;
Then transfer the zipped file to the first computer and unzip it directly.
cnmfe_unzip_results;
All results will be directly copied to the original folder directly and the workspace will be loaded again.