pestifer.psfutil.psfbond module

Definition of the PSFBond and PSFBondList classes for handling bonds in PSF topology files. These classes are used to represent bonds formed between pairs of atoms in a molecular structure, as defined in PSF files. The PSFBond class represents a single bond, while the PSFBondList class is a collection of such bonds. These are descendants of the PSFTopoElement and PSFTopoElementList classes, respectively, which provide a framework for representing and manipulating generic PSF topology elements

class pestifer.psfutil.psfbond.PSFBond(idx_list: list[int])[source]

Bases: PSFTopoElement

A class representing a bond in a PSF topology file.

class pestifer.psfutil.psfbond.PSFBondList(input_data, **kwargs)[source]

Bases: PSFTopoElementList

A class representing a list of PSFBond objects. This class inherits from PSFTopoElementList and provides methods for managing a collection of bonds in a PSF topology file. It can be initialized from a list of lines or from a PSFTopoElementList object.

to_graph()[source]

Create a networkx.Graph representation of the bond list, where bonds are edges between atom serial numbers.

Returns:

A networkx graph representing the bond list, with atom serial numbers as nodes and bonds as edges.

Return type:

networkx.Graph