propka.lib

Set-up of a PROPKA calculation

Implements many of the main functions used to call PROPKA.

Functions

build_parser([parser])

Build an argument parser for PROPKA.

generate_combinations(interactions)

Generate combinations of interactions.

loadOptions([args])

Load the arguments parser with options.

make_combination(combis, interaction)

Make a specific set of combinations.

make_grid(min_, max_, step)

Make a grid across the specified tange.

make_molecule(atom, atoms)

Make a molecule from atoms.

make_tidy_atom_label(name, element)

Returns a 'tidier' atom label for printing to the new PDB file.

parse_res_list(titrate_only)

parse_res_string(res_str)

Parse a residue string.

protein_precheck(conformations, names)

Check protein for correct number of atoms, etc.

resid_from_atom(atom)

Return string with atom residue information.

split_atoms_into_molecules(atoms)

Maps atoms into molecules.

Classes

Options()

propka.lib.build_parser(parser=None)[source]

Build an argument parser for PROPKA.

Parameters:

parser – existing parser. If this is not None, then the PROPKA parser will be created as a subparser to this existing parser. Otherwise, a new parser will be created.

Returns:

ArgumentParser object.

Changed in version 3.4.0: Argument –generate-propka-input has been removed as writing PROPKA input files is no longer supported.

propka.lib.generate_combinations(interactions: Iterable[T]) List[List[T]][source]

Generate combinations of interactions.

Parameters:

interactions – list of interactions

Returns:

list of combinations

propka.lib.loadOptions(args=None) Options[source]

Load the arguments parser with options. Note that verbosity is set as soon as this function is invoked.

Parameters:

args – list of arguments

Returns:

argparse namespace

propka.lib.make_combination(combis: List[List[T]], interaction: T) List[List[T]][source]

Make a specific set of combinations.

Parameters:
  • combis – list of combinations

  • interaction – interaction to add to combinations

Returns:

list of combinations

propka.lib.make_grid(min_: Number, max_: Number, step: Number) Iterator[Number][source]

Make a grid across the specified tange.

Like range() for integers or numpy.arange() for floats, except that max_ is not excluded from the range.

Parameters:
  • min – minimum value of grid

  • max – maximum value of grid

  • step – grid step size

propka.lib.make_molecule(atom: Atom, atoms: List[Atom])[source]

Make a molecule from atoms.

Parameters:
  • atom – one of the atoms

  • atoms – a list of the remaining atoms

Returns:

list of atoms

propka.lib.make_tidy_atom_label(name, element)[source]

Returns a ‘tidier’ atom label for printing to the new PDB file.

Parameters:
  • name – atom name

  • element – atom element

Returns:

string

propka.lib.parse_res_string(res_str: str) Tuple[str, int, str][source]

Parse a residue string.

Parameters:

res_string – residue string in format “chain:resnum[inscode]”

Returns:

a tuple of (chain, resnum, inscode).

Raises:

ValueError if the input string is invalid.

propka.lib.protein_precheck(conformations: Dict[str, ConformationContainer], names: Iterable[str])[source]

Check protein for correct number of atoms, etc.

Parameters:

names – conformation names to check

propka.lib.resid_from_atom(atom)[source]

Return string with atom residue information.

Parameters:

atom – atom to generate string for

Returns

string

propka.lib.split_atoms_into_molecules(atoms: List[Atom])[source]

Maps atoms into molecules.

Parameters:

atoms – list of atoms

Returns:

list of molecules