Skip to content

non GPCR Proteins without cysteine bridges cannot be parsed #11

Description

@antilotus

Hi,

I am interested in using this tool for the transmembrane odor receptor I am studying. However as my structure does not have any cysteines bridges I only get this error message when I try to run it:
"""
IndexError Traceback (most recent call last)
File ~/hdd/mdrun/Gromacs/12percholtip3p/SpicOR29/system_SpicOR29_ORCO/alloviztest/Spicalloviz.py:3
1 import AlloViz
----> 3 system = AlloViz.Protein(pdb="/home/albert/hdd/mdrun/Gromacs/12percholtip3p/SpicOR29/system_SpicOR29_ORCO/SpicOR29_ORCO.pdb",
4 trajs="/home/albert/hdd/mdrun/Gromacs/12percholtip3p/SpicOR29/system_SpicOR29_ORCO/Out/Production_MD_r1/md_fit.xtc",
5 path="/home/albert/hdd/mdrun/Gromacs/12percholtip3p/SpicOR29/system_SpicOR29_ORCO/alloviztest")
6 #system.calculate(pkgs="correlationplus_CA_Pear", cores=12)
7 system.calculate(pkgs="pytraj_CA", cores=30)

File ~/micromamba/envs/alloviz/lib/python3.9/site-packages/AlloViz/AlloViz/Classes.py:244, in Protein.init(self, pdb, trajs, GPCR, name, path, protein_sel, **kwargs)
241 """:class:~MDAnalysis.core.universe.Universe"""
243 # Bonded cysteines must be identified to remove them from non-covalent contacts calculations (i.e., PyInteraph2_Contacts)
--> 244 self._bonded_cys = trajutils.get_bonded_cys(self._pdbf)
246 # _dihedral_residx returns a list of indices of all the protein's residues in the Universes that are not in the extremes of the chain(s)
247 # These will be the residues for which Dihedral correlations can be calculated (residues in the extremes have some dihedrals missing)
248 # MDEntropy_AlphaAngle uses information of residues i-1, i, i+1, i+2; so end=-2 is passed to also exclude the second-to-last residue of the chain(s)
249 _res_arrays = np.split(
250 self.protein.residues.resindices,
251 np.where(np.diff(self.protein.residues.resnums) != 1)[0] + 1,
252 )

File ~/micromamba/envs/alloviz/lib/python3.9/site-packages/AlloViz/AlloViz/trajutils.py:376, in get_bonded_cys(pdbf)
361 r"""Identify disulfide bond-forming cysteines' sulphur atoms
362
363 Returns a list of the residue indices of cysteines whose sulphur atoms form a
(...)
373 Filename of the already-processed protein PDB structure to use for detection.
374 """
375 bonded_cys = []
--> 376 pdb = parmed.read_pdb(pdbf)
377 mask = parmed.amber.mask.AmberMask(pdb, ":CY?@sg")
378 for sel in mask.Selected():

File ~/micromamba/envs/alloviz/lib/python3.9/site-packages/parmed/formats/pdb.py:447, in PDBFile.parse(cls, filename, skip_bonds, expanded_residue_template_match, all_residue_template_match)
445 _map_bond_types_from_templates(inst.struct, *residue_libraries)
446 else:
--> 447 inst.struct.assign_bonds()
449 inst._postprocess_metadata()
450 inst.struct.unchange()

File ~/micromamba/envs/alloviz/lib/python3.9/site-packages/parmed/structure.py:886, in Structure.assign_bonds(self, *reslibs)
884 cysteine_sg = set()
885 for res in self.residues:
--> 886 templ = _res_in_templlib(res, all_residues)
887 if templ is None:
888 # Don't have a template for this residue. Keep a note and go on
889 unassigned_atoms.update(res.atoms)

File ~/micromamba/envs/alloviz/lib/python3.9/site-packages/parmed/structure.py:4311, in _res_in_templlib(res, lib)
4309 if len(res.name) == 3 and residue.AminoAcidResidue.has(res.name):
4310 return lib[residue.AminoAcidResidue.get(res.name).abbr]
-> 4311 if residue.DNAResidue.has(res.name):
4312 return lib[residue.DNAResidue.get(res.name).abbr]
4313 if residue.RNAResidue.has(res.name) and residue.RNAResidue.get(res.name).abbr != 'T':

File ~/micromamba/envs/alloviz/lib/python3.9/site-packages/parmed/residue.py:51, in BiomolecularResidue.has(cls, thing)
49 return thing in cls.all_residues
50 try:
---> 51 cls.get(thing)
52 except KeyError:
53 return False

File ~/micromamba/envs/alloviz/lib/python3.9/site-packages/parmed/residue.py:216, in DNAResidue.get(cls, key)
196 """
197 Gets the nucleic acid corresponding to either the residue name or
198 abbreviation. It is case-insensitive.
(...)
213 an DNA residue.
214 """
215 try:
--> 216 if key[-1] in '35':
217 return cls._all_residues_by_abbr[key[:-1].upper()]
218 return cls._all_residues_by_abbr[key.upper()]

IndexError: string index out of range
"""

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions