biotite.structure.remove_pbc(atoms, selection=None)[source]

Remove segmentation caused by periodic boundary conditions from a given structure.

In this process the first atom (of the selection) is taken as origin and is moved inside the box. All other coordinates are assembled relative to the origin.

atomsAtomArray or AtomArrayStack

The potentially segmented structure. The box attribute must be set in the structure.

selectionstr or (iterable object of) ndarray, dtype=bool, shape=(n,), optional

Specifies which part(s) of structure are sanitized, i.e the segmentation is removed. If a string is given, the value is interpreted as the chain ID to be selected. If a boolean mask is given, the corresponding atoms are selected. If multiple boolean masks are given, each selection is treated as separate assembly process, independent of all other selections. Consequently, giving multiple boolean masks has the same result as calling the functions multiple times with each mask separately. An atom must not be selected more than one time.

sanitized_atomsAtomArray or AtomArrayStack

The input structure with removed periodic boundary conditions.


It is not recommended to select regions of the structure with distances from one atom to the next atom that are larger than half of the box size (e.g. the solvent, chain transitions). In this case, multiple selections should be given, with a single molecule selected in each selection.

Internally the function uses remove_pbc_from_coord().