NaNs error in 3d varaiability


I have Nan error in 3D variability and it happens at iteration 2. I am trying to repeat the 3D variability analysis based on the recent paper of Key Lewis “Probing cooperativity of N-terminal domain orientations in the p97 molecular machine: synergy between NMR and cryo-EM. Rui Huang, Zev A Ripstein, John L Rubinstein, and Lewis E.Kay 2020” but I have a problem at 3D variability. I checked the version of the cryoSPARC they used and I am using the same version. According to the paper, I made volume out of the PDB files and then using a simulated data job I got the particle images and did the refinement. First I tried the 3D variability using the particles and mask from C6 refinement and it seems fine but when I put a mask on N domain as it is described in the paper with and without expand symmetry I get the this error: Traceback (most recent call last):
File “cryosparc2_worker/cryosparc2_compute/”, line 78, in
File “cryosparc2_worker/cryosparc2_compute/jobs/var3D/”, line 533, in
File “cryosparc2_worker/cryosparc2_compute/jobs/var3D/”, line 445, in
File “/home/sepideh/software/cryosparc/cryosparc2_worker/deps/anaconda/lib/python2.7/site-packages/numpy/linalg/”, line 903, in eigvals
File “/home/sepideh/software/cryosparc/cryosparc2_worker/deps/anaconda/lib/python2.7/site-packages/numpy/linalg/”, line 217, in _assertFinite
raise LinAlgError(“Array must not contain infs or NaNs”)
LinAlgError: Array must not contain infs or NaNs
Could you please help me to solve the problem?
I didn’t want to make a new topic but I didn’t receive any answer by posting on the 3D variability topic.
I really appreciate your help.

Hi @sepidehv,

Thanks for posting (also saw your email on 3dem).
The appearance of NaN values in 3DVA sometimes happens and we are not completely sure why. This is still under investigation. There are a few things you can do:

  • Try to filter out more “junk” particles (using 2D classification) before running 3DVA
  • Increase the “Lambda” parameter in 3DVA to a larger value like 0.05 or 0.1. This can sometimes help to stop numerical precision issues that may be leading to the NaN value

I’m not sure if either of these changes were used in the paper you cited.
Could you also let us know which hardware you are running on, specifically which GPU version?

Thanks for your answer.
The particles are from simulated data so there is no junk particles.
I changed the Lambda but I still get the same error.
There is not detailed information in the paper.
This is the property of the machine that I’m running cryoSPARc on it:
AMD Ryzen Threadripper 2950X 16-Core Processor × 32
GeForce GTX 1070 Ti/PCIe/SSE2. NVIDIA Corporation GP104
Ubuntu 16.04.7 LTS 64-bit

Hi @apunjani,

I just want to follow up on my problem. So, I changed the lambda value but it didn’t help. I am also using version 2 of cryoSPARC as it was mentioned in that paper. Do you think it would help if I update the cryoSPARC and use the latest version?


Hi @svalimehr,
It may help to update to the latest cryoSPARC, though I’m not 100% clear on what the issue may be. Unfortunately I haven’t had a chance to look in depth at the workflow used in the paper you cited - can you explain why 3DVA is being run on synthetic data? How was the synthetic data generated and why would you expect there to be variability in the synthetic data?

Hi @apunjani,

They wanted to find out 14 different conformations of one of the domains in the protein so they used 3D variability for that and they wanted to be sure that the protocol is working for this purpose so they also did the same analysis on synthetic data that they already knew there are different conformations in the data (N domain in up or down conformation). For synthetic data analysis, Two structures (PDB ID: 5FTK and 5FTN) were converted to density models and subsequently projected into 2D images with CTF variation and added noise using the “simulate data” job in cryoSPARC. CTF values were allowed to vary between 1-2 μm defocus, and the signal-to-noise ratio was set to 0.5. 10,000 particle images were created from each density model (all NTD up and all NTD down), and then mixed together for refinement with C6 symmetry. The same 3D variability analysis was carried out for the simulated dataset. I followed the same thing and I got that error in 3D variability. I laso thought that it might be a problem with the mask as when I do 3D variability using the mask from refinement I don’t get this error but then I tried to do the refinement with the mask for the N domain that I used in 3D variability and it worked so,I think the mask is fine.