The utils package#

These are the utility modules of Biobuild. They mostly serve in the background and keep everything going. Most users will not directly need to use these. However, they are documented here for completeness.

Default settings and constants#

biobuild.utils.constants.BASE = '/home/docs/checkouts/readthedocs.org/user_builds/biobuild/envs/stable/lib/python3.11/site-packages/biobuild'#

The base directory of the package

biobuild.utils.constants.RESOURCES = '/home/docs/checkouts/readthedocs.org/user_builds/biobuild/envs/stable/lib/python3.11/site-packages/biobuild/resources'#

The resources directory of the package

biobuild.utils.defaults.DEFAULT_BOND_LENGTH = 1.6#

The default length of a bond in Angstrom

biobuild.utils.defaults.DEFAULT_CHARMM_TOPOLOGY_FILE = '/home/docs/checkouts/readthedocs.org/user_builds/biobuild/envs/stable/lib/python3.11/site-packages/biobuild/resources/topology.pkl'#

The path to the default CHARMM topology file

biobuild.utils.defaults.DEFAULT_PDBE_COMPONENT_FILES = {'amino_acids': '/home/docs/checkouts/readthedocs.org/user_builds/biobuild/envs/stable/lib/python3.11/site-packages/biobuild/resources/components_amino_acids.pkl', 'base': '/home/docs/checkouts/readthedocs.org/user_builds/biobuild/envs/stable/lib/python3.11/site-packages/biobuild/resources/components_base.pkl', 'lipids': '/home/docs/checkouts/readthedocs.org/user_builds/biobuild/envs/stable/lib/python3.11/site-packages/biobuild/resources/components_lipids.pkl', 'nucleotides': '/home/docs/checkouts/readthedocs.org/user_builds/biobuild/envs/stable/lib/python3.11/site-packages/biobuild/resources/components_nucleotides.pkl', 'small_molecules': '/home/docs/checkouts/readthedocs.org/user_builds/biobuild/envs/stable/lib/python3.11/site-packages/biobuild/resources/components_small.pkl', 'sugars': '/home/docs/checkouts/readthedocs.org/user_builds/biobuild/envs/stable/lib/python3.11/site-packages/biobuild/resources/components_sugars.pkl'}#

The paths to the default PDBe component files

biobuild.utils.defaults.DEFAULT_SASA_N = 300#

The default number of points used to calculate solvent accessible surface area

biobuild.utils.defaults.DEFAULT_SASA_PROBE_RADIUS = 1.4#

The default probe radius for calculating solvent accessible surface area

biobuild.utils.defaults.get_default_instance(key)[source]#

Get the default instance of a class

Parameters:

key (str) – The key of the default instance

Returns:

The default instance of the class

Return type:

obj

biobuild.utils.defaults.set_default_instance(key, obj)[source]#

Set the default instance of a class

Parameters:
  • key (str) – The key of the default instance

  • obj – The new default instance

Other auxiliary utilities#

Utility and auxiliary functions

class biobuild.utils.auxiliary.DummyBar(*args, **kwargs)[source]#

Bases: object

A dummy progress bar

class biobuild.utils.auxiliary.DummyStructure(residues)[source]#

Bases: object

A dummy pdb structure

Used for the surface residue inference

Parameters:

residues (list of Bio.PDB.Residue.Residue) – The residues to include in the structure

get_atoms()[source]#
get_chains()[source]#
get_models()[source]#
get_residues()[source]#
biobuild.utils.auxiliary.chain_id_maker(cdx: int)[source]#

Make a string chain id from a counting integer

Parameters:

cdx (int) – The counting integer

Returns:

The chain id

Return type:

str

biobuild.utils.auxiliary.change_suffix(filename, suffix)[source]#

Change the suffix of a filename

Parameters:
  • filename (str) – The filename

  • suffix (str) – The new suffix

Returns:

The filename with the new suffix

Return type:

str

biobuild.utils.auxiliary.filename_to_id(filename)[source]#

Extract the id from a filename

Parameters:

filename (str) – The filename

Returns:

The id

Return type:

str

biobuild.utils.auxiliary.load_pickle(filename)[source]#

Load an object from a pickle file

biobuild.utils.auxiliary.make_formula(atoms)[source]#

Make a chemical formula from a list of atoms

Parameters:

atoms (list of Atoms) – The atoms. Each atom must have an element attribute (str).

Returns:

The chemical formula

Return type:

str

biobuild.utils.auxiliary.remove_nonprintable(text)[source]#

Remove non-printable characters from a string

Parameters:

text (str) – The string

Returns:

The string without non-printable characters

Return type:

str

biobuild.utils.auxiliary.save_pickle(obj, filename)[source]#

Save an object to a pickle file