ml-struct-bio / cryodrgn

Neural networks for cryo-EM reconstruction
http://cryodrgn.cs.princeton.edu
GNU General Public License v3.0
312 stars 75 forks source link

cryodrgn searching for files in the wrong directory #299

Closed irintom closed 8 months ago

irintom commented 1 year ago

I recently updated the cryodrgn to 2.3.1 and now cryodrgn fails to downsample the images. Basically, it is checking for the files in the wrong directory. For example in the below given case, J2615 and J2614 are in the same parent directory P8. Yet it is checking for directory J2614 inside J2615.

(cryodrgn) irin@puma:/data/cryoEM/irin/cryodrgn-IT$ cryodrgn downsample /data/cryoEM/irin/HK/P8/J2615/J2615_004_particles.cs --datadir /data/cryoEM/irin/HK/P8/ -D 128 -o /data/cryoEM/irin/cryodrgn-IT/J2615/J2615_particles.128.mrcs > J2615-downsample.txt

Traceback (most recent call last): File "/home/irin/miniconda3/envs/cryodrgn/bin/cryodrgn", line 8, in sys.exit(main()) File "/home/irin/miniconda3/envs/cryodrgn/lib/python3.9/site-packages/cryodrgn/main.py", line 72, in main args.func(args) File "/home/irin/miniconda3/envs/cryodrgn/lib/python3.9/site-packages/cryodrgn/commands/downsample.py", line 89, in main old = ImageSource.from_file(args.mrcs, lazy=lazy, indices=ind, datadir=args.datadir) File "/home/irin/miniconda3/envs/cryodrgn/lib/python3.9/site-packages/cryodrgn/source.py", line 76, in from_file return CsSource( File "/home/irin/miniconda3/envs/cryodrgn/lib/python3.9/site-packages/cryodrgn/source.py", line 422, in init super().init( File "/home/irin/miniconda3/envs/cryodrgn/lib/python3.9/site-packages/cryodrgn/source.py", line 326, in init D = MRCFileSource(self.df["__mrc_filepath"][0]).D File "/home/irin/miniconda3/envs/cryodrgn/lib/python3.9/site-packages/cryodrgn/source.py", line 235, in init header = MRCHeader.parse(filepath) File "/home/irin/miniconda3/envs/cryodrgn/lib/python3.9/site-packages/cryodrgn/mrc.py", line 104, in parse with open(fname, "rb") as f: FileNotFoundError: [Errno 2] No such file or directory: '/data/cryoEM/irin/HK/P8/J2615/J2614/subtracted_particles_A_0.mrcs'

zhonge commented 1 year ago

I would use the latest release which is version 2.3.0. Can you confirm that this works for 2.3.0?

I believe this is a bug in our latest data loading refactor which we have fixed for the next official release. Thanks for reporting this though -- we can update the top of tree in the repo.

irintom commented 1 year ago

Dear Dr. Zhong

Thanks for getting back to me My PI has installed version 2.3.1 on her account and interestingly, it works perfectly without any issue for her. I did the installation as per the tutorial given online ( https://zhonge.github.io/cryodrgn/pages/installation.html#install-cryodrgn) and for me the issue happens. I tried installing *version 2.3.0 and *version 2.2.0.However, I ran into errors

  LookupError: setuptools-scm was unable to detect version for

/home/irin/cryodrgn2/cryodrgn-2.3.0.

  Make sure you're either building from a fully intact git repository

or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.

  For example, if you're using pip, instead of

https://github.com/user/proj/archive/master.zip use git+ https://github.com/user/proj.git#egg=proj

  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.

│ exit code: 1

╰─> See above for output.

Thanks

Irin

On Mon, Aug 14, 2023 at 3:28 PM Ellen Zhong @.***> wrote:

I would use the latest release which is version 2.3.0. Can you confirm that this works for 2.3.0?

I believe this is a bug in our latest data loading refactor which we have fixed for the next official release. Thanks for reporting this though -- we can update the top of tree in the repo.

— Reply to this email directly, view it on GitHub https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fzhonge%2Fcryodrgn%2Fissues%2F299%23issuecomment-1678012834&data=05%7C01%7Citom2%40groute.uic.edu%7Cf9ae66a4f2dc43b4430b08db9d05024a%7Ce202cd477a564baa99e3e3b71a7c77dd%7C0%7C0%7C638276417064358547%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3XwxX5lW36b2LtzTW5NSMtjpyrwv2NehbL%2B%2FC2W7Z%2Fs%3D&reserved=0, or unsubscribe https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FA22NXRA44LUBUFOLKPSDLCDXVKC6NANCNFSM6AAAAAA3QFSL34&data=05%7C01%7Citom2%40groute.uic.edu%7Cf9ae66a4f2dc43b4430b08db9d05024a%7Ce202cd477a564baa99e3e3b71a7c77dd%7C0%7C0%7C638276417064358547%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ZW4TJJVNF%2BIg1yypUMedprRAxykGpHD7GMMlGJqH2g0%3D&reserved=0 . You are receiving this because you authored the thread.Message ID: @.***>

michal-g commented 8 months ago

Hi Irin, this is an issue you can run into if the code for the package was downloaded incorrectly — did you use pip install to get cryoDRGN, or git clone? (the link to the original instructions is now broken)

I will close this issue for now, but please let us know if you are still running into problems with downsampling using the latest version!