Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple errors in file reading #21

Closed
marcodigennaro opened this issue Nov 22, 2023 · 6 comments
Closed

Multiple errors in file reading #21

marcodigennaro opened this issue Nov 22, 2023 · 6 comments

Comments

@marcodigennaro
Copy link

Hello,
I tried to run ligpargen on the phenol file found in the exemple dir.

ligpargen -i phenol_after_BOSS.pdb
Traceback (most recent call last):
  File "/Users/marcodigennaro/miniconda3/envs/ligpargen/bin/ligpargen", line 33, in <module>
    sys.exit(load_entry_point('LigPargen', 'console_scripts', 'ligpargen')())
  File "/Users/marcodigennaro/WORK/external_packages/ligpargen/ligpargen/ligpargen.py", line 496, in main
    molname=args.molname, workdir= args.path, debug= args.debug)
  File "<string>", line 17, in __init__
  File "/Users/marcodigennaro/WORK/external_packages/ligpargen/ligpargen/ligpargen.py", line 190, in __post_init__
    self.workdir, self.debug)
  File "/Users/marcodigennaro/WORK/external_packages/ligpargen/ligpargen/tools/boss.py", line 208, in run
    shutil.copyfile('plt.pdb', pdbFile)
  File "/Users/marcodigennaro/miniconda3/envs/ligpargen/lib/python3.7/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'plt.pdb'

when using my file, generated from openbabel I get the error below:

COMPND    UNNAMED
AUTHOR    GENERATED BY OPEN BABEL 2.3.90
HETATM    1  C   UNL     1      -3.420   0.763   2.248  1.00  0.00           C1-
HETATM    2  F   UNL     1      -3.829  -0.542   2.440  1.00  0.00           F
HETATM    3  F   UNL     1      -2.919   1.269   3.432  1.00  0.00           F
HETATM    4  F   UNL     1      -4.497   1.527   1.841  1.00  0.00           F
HETATM    5  N   UNL     1      -0.643  -0.104   1.322  1.00  0.00           N2-
HETATM    6  C   UNL     1       2.054  -0.880   0.123  1.00  0.00           C
HETATM    7  F   UNL     1       2.678  -1.046  -1.098  1.00  0.00           F
HETATM    8  F   UNL     1       2.071  -2.077   0.814  1.00  0.00           F
HETATM    9  F   UNL     1       2.724   0.084   0.853  1.00  0.00           F
HETATM   10  S   UNL     1      -2.128   0.811   0.975  1.00  0.00           S
HETATM   11  S   UNL     1       0.337  -0.356  -0.139  1.00  0.00           S
HETATM   12  O   UNL     1      -1.660   2.243   0.672  1.00  0.00           O
HETATM   13  O   UNL     1      -2.633   0.324  -0.393  1.00  0.00           O
HETATM   14  O   UNL     1      -0.455  -1.360  -0.992  1.00  0.00           O
HETATM   15  O   UNL     1       0.237   0.938  -0.962  1.00  0.00           O
HETATM   16 Li   UNL     2      -0.577  -2.952   1.388  1.00  0.00          Li
CONECT    1    2    3    4   10
CONECT    2    1
CONECT    3    1
CONECT    4    1
CONECT    5   10   11
CONECT    6    7    8    9   11
CONECT    7    6
CONECT    8    6
CONECT    9    6
CONECT   10    1   12   13    5
CONECT   11    6   14   15    5
CONECT   12   10
CONECT   13   10
CONECT   14   11
CONECT   15   11
MASTER        0    0    0    0    0    0    0    0   16    0   16    0
END
ligpargen -i Li-TFSI.pdb
[18:18:26] Explicit valence for atom # 0 C, 5, is greater than permitted
Traceback (most recent call last):
  File "/Users/marcodigennaro/miniconda3/envs/ligpargen/bin/ligpargen", line 33, in <module>
    sys.exit(load_entry_point('LigPargen', 'console_scripts', 'ligpargen')())
  File "/Users/marcodigennaro/WORK/external_packages/ligpargen/ligpargen/ligpargen.py", line 496, in main
    molname=args.molname, workdir= args.path, debug= args.debug)
  File "<string>", line 17, in __init__
  File "/Users/marcodigennaro/WORK/external_packages/ligpargen/ligpargen/ligpargen.py", line 174, in __post_init__
    moleculeRDkit, newIndexToOriginalIndex, atomsNameOriginal, residueNameOriginal = utilities.generateRDkitMolecule(self.ifile, self.smile, self.workdir, molnameA, self.debug)
  File "/Users/marcodigennaro/WORK/external_packages/ligpargen/ligpargen/tools/utilities.py", line 187, in generateRDkitMolecule
    Chem.MolToPDBFile(molecule, sfile)
Boost.Python.ArgumentError: Python argument types in
    rdkit.Chem.rdmolfiles.MolToPDBFile(NoneType, str)
did not match C++ signature:
    MolToPDBFile(RDKit::ROMol mol, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> filename, int confId=-1, unsigned int flavor=0)

The error is clear here: Explicit valence for atom # 0 C, 5, is greater than permitted, so I modified the input file, (C1- and N2- become respectively C N )but I get another error.

Traceback (most recent call last):
  File "/Users/marcodigennaro/miniconda3/envs/ligpargen/bin/ligpargen", line 33, in <module>
    sys.exit(load_entry_point('LigPargen', 'console_scripts', 'ligpargen')())
  File "/Users/marcodigennaro/WORK/external_packages/ligpargen/ligpargen/ligpargen.py", line 496, in main
    molname=args.molname, workdir= args.path, debug= args.debug)
  File "<string>", line 17, in __init__
  File "/Users/marcodigennaro/WORK/external_packages/ligpargen/ligpargen/ligpargen.py", line 174, in __post_init__
    moleculeRDkit, newIndexToOriginalIndex, atomsNameOriginal, residueNameOriginal = utilities.generateRDkitMolecule(self.ifile, self.smile, self.workdir, molnameA, self.debug)
  File "/Users/marcodigennaro/WORK/external_packages/ligpargen/ligpargen/tools/utilities.py", line 189, in generateRDkitMolecule
    atomsIndexLstWithRightOrder = buildProperOrderAtomIndexLst(molecule, molname, workdir)
  File "/Users/marcodigennaro/WORK/external_packages/ligpargen/ligpargen/tools/utilities.py", line 543, in buildProperOrderAtomIndexLst
    addAtomsToTheList(molecule, atomsIndexLstWithRightOrder, heavyAtomsIndexLst)
  File "/Users/marcodigennaro/WORK/external_packages/ligpargen/ligpargen/tools/utilities.py", line 584, in addAtomsToTheList
    else: addAtomsToTheList(molecule, atomsIndexLst, heavyAtomsIndexLst)
  File "/Users/marcodigennaro/WORK/external_packages/ligpargen/ligpargen/tools/utilities.py", line 584, in addAtomsToTheList
    else: addAtomsToTheList(molecule, atomsIndexLst, heavyAtomsIndexLst)
  File "/Users/marcodigennaro/WORK/external_packages/ligpargen/ligpargen/tools/utilities.py", line 584, in addAtomsToTheList
    else: addAtomsToTheList(molecule, atomsIndexLst, heavyAtomsIndexLst)
  [Previous line repeated 988 more times]
  File "/Users/marcodigennaro/WORK/external_packages/ligpargen/ligpargen/tools/utilities.py", line 571, in addAtomsToTheList
    neighborsIndex = [x.GetIdx() for x in atom.GetNeighbors()]
RecursionError: maximum recursion depth exceeded while calling a Python object

Thank you for your support

@EmicoBinsfinder
Copy link

Did you manage to find a solution to the "FileNotFoundError: [Errno 2] No such file or directory: 'plt.pdb" error?

@marcodigennaro
Copy link
Author

no

@Brunoo-LBC
Copy link

Same error: "FileNotFoundError: [Errno 2] No such file or directory: 'plt.pdb".

@fengwangxmu
Copy link

because the stupid BOSS is compiled for linux using 32 bits libraries, but the system we used is based on 64 bits libraries.

@EmicoBinsfinder
Copy link

EmicoBinsfinder commented Dec 5, 2023

I thought this may be the case, I've seen some workarounds for previous linux distributions that allow installation of packages that allow for compatibility but not sure if that exists for more recent versions (e.g. Ubuntu 22.04)... I tried using an older version of Ubuntu (19.xx) on a virtual box but ran into the same issues still

@fengwangxmu
Copy link

fengwangxmu commented Dec 5, 2023

The issue would be solved by building the 32 bit libraries into you 64 bit Linux machine.
if you are a root account, just typing:
yum -y install glibc.i686
yum -y install libgcc*i686 libstdc++*i686 glibc*i686 libgfortran*i686

@Isra3l Isra3l closed this as completed Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants