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 while running the tutorial walkthrough #24

Open
sli259 opened this issue Mar 28, 2022 · 1 comment
Open

Error while running the tutorial walkthrough #24

sli259 opened this issue Mar 28, 2022 · 1 comment

Comments

@sli259
Copy link

sli259 commented Mar 28, 2022

I am trying to run the walkthrough tutorial on Chignoline and got the following error at initial step to generate the psf file, can you tell me what I missed?

---------------------------------------------------------------------------
InvalidIndexError                         Traceback (most recent call last)
Input In [29], in <cell line: 6>()
      3 PDB_file = 'data/chignolin_cln025.pdb'
      4 PSF_file = 'data/chignolin_ca_top.psf'
----> 6 pdb2psf_CA(PDB_file, PSF_file, bonds = True, angles = False)

File ~/miniconda3/envs/torchmd_cg/lib/python3.9/site-packages/torchmd_cg/utils/psfwriter.py:7, in pdb2psf_CA(pdb_name_in, psf_name_out, bonds, angles)
      6 def pdb2psf_CA(pdb_name_in, psf_name_out, bonds=True, angles=True):
----> 7     mol = Molecule(pdb_name_in)
      8     mol.filter("name CA")
     10     n = mol.numAtoms

File ~/miniconda3/envs/torchmd_cg/lib/python3.9/site-packages/moleculekit/molecule.py:299, in Molecule.__init__(self, filename, name, **kwargs)
    296 self.viewname = name
    298 if filename is not None:
--> 299     self.read(filename, **kwargs)

File ~/miniconda3/envs/torchmd_cg/lib/python3.9/site-packages/moleculekit/molecule.py:1147, in Molecule.read(self, filename, type, skip, frames, append, overwrite, keepaltloc, guess, guessNE, _logger, **kwargs)
   1145 for rr in readers:
   1146     try:
-> 1147         mol = rr(fname, frame=frame, topoloc=tmppdb, **kwargs)
   1148     except FormatError:
   1149         continue

File ~/miniconda3/envs/torchmd_cg/lib/python3.9/site-packages/moleculekit/readers.py:1100, in PDBread(filename, mode, frame, topoloc, validateElements, uniqueBonds)
   1098 if "element" in parsedtopo:
   1099     idx, newelem = pdbGuessElementByName(parsedtopo.element, parsedtopo.name)
-> 1100     parsedtopo.at[idx, "element"] = newelem
   1102 for field in topodtypes:
   1103     if (
   1104         field in parsedtopo
   1105         and topodtypes[field] == str
   1106         and parsedtopo[field].dtype == object
   1107     ):

File ~/miniconda3/envs/torchmd_cg/lib/python3.9/site-packages/pandas/core/indexing.py:2274, in _AtIndexer.__setitem__(self, key, value)
   2271     self.obj.loc[key] = value
   2272     return
-> 2274 return super().__setitem__(key, value)

File ~/miniconda3/envs/torchmd_cg/lib/python3.9/site-packages/pandas/core/indexing.py:2229, in _ScalarAccessIndexer.__setitem__(self, key, value)
   2226 if len(key) != self.ndim:
   2227     raise ValueError("Not enough indexers for scalar access (setting)!")
-> 2229 self.obj._set_value(*key, value=value, takeable=self._takeable)

File ~/miniconda3/envs/torchmd_cg/lib/python3.9/site-packages/pandas/core/frame.py:3869, in DataFrame._set_value(self, index, col, value, takeable)
   3867 else:
   3868     series = self._get_item_cache(col)
-> 3869     loc = self.index.get_loc(index)
   3871 # setitem_inplace will do validation that may raise TypeError
   3872 #  or ValueError
   3873 series._mgr.setitem_inplace(loc, value)

File ~/miniconda3/envs/torchmd_cg/lib/python3.9/site-packages/pandas/core/indexes/range.py:388, in RangeIndex.get_loc(self, key, method, tolerance)
    386         except ValueError as err:
    387             raise KeyError(key) from err
--> 388     self._check_indexing_error(key)
    389     raise KeyError(key)
    390 return super().get_loc(key, method=method, tolerance=tolerance)

File ~/miniconda3/envs/torchmd_cg/lib/python3.9/site-packages/pandas/core/indexes/base.py:5637, in Index._check_indexing_error(self, key)
   5633 def _check_indexing_error(self, key):
   5634     if not is_scalar(key):
   5635         # if key is not a scalar, directly raise an error (the code below
   5636         # would convert to numpy arrays and raise later any way) - GH29926
-> 5637         raise InvalidIndexError(key)
InvalidIndexError: []
@MaciejMajew
Copy link
Contributor

Hi! There might be some issue with your moleculekit installation. Please check this issue: #23

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