CAT icon indicating copy to clipboard operation
CAT copied to clipboard

Failed to employ polyatomic core anchors

Open juliette1996 opened this issue 3 years ago • 4 comments

Hello there, I'm trying to use the new option core.optional.allignment = "anchor" but it's apparently failing with this error message:

Traceback (most recent call last):
  File "C:\Users\jzito\Miniconda3\envs\escience\Scripts\init_cat-script.py", line 33, in <module>
    sys.exit(load_entry_point('nlesc-CAT', 'console_scripts', 'init_cat')())
  File "c:\users\jzito\escience\cat\CAT\data_handling\entry_points.py", line 62, in main
    base.prep(extract_args(args), return_mol=False)
  File "c:\users\jzito\escience\cat\CAT\base.py", line 121, in prep
    core_df = prep_core(core_df)
  File "c:\users\jzito\escience\cat\CAT\base.py", line 220, in prep_core
    idx_tuples = [set_core_anchors(i, anchor_tup, allignment_tup, subset) for i in core_df[MOL]]
  File "c:\users\jzito\escience\cat\CAT\base.py", line 220, in <listcomp>
    idx_tuples = [set_core_anchors(i, anchor_tup, allignment_tup, subset) for i in core_df[MOL]]
  File "c:\users\jzito\escience\cat\CAT\attachment\core_anchoring.py", line 51, in set_core_anchors
    anchor_idx = anchor_idx_group[:, anchor_tup.group_idx[0]].copy()
IndexError: too many indices for array

Here are the core and input files.

path: .

input_cores:
        - geo_opt.xyz

input_ligands:
        - CCC(=O)O

optional:
    database:
            mol_format: ['xyz']

    core:
        dirname: core
        allignment: "anchor"  # Define the core vectors based on the dummy acetate's vectors
        anchor:
            group: "[O-]C(C([H])([H])[H])=O"  # Acetate anion (with explicit hydrogens!)
            group_idx: [0, 6]  # Represent the anchor by the mean position of both oxyanions
            kind: "mean"
            remove: [0, 1, 2, 3, 4, 5, 6]  # Remove the entirety of the dummy acetate

    ligand:
        dirname: ligand
        split: True

    qd:
        dirname: qd
        construct_qd: True
        optimize: False

Can you help me with this?

juliette1996 avatar Nov 25 '22 11:11 juliette1996

@RobertaPascazio do you have a .pdb file of this structure?

juliette1996 avatar Apr 25 '23 13:04 juliette1996

The problem here was the lack of bonds in the passed core, which caused CAT to fail in identifying the anchoring sites within the passed molecules. The error message here is problematic though and should be way more explicit (fixed as of https://github.com/nlesc-nano/CAT/commit/b8349e6ad04a12774faa0e321b8d802e07ff273b).

BvB93 avatar Apr 25 '23 13:04 BvB93

There you have it!

geo_opt.zip

RobertaPascazio avatar Apr 25 '23 13:04 RobertaPascazio

Same error as before when using the pdb file

juliette1996 avatar Apr 25 '23 13:04 juliette1996