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

trimPDBEnsemble doesn't work when inputs to buildPDBEnsemble are sele #1663

Open
jamesmkrieger opened this issue Feb 15, 2023 · 2 comments
Open

Comments

@jamesmkrieger
Copy link
Contributor

with the following code (from the scipion plugin) applied to some spike structures, we get the following error:

            ens = prody.buildPDBEnsemble([tar.select(self.selstr.get()) for tar in self.tars],
                                          ref=ref,
                                          seqid=self.seqid.get(),
                                          overlap=self.overlap.get(),
                                          match_func=match_func,
                                          atommaps=atommaps)

            ens = prody.trimPDBEnsemble(ens, 1.)
ValueError                                Traceback (most recent call last)
Input In [6], in <module>
----> 1 ens = trimPDBEnsemble(ens, occupancy=1.)

File /mnt/c/Users/james/code/scipion3_new/software/em/ProDy/prody/ensemble/functions.py:281, in trimPDBEnsemble(pdb_ensemble, occupancy, **kwargs)
    279 select = atoms[indices]
    280 trimmed.setAtoms(atoms)
--> 281 trimmed.setAtoms(select)
    283 coords = copy(pdb_ensemble._coords)
    284 if coords is not None:

File /mnt/c/Users/james/code/scipion3_new/software/em/ProDy/prody/ensemble/ensemble.py:265, in Ensemble.setAtoms(self, atoms)
    263     ag = atoms
    264 if ag.numAtoms() != n_atoms:
--> 265     raise ValueError('size mismatch between this ensemble ({0} atoms) and atoms ({1} atoms)'
    266                     .format(n_atoms, ag.numAtoms()))
    267 self._atoms = ag
    268 self._indices, _ = sliceAtoms(self._atoms, atoms)

ValueError: size mismatch between this ensemble (2955 atoms) and atoms (24015 atoms)

I think we need to use getAtomGroup somewhere for generating and/or applying the indices. Perhaps, we could/should also use trimmed.select with a selstr based on them too.

@jamesmkrieger
Copy link
Contributor Author

This doesn't happen when the reference is an index

@jamesmkrieger
Copy link
Contributor Author

In fact, a lot of things aren't made to handle that. All the get functions that use indices (getMSA, getCoords, getCoordsets, etc.) have problems and loadEnsemble does too

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