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

Removing component types for custom CIF files #17

Open
ljmartin opened this issue Mar 29, 2023 · 0 comments
Open

Removing component types for custom CIF files #17

ljmartin opened this issue Mar 29, 2023 · 0 comments

Comments

@ljmartin
Copy link

ljmartin commented Mar 29, 2023

Hi all,
Thanks for making the package open source. TLDR: can I avoid using the chem_comp labels added in 3dc288c?

I'd like to use this on structures that originated from outside the PDB - custom crystal structures, for instance, or docked poses. Converting with gemmi is reasonably straightforward (example file was from the RCSB in this case):

gemmi convert 1x7a.pdb 1x7a_converted.cif

but these .cif files don't work with pdbe-arpeggio:

pdbe-arpeggio -s RESNAME:187 -o ./out/ -m 1x7a_converted.cif
Traceback (most recent call last):
  File "/Users/ljmartin/miniconda3/envs/compchem/bin/pdbe-arpeggio", line 8, in <module>
    sys.exit(main())
  File "/Users/ljmartin/miniconda3/envs/compchem/lib/python3.9/site-packages/arpeggio/scripts/process_protein_cli.py", line 150, in main
    run_arpeggio(args)
  File "/Users/ljmartin/miniconda3/envs/compchem/lib/python3.9/site-packages/arpeggio/scripts/process_protein_cli.py", line 159, in run_arpeggio
    i_complex = InteractionComplex(
  File "/Users/ljmartin/miniconda3/envs/compchem/lib/python3.9/site-packages/arpeggio/core/interactions.py", line 70, in __init__
    self.component_types = protein_reader.get_component_types(filename)
  File "/Users/ljmartin/miniconda3/envs/compchem/lib/python3.9/site-packages/arpeggio/core/protein_reader.py", line 425, in get_component_types
    cmp_type  = config.ComponentType.from_chem_comp_type(chem_comp['type'][i])
  File "/Users/ljmartin/miniconda3/envs/compchem/lib/python3.9/site-packages/arpeggio/core/config.py", line 1199, in from_chem_comp_type
    return ComponentType(component_types[type.upper()]).name
AttributeError: 'bool' object has no attribute 'upper'

The source of the problem is maybe obvious - 1x7a_converted.cif doesn't have a chem_comp label, it looks like this:

loop_
_chem_comp.id
_chem_comp.type
187 .
ALA .
ARG .
ASN .
...

When loaded by gemmi, these fields are present, but are a bool (False). ComponentType in core/config.py requires a string, instead.
It looks like the chem_comp labelling was added fairly recently - in 3dc288c - is there a way to avoid using this label at all?

Thanks
PS this conversion does work with pdbe-arpeggio when using maxit, where the chem_comp records look like this:

loop_
_chem_comp.id
_chem_comp.type
_chem_comp.mon_nstd_flag
_chem_comp.name
_chem_comp.pdbx_synonyms
_chem_comp.formula
_chem_comp.formula_weight
187 non-polymer         . "1-{3-[AMINO(IMINO)METHYL]PHENYL}-N-[4-(1H-BENZIMIDAZOL-1-YL)-2-FLUOROPHENYL]-3-(TRIFLUOROMETHYL)-1H-PYRAZOLE-5-CARBOXAMIDE" ? "C25 H17 F4 N7 O" 507.442
ALA "L-peptide linking" y ALANINE                                                                                                                      ? "C3 H7 N O2"      89.093
ARG "L-peptide linking" y ARGININE                                                                                                                     ? "C6 H15 N4 O2 1"  175.209
ASN "L-peptide linking" y ASPARAGINE                                                                                                                   ? "C4 H8 N2 O3"     132.118
otienoanyango added a commit that referenced this issue Aug 4, 2023
PDBE-6143: resolves missing _chem_comp.type issue reported in #17
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

1 participant