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

error when specifying xtb version vs prepackaged binary #2

Closed
ljmartin opened this issue Mar 10, 2024 · 2 comments
Closed

error when specifying xtb version vs prepackaged binary #2

ljmartin opened this issue Mar 10, 2024 · 2 comments

Comments

@ljmartin
Copy link

hi all, congrats on the nice publication and code here.

I think using a newer version of xtb is leading to featurization errors. QupKake runs nicely using the prepackaged binary of xtb (version 6.4.1), but not when specifying a, more recent, pre-built binary (v 6.6.1). Potentially there's a difference in the output files, but I can't track it down.

prepackaged binary is version:

./qupkake/xtb-641/bin/xtb --version
>> * xtb version 6.4.1 (unknown) compiled by '[email protected]' on 2021-06-25

newer version:

/home/ubuntu/programs/xtb/xtb-6.6.1/bin/xtb --version
>> * xtb version 6.6.1 (8d0f1dd) compiled by 'stahn@M-Bot' on 2023-08-01

this works fine:

export XTBPATH=''
qupkake smiles "OC1=CN=CC=C1"

but this terminates with error:

export XTBPATH=`which xtb`
qupkake smiles "OC1=CN=CC=C1"

error message:

(qupkake) ubuntu@ip-172-31-8-111:~/QupKake/example$ qupkake smiles "OC1=CN=CC=C1"
Failed to find the pandas get_adjustment() function to patch
Failed to patch pandas - PandasTools will have limited functionality
/home/ubuntu/programs/xtb/xtb-6.6.1/bin/xtb
Failed to patch pandas - unable to change molecule rendering
Processing...
Failed to patch pandas - unable to change molecule rendering
Processing molecule:   0%|                                                                                                                                         | 0/1 [00:00<?, ?it/s]not enough values to unpack (expected 4, got 1)  final structure:

'natom'      #        f(+)     f(-)     f(0)

not enough values to unpack (expected 4, got 1)  final structure:

'natom'      #        f(+)     f(-)     f(0)

not enough values to unpack (expected 4, got 1)  final structure:

'natom'      #        f(+)     f(-)     f(0)

not enough values to unpack (expected 4, got 1)  final structure:

'natom'      #        f(+)     f(-)     f(0)

not enough values to unpack (expected 4, got 1)  final structure:

'natom'      #        f(+)     f(-)     f(0)

Processing molecule: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:02<00:00,  2.43s/it]
Done!
/home/ubuntu/micromamba/envs/qupkake/lib/python3.9/site-packages/pytorch_lightning/utilities/data.py:104: Total length of `DataLoader` across ranks is zero. Please make sure this was your intention.
Traceback (most recent call last):
  File "/home/ubuntu/micromamba/envs/qupkake/bin/qupkake", line 8, in <module>
    sys.exit(main())
  File "/home/ubuntu/micromamba/envs/qupkake/lib/python3.9/site-packages/qupkake/cli.py", line 399, in main
    parse_arguments(sys.argv[1:])
  File "/home/ubuntu/micromamba/envs/qupkake/lib/python3.9/site-packages/qupkake/cli.py", line 395, in parse_arguments
    parsed_args.func(parsed_args)
  File "/home/ubuntu/micromamba/envs/qupkake/lib/python3.9/site-packages/qupkake/cli.py", line 214, in main_smiles
    run_pipeline(args)
  File "/home/ubuntu/micromamba/envs/qupkake/lib/python3.9/site-packages/qupkake/cli.py", line 295, in run_pipeline
    run_prediction_pipeline(**vars(args))
  File "/home/ubuntu/micromamba/envs/qupkake/lib/python3.9/site-packages/qupkake/predict.py", line 248, in run_prediction_pipeline
    prot_indices = predict_sites(dataset, prot_model)
  File "/home/ubuntu/micromamba/envs/qupkake/lib/python3.9/site-packages/qupkake/predict.py", line 153, in predict_sites
    sites_indices = [
TypeError: 'NoneType' object is not iterable

just to verify the xtb install is functional:

obabel -O mol.sdf --gen3D -h -:"OC1=CN=CC=C1"
xtb mol.sdf --opt --alpb water lmo -P 16

terminates without error.

thanks again for a great package!

@ljmartin
Copy link
Author

ljmartin commented Mar 10, 2024

as an aside, I figured this docker image could be useful for mac users (encountered some trouble compiling XTB on mac). I'm not a docker native so no idea if this is efficient, but it works:

FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
    python3 \
    python3-pip \
    git \
    && rm -rf /var/lib/apt/lists/*


RUN ln -s /usr/bin/python3 /usr/bin/python

RUN apt-get update && apt-get install -y wget
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh \
    && bash miniconda.sh -b -p /opt/miniconda \
    && rm miniconda.sh
ENV PATH="/opt/miniconda/bin:${PATH}"

RUN git clone https://github.com/Shualdon/QupKake.git && cd QupKake && conda env create -f environment.yaml && conda init

RUN echo "source activate qupkake" >> ~/.bashrc

RUN cd QupKake && pip install .

RUN apt-get install -y libglib2.0-0 libsm6 libxrender1 libxext6 #required by PandasTools > rdMolDraw2d
mkdir output
docker run -v $(pwd)/output:/app/output docker_app_name qupkake smiles "CCCO" -r /app/output

@Shualdon
Copy link
Owner

Hey @ljmartin,

As we talked, you should install the right xTB version (6.4.1) as newer version don't support mol\sdf files created using RDKit for some reason (see ReactionMechanismGenerator/ARC#655).
They have detailed installation guides using CMake or meson.

Thanks for the docker image! I will work to add official docker images in the future.

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

2 participants