2 Commits

Author SHA1 Message Date
Peter Eastman
fe0550bb7b Create bonds based on chem_comp_bond records (#4904)
* Create bonds based on chem_comp_bond records

* Fixed a test that assumed bonds would be in a particular order
2025-04-22 08:58:54 -07:00
Stephen Farr
81271f93ab Add support for writing atom subsets to PDBReporter (#3931)
* enable atom subset in PDBReporter

* adds optional atomSubset argument to PDBReporter
* adds functions in PDBReporter which create a new topology
  and positions with chosen subset of atoms
* PDBReporter write PDB files with the subset topology and positions.

* refactor PDBReporter

* make _createTopologySubset a method that is called only the first time it is needed
* more efficient creation of subset positions
* check that atomSubset is ordered

* refactoring PDBReporter and add PDBx

* move checks on atomSubset to _createSubsetTopology
* copy periodic box vectors from topology to subsetTopology
* add atomSubset to PDBx reporter

* add bond subset to createSubsetTopology

* formatting changes to pdbreporter

* loop over atoms cleaned up
* put file opening inside parameter loop in
  TestPdbReporter::testinvalidSubsets to try and fix failing tests on windows

* add thorough tests to TestPdbReporter

* spelling changes
* Add tests for atom positions, elements, names etc
* attempt at fixing PyPy and Windows failing test cases

* fix spellings

* close output file before raising exceptions

* closes output files before raising exception in pdbreporter
createSubsetTopology
* changes assertVecAlmostEqual from a method to function to avoid
  repeating
2023-02-28 11:30:10 -08:00