isayevlab / Auto3D_pkg

Auto3D generates low-energy conformers from SMILES/SDF
MIT License
146 stars 32 forks source link

issues when running from the CLI if username contains '.' (dot) #51

Closed dealmeida-h closed 8 months ago

dealmeida-h commented 11 months ago

Describe the bug Running auto3d from the CLI throws an error if the username has a dot. To Reproduce Steps to reproduce the behavior:

  1. create a new user test.user
  2. run python auto3d.py "example/files/smiles.smi" --k=1 --optimizing_engine="ANI2x"
  3. See error: PermissionError: [Errno 13] Permission denied: '/Users/test_reduced.smi'

Expected behavior Auto3D would run and generate 1st lowest energy conformer

Screenshots If applicable, add screenshots to help explain your problem.

System information:

Additional context Problem comes from how you're defining the smiles_reduced variable (line 50 from auto3d.py): smiles_reduced = smiles_enumerated.split('.')[0] + '_reduced.smi' the split is splitting the entire path, taking the first item (the first part of the username in this setting) and attaching the _reduced.smi. You could solve the issue by splitting on 'enumerated.' instead of '.'. But even if this is solved in this line, line 45 also suffers from the same problem (gives the following error : 'OSError: File error: Bad output file /Users/test0.sdf').

LiuCMU commented 11 months ago

Thanks for the detailed bug information, that's very helpful!

I need to getting file path name using the os.path.base module, that would be agnostic to username. I will let you know once it's resolved. Thanks!

LiuCMU commented 9 months ago

Hey @dealmeida-h , this bug should have been fixed in the latest version of auto3d. Please let us know if there is additional issues.