### Install PDB2PQR from Source Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/getting.md Install PDB2PQR by building from the source code. Navigate to the top-level directory of the source code and run this command. ```bash pip install . ``` -------------------------------- ### Logger Setup Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/io.md Function to set up the logging mechanism. ```APIDOC ## POST /pdb2pqr.io.setup_logger ### Description Sets up the logger to output log files to the same directory as the PQR output file. ### Method POST ### Endpoint /pdb2pqr.io.setup_logger ### Parameters #### Request Body - **output_pqr** (str) - Required - The path to the PQR file. - **level** (str) - Optional - The logging level (e.g., 'DEBUG', 'INFO'). Defaults to 'DEBUG'. ### Response #### Success Response (200) - **message** (str) - A confirmation message indicating the logger has been set up. #### Response Example ```json { "message": "Logger setup complete." } ``` ``` -------------------------------- ### Install PDB2PQR from Source (Editable Mode) Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/getting.md For developers, install PDB2PQR in editable mode using this command from the top-level source directory. This allows for changes in the source code to be reflected immediately without reinstallation. ```bash pip install -e . ``` -------------------------------- ### Install PDB2PQR via PIP Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/getting.md Use this command to install the PDB2PQR package using pip. It is recommended to do this within a virtual environment. ```bash pip install pdb2pqr ``` -------------------------------- ### Setup Molecular System Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/main.md Initializes and sets up the molecular system for analysis, including parsing PDB records and definitions. ```APIDOC ## setup_molecule ### Description Set up the molecular system. ### Method Not specified (assumed to be a function call within a script) ### Endpoint Not applicable (Python function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **pdblist** (*list*) – list of PDB records * **definition** ([*Definition*](definitions.md#pdb2pqr.definitions.Definition)) – topology definition * **ligand_path** (*str*) – path to ligand (may be None) ### Returns (biomolecule object, definition object–revised if ligand was parsed, ligand object–may be None) ### Return type ([Biomolecule](biomolecule.md#pdb2pqr.biomolecule.Biomolecule), [Definition](definitions.md#pdb2pqr.definitions.Definition), Ligand) ``` -------------------------------- ### Get PDB2PQR Help Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/using/index.md Command to display all available options and usage information for the PDB2PQR command-line tool. ```bash pdb2pqr --help ``` -------------------------------- ### GET /io/get_definitions Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/io.md Loads topology definition files for amino acids, nucleic acids, and patches. ```APIDOC ## GET /io/get_definitions ### Description Load topology definition files. ### Parameters #### Query Parameters - **aa_path** (str) - Optional - likely location of amino acid topology definitions - **na_path** (str) - Optional - likely location of nucleic acid topology definitions - **patch_path** (str) - Optional - likely location of patch topology definitions ### Response #### Success Response (200) - **definitions** (object) - topology Definitions object. ``` -------------------------------- ### GET /io/get_pdb_file Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/io.md Obtains a PDB file from a local path or the RCSB PDB webserver. ```APIDOC ## GET /io/get_pdb_file ### Description Obtain a PDB file. First check the path given on the command line - if that file is not available, obtain the file from the PDB webserver. ### Parameters #### Query Parameters - **name** (str) - Required - name of PDB file (path) or PDB ID ### Response #### Success Response (200) - **file** (file) - file-like object containing PDB file ``` -------------------------------- ### GET /biomolecule/properties Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/biomolecule.md Retrieves various properties of the biomolecule structure. ```APIDOC ## GET /biomolecule/properties ### Description Retrieve metadata properties of the biomolecule including heavy atom counts, patch maps, and reference maps. ### Method GET ### Endpoint /biomolecule/properties ### Response #### Success Response (200) - **num_missing_heavy** (int) - Number of missing biomolecular heavy atoms - **patch_map** (list) - Definition patch maps - **reference_map** (dict) - Definition reference map ``` -------------------------------- ### pdb2pqr.quatfit.qfit Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/quatfit.md Method for getting new atom coordinates from sets of reference and definition coordinates. ```APIDOC ## pdb2pqr.quatfit.qfit ### Description Method for getting new atom coordinates from sets of reference and definition coordinates. ### Parameters #### Path Parameters - **numpoints** (int) - Required - the number of points in each list - **refcoords** ([[float, float, float]]) - Required - list of reference coordinates - **defcoords** ([[float, float, float]]) - Required - list of definition coordinates ### Response - **Returns** (tuple) - (reference center, definition center, left rotation matrix) ``` -------------------------------- ### SITE Class Initialization Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/pdb.md Initializes the SITE class by parsing a line from a PDB file to extract information about a site. ```APIDOC ## SITE Class Initialization ### Description Initializes the SITE class by parsing a line from a PDB file to extract information about a site. ### Method __init__ ### Parameters #### Path Parameters - **line** (str) - Required - The line containing PDB site information. ### Request Body ``` { "line": "string" } ``` ### Response #### Success Response (200) - **seq_num** (int) - Sequence number of the site. - **site_id** (string) - Site name. - **num_res** (int) - Number of residues comprising the site. - **res_name1** (string) - Residue name for the first residue. - **chain_id1** (string) - Chain identifier for the first residue. - **seq1** (int) - Residue sequence number for the first residue. - **ins_code1** (string) - Insertion code for the first residue. - **res_name2** (string) - Residue name for the second residue. - **chain_id2** (string) - Chain identifier for the second residue. - **seq2** (int) - Residue sequence number for the second residue. - **ins_code2** (string) - Insertion code for the second residue. - **res_name3** (string) - Residue name for the third residue. - **chain_id3** (string) - Chain identifier for the third residue. - **seq3** (int) - Residue sequence number for the third residue. - **ins_code3** (string) - Insertion code for the third residue. - **res_name4** (string) - Residue name for the fourth residue. - **chain_id4** (string) - Chain identifier for the fourth residue. - **seq4** (int) - Residue sequence number for the fourth residue. - **ins_code4** (string) - Insertion code for the fourth residue. ### Response Example ```json { "seq_num": 1, "site_id": "A", "num_res": 1, "res_name1": "ARG", "chain_id1": "A", "seq1": 10, "ins_code1": " ", "res_name2": null, "chain_id2": null, "seq2": null, "ins_code2": null, "res_name3": null, "chain_id3": null, "seq3": null, "ins_code3": null, "res_name4": null, "chain_id4": null, "seq4": null, "ins_code4": null } ``` ``` -------------------------------- ### Run Web Server Tests Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/releases.md Executes a comprehensive test suite against the production PDB2PQR web server. ```bash make test-webserver ``` -------------------------------- ### GET /io/get_molecule Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/io.md Retrieves molecular structure information from a PDB ID or file path. ```APIDOC ## GET /io/get_molecule ### Description Get molecular structure information as a series of parsed lines. ### Parameters #### Query Parameters - **input_path** (str) - Required - structure file PDB ID or path ### Response #### Success Response (200) - **molecule_records** (list) - list of molecule records - **is_cif** (bool) - Boolean indicating whether entry is CIF ``` -------------------------------- ### Water Optimization Class Initialization Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/hydrogens.md Initializes the water optimization class with necessary parameters. ```APIDOC ## __init__ (residue, optinstance, routines) ### Description Initialize the water optimization class. ### Parameters #### Path Parameters - **residue** (Residue) - Required - the residue to flip - **optinstance** (OptimizationHandler) - Required - the optimization instance containing information about what to optimize - **routines** (Debump) - Required - debumping routines object ``` -------------------------------- ### __init__(line) Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/pdb.md Initializes the strand data structure by parsing a specific line from a PDB file. ```APIDOC ## __init__(line) ### Description Initializes the object by parsing a line from a PDB file, mapping specific column ranges to class fields. ### Parameters #### Request Body - **line** (str) - Required - A string representing a line from a PDB file containing strand information. ### Fields - **strand** (int) - Strand number (starts at 1). - **sheet_id** (string) - Sheet identifier. - **num_strands** (int) - Number of strands in the sheet. - **init_res_name** (string) - Residue name of initial residue. - **init_chain_id** (string) - Chain identifier of initial residue. - **init_seq_num** (int) - Sequence number of initial residue. - **init_i_code** (string) - Insertion code of initial residue. - **end_res_name** (string) - Residue name of terminal residue. - **end_chain_id** (string) - Chain identifier of terminal residue. - **end_seq_num** (int) - Sequence number of terminal residue. - **end_i_code** (string) - Insertion code of terminal residue. - **sense** (int) - Sense of strand (0: first, 1: parallel, -1: anti-parallel). - **cur_atom** (string) - Registration: Atom name in current strand. - **curr_res_name** (string) - Registration: Residue name in current strand. - **curChainId** (string) - Registration: Chain identifier in current strand. - **curr_res_seq** (int) - Registration: Residue sequence number in current strand. - **curr_ins_code** (string) - Registration: Insertion code in current strand. - **prev_atom** (string) - Registration: Atom name in previous strand. - **prev_res_name** (string) - Registration: Residue name in previous strand. - **prevChainId** (string) - Registration: Chain identifier in previous strand. - **prev_res_seq** (int) - Registration: Residue sequence number in previous strand. - **prev_ins_code** (string) - Registration: Insertion code in previous strand. ``` -------------------------------- ### Residue Initialization and Methods Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/aa.md Details on how to initialize a Residue object and the methods available for managing its atoms. ```APIDOC ## Residue Class ### `__init__(atoms, ref)` Initialize a Residue object. #### Parameters * **atoms** (list[Atom]) - A list of `Atom` objects to be stored in this object. * **ref** (DefinitionResidue) - The reference object for the residue. Used to convert from the alternate naming scheme to the main naming scheme. ### `add_atom(atom)` Add an atom to the residue. Overrides the existing `add_atom` to include the link to the reference object. #### Parameters * **atom** (Atom) - The atom to add to the residue. ### `create_atom(atomname, newcoords)` Create a water atom. Note the HETATM field. #### Parameters * **atomname** (str) - The name of the atom to be added. * **newcoords** (list[float, float, float]) - The coordinates for the new atom. ### `water_residue_names` A class variable containing a list of common water residue names. * Value: `['HOH', 'WAT']` ``` -------------------------------- ### EXPDTA Record Initialization Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/pdb.md Initializes the EXPDTA record to identify the experimental technique used for the structure. ```APIDOC ## __init__(line) ### Description Initialize by parsing an EXPDTA PDB line. ### Parameters #### Request Body - **line** (str) - Required - Line with PDB class ### Data Fields - **technique** (string) - The experimental technique(s) with optional comment ``` -------------------------------- ### Run PDB2PQR Command Line Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/using/index.md Basic command to run PDB2PQR from the command line. Specify options like force field, input PDB file path, and output PQR file path. The input path can be a PDB ID for automatic retrieval. ```bash pdb2pqr [options] --ff={forcefield} {path} {output-path} ``` -------------------------------- ### SLTBRG Class Initialization Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/pdb.md Initializes the SLTBRG class by parsing a line from a PDB file to define salt bridges. ```APIDOC ## SLTBRG Class Initialization ### Description Initializes the SLTBRG class by parsing a line from a PDB file to define salt bridges. ### Method __init__ ### Parameters #### Path Parameters - **line** (str) - Required - The line containing PDB salt bridge information. ### Request Body ``` { "line": "string" } ``` ### Response #### Success Response (200) - **name1** (string) - Atom name of the first atom in the salt bridge. - **alt_loc1** (string) - Alternate location indicator for the first atom. - **res_name1** (string) - Residue name of the first atom. - **chain_id1** (string) - Chain identifier of the first atom. - **res_seq1** (int) - Residue sequence number of the first atom. - **ins_code1** (string) - Insertion code of the first atom. - **name2** (string) - Atom name of the second atom in the salt bridge. - **alt_loc2** (string) - Alternate location indicator for the second atom. - **res_name2** (string) - Residue name of the second atom. - **chain_id2** (string) - Chain identifier of the second atom. - **res_seq2** (int) - Residue sequence number of the second atom. - **ins_code2** (string) - Insertion code of the second atom. - **sym1** (string) - Symmetry operator for the first atom. - **sym2** (string) - Symmetry operator for the second atom. ### Response Example ```json { "name1": "CB", "alt_loc1": " ", "res_name1": "ARG", "chain_id1": "A", "res_seq1": 10, "ins_code1": " ", "name2": "CD", "alt_loc2": " ", "res_name2": "ASP", "chain_id2": "A", "res_seq2": 15, "ins_code2": " ", "sym1": " ", "sym2": " " } ``` ``` -------------------------------- ### Test PDB2PQR with Coverage.py and Pytest Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/getting.md Run basic tests for PDB2PQR using Coverage.py and Pytest. Execute this command from the top level of the source directory. Add the --run-long option for more extensive testing. ```bash coverage run -m pytest ``` -------------------------------- ### Format code with Ruff Source: https://github.com/electrostatics/pdb2pqr/blob/main/CONTRIBUTING.md Use these commands in the project root to automatically fix imports and format the codebase. ```bash # in the project root directory ruff check --select I --fix . ruff format . ``` -------------------------------- ### Input Class Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/inputgen.md Represents an entire APBS input file, containing PQR file information, electrostatic calculations, and print statements. ```APIDOC ## `pdb2pqr.inputgen.Input` Class ### Description Each object of this class is one APBS input file. ### Method `__init__` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **pqrpath** (str) - path to PQR file * **size** (Psize) - parameter sizing object * **method** (str) - solution method (e.g., mg-para, mg-auto, etc.) * **asyncflag** (bool) - perform an asynchronous parallel focusing calculation * **istrng** - ionic strength/concentration (M) * **potdx** (bool) - whether to write out potential information in DX format ### NOTE This assumes you have already run psize, either by `size.run_psize(...)()` or `size.parse_string(...)()` followed by `size.set_all()`. ### Methods #### `dump_pickle()` Make a Python pickle associated with the APBS input parameters. #### `print_input_files(output_path)` Generate the input file(s) associated with this object. * **Parameters:** **output_path** (str) - location for generated files ### Request Example None ### Response None ``` -------------------------------- ### SOURCE Class Initialization Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/pdb.md Initializes the SOURCE class by parsing a line from a PDB file to describe the source of a biological molecule. ```APIDOC ## SOURCE Class Initialization ### Description Initializes the SOURCE class by parsing a line from a PDB file to describe the source of a biological molecule. ### Method __init__ ### Parameters #### Path Parameters - **line** (str) - Required - The line containing PDB source information. ### Request Body ``` { "line": "string" } ``` ### Response #### Success Response (200) - **source** (string) - Identifies the source of the macromolecule in a token: value format. ### Response Example ```json { "source": "ORGANISM: Homo sapiens (Human)" } ``` ``` -------------------------------- ### Run PDB2PQR Suite Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/run.md Executes the PDB2PQR suite for biomolecular electrostatics calculations. ```APIDOC ## pdb2pqr.run.run_pdb2pqr ### Description Run the PDB2PQR Suite ### Method Not specified (assumed to be a function call within a Python environment) ### Parameters - **pdblist** (list) - Description not specified - **my_biomolecule** (object) - Description not specified - **my_definition** (object) - Description not specified - **options** (object) - Description not specified - **is_cif** (boolean) - Description not specified ``` -------------------------------- ### Test PDB2PQR with Pytest Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/getting.md Run basic tests for PDB2PQR using Pytest. Execute this command from the top level of the source directory. Add the --run-long option for more extensive testing. ```bash python -m pytest ``` -------------------------------- ### Ligand Data Structures and Utilities Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/ligand.md Provides access to constants and classes for handling ligand information, including element groups, non-bonded electrons, radii, and valence data, as well as MOL2 file parsing. ```APIDOC ## PDB2PQR Ligand Module Constants ### `pdb2pqr.ligand.ELEMENT_BY_GROUP` Groups of the periodic table. ### `pdb2pqr.ligand.NONBONDED_BY_TYPE` Numbers of non-bonded electrons for Sybyl-type atoms. Adapted from [https://onlinelibrary.wiley.com/doi/abs/10.1002/jcc.540100804](https://onlinelibrary.wiley.com/doi/abs/10.1002/jcc.540100804) (Table I). ### `pdb2pqr.ligand.RADII` Radii for different atom types. When using these tables, the most specific Sybyl atom type should be used first and then the generic element should be used. ### `pdb2pqr.ligand.VALENCE_BY_ELEMENT` Valence electrons by element. ### `pdb2pqr.ligand.VALENCE_BY_GROUP` Numbers of valence electrons for the groups of the periodic table. ## `pdb2pqr.ligand.mol2` Module Support molecules in Tripos MOL2 format. For further information look at (web page exists: 25 August 2005): [http://www.tripos.com/index.php?family=modules,SimplePage,,,&page=sup_mol2&s=0](http://www.tripos.com/index.php?family=modules,SimplePage,,,&page=sup_mol2&s=0) ### Class: `pdb2pqr.ligand.mol2.Mol2Atom` MOL2 molecule atoms. #### `__init__()` Initializes a `Mol2Atom` object. #### `assign_radius(primary_dict, secondary_dict)` Assign radius to atom. * **Parameters:** * **primary_dict** (*dict*) – primary dictionary of radii indexed by atom type or element * **secondary_dict** (*dict*) – backup dictionary for radii not found in primary dictionary #### Property: `bond_order` Total number of electrons in bonds with other atoms. * **Returns:** total number of electrons in bonds with other atoms * **Return type:** int #### Property: `bonded_atom_names` Bonded atom names. * **Returns:** bonded atom names * **Return type:** list #### Property: `coords` Coordinates. * **Returns:** coordinates * **Return type:** numpy.ndarray #### `distance(other)` Get distance between two atoms. * **Parameters:** * **other** ([*Mol2Atom*](#pdb2pqr.ligand.mol2.Mol2Atom)) – other atom for distance measurement * **Returns:** distance * **Return type:** float #### Property: `element` Element for this atom (uppercase). * **Returns:** element for this atom * **Return type:** str #### Property: `formal_charge` Formal charge for this atom. * **Returns:** formal charge for this atom * **Return type:** int #### Property: `num_bonded_heavy` Number of heavy atoms bonded to this atom. * **Returns:** number of heavy atoms * **Return type:** int #### Property: `num_bonded_hydrogen` Number of hydrogen atoms bonded to this atom. * **Returns:** number of hydrogen atoms * **Return type:** int ### Class: `pdb2pqr.ligand.mol2.Mol2Bond` MOL2 molecule bonds. #### `__init__(atom1, atom2, bond_type, bond_id=0)` Initialize bond. * **Parameters:** * **atom1** (*str*) – name of first atom in bond * **atom2** (*str*) – name of second atom in bond * **bond_type** (*int*) – type of bond: 1 (single), 2 (double), or ar (aromatic) * **bond_id** (*int*) – integer ID of bond #### Property: `atom_names` Get atom names in bond. * **Returns:** tuple with names of atoms in bond. * **Return type:** (str, str) ``` -------------------------------- ### File Testing Utilities Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/io.md Utility functions for testing the existence and location of forcefield and other files. ```APIDOC ## POST /pdb2pqr.io.test_dat_file ### Description Tests for the existence of a forcefield dat file, checking various name permutations. ### Method POST ### Endpoint /pdb2pqr.io.test_dat_file ### Parameters #### Request Body - **name** (str) - Required - The name of the dat file. ### Response #### Success Response (200) - **path** (str) - The path to the found file. #### Response Example ```json { "path": "/path/to/forcefield.dat" } ``` #### Error Response (404) - **error** (str) - "FileNotFoundError: file not found" #### Error Example ```json { "error": "FileNotFoundError: file not found" } ``` ``` ```APIDOC ## POST /pdb2pqr.io.test_for_file ### Description Tests for the existence of a file with a given name and type, checking various name permutations. ### Method POST ### Endpoint /pdb2pqr.io.test_for_file ### Parameters #### Request Body - **name** (str) - Required - The name of the file. - **type_** (str) - Required - The type of the file. ### Response #### Success Response (200) - **path** (str) - The path to the found file. #### Response Example ```json { "path": "/path/to/somefile.txt" } ``` #### Error Response (404) - **error** (str) - "FileNotFoundError: if file not found" #### Error Example ```json { "error": "FileNotFoundError: if file not found" } ``` ``` ```APIDOC ## POST /pdb2pqr.io.test_names_file ### Description Tests for the existence of a .names file, which contains XML mapping information. ### Method POST ### Endpoint /pdb2pqr.io.test_names_file ### Parameters #### Request Body - **name** (str) - Required - The name of the forcefield. ### Response #### Success Response (200) - **path** (str) - The path to the found .names file. #### Response Example ```json { "path": "/path/to/forcefield.names" } ``` #### Error Response (404) - **error** (str) - "FileNotFoundError: file not found" #### Error Example ```json { "error": "FileNotFoundError: file not found" } ``` ``` ```APIDOC ## POST /pdb2pqr.io.test_xml_file ### Description Tests for the existence of an XML file, checking various name permutations. ### Method POST ### Endpoint /pdb2pqr.io.test_xml_file ### Parameters #### Request Body - **name** (str) - Required - The name of the dat file. ### Response #### Success Response (200) - **path** (str) - The path to the found XML file. #### Response Example ```json { "path": "/path/to/forcefield.xml" } ``` #### Error Response (404) - **error** (str) - "FileNotFoundError: file not found" #### Error Example ```json { "error": "FileNotFoundError: file not found" } ``` ``` -------------------------------- ### Mol2Bond Class Initialization Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/ligand.md Initializes a MOL2 molecule bond object. Bonds are defined between two atoms with a specified bond type and ID. ```python class pdb2pqr.ligand.mol2.Mol2Bond(atom1, atom2, bond_type, bond_id=0): def __init__(self, atom1, atom2, bond_type, bond_id=0): pass ``` -------------------------------- ### PDB2PQR psize Class: Psize Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/psize.md Class for parsing input files and suggesting settings for grid calculations. ```APIDOC ## `class` pdb2pqr.psize.Psize Class for parsing input files and suggesting settings. ### `__init__(cfac=1.7, fadd=20.0, space=0.5, gmemfac=200, gmemceil=400, ofrac=0.1, redfac=0.25)` Initialize the Psize object. #### Parameters: * **cfac** (float) - factor by which to expand molecular dimensions to get coarse grid dimensions. * **fadd** (float) - amount (in Angstroms) to add to molecular dimensions to get the fine grid dimensions. * **space** (float) - desired fine mesh resolution (in Angstroms). * **gmemfac** (float) - number of bytes per grid point required for a sequential multigrid calculation. * **gmemceil** (float) - maximum memory (in MB) allowed for sequential multigrid calculation. Adjust this value to force the script to perform faster calculations (which require more parallelism). * **ofrac** (float) - overlap factor between mesh partitions in parallel focusing calculation. * **redfac** (float) - the maximum factor by which a domain dimension can be reduced during focusing. ### `parse_input(filename)` Parse input structure file in PDB or PQR format. #### Parameters: * **filename** (str) - string with path to PDB- or PQR-format file. ### `parse_lines(lines)` Parse the PQR/PDB lines. #### Parameters: * **lines** ([str]) - PDB/PQR lines to parse. ### `parse_string(structure)` Parse the input structure as a string in PDB or PQR format. #### Parameters: * **structure** (str) - input structure as string in PDB or PQR format. ### `run_psize(filename)` Parse input PQR file and set parameters. #### Parameters: * **filename** (str) - path of PQR file. ### `set_all()` Set up all of the things calculated individually above. ### `set_center(maxlen, minlen)` Compute molecular center. #### Parameters: * **maxlen** ([float, float, float]) - maximum molecule lengths. * **minlen** ([float, float, float]) - minimum molecule lengths. #### Returns: center of molecule #### Return type: [float, float, float] ### `set_coarse_grid_dims(mol_length)` Compute coarse mesh lengths. #### Parameters: * **mol_length** ([float, float, float]) - input molecule lengths. #### Returns: coarse grid dimensions #### Return type: [float, float, float] ### `set_fine_grid_dims(mol_length, coarse_length)` Compute fine mesh lengths. #### Parameters: * **mol_length** ([float, float, float]) - input molecule lengths. * **coarse_length** ([float, float, float]) - coarse grid lengths. #### Returns: fine grid lengths #### Return type: [float, float, float] ### `set_fine_grid_points(fine_length)` Compute mesh grid points, assuming 4 levels in multigrid hierarchy. #### Parameters: * **fine_length** ([float, float, float]) - lengths of the fine grid. #### Returns: number of grid points in each direction #### Return type: [int, int, int] ### `set_focus(fine_length, nproc, coarse_length)` Calculate the number of levels of focusing required for each processor subdomain. #### Parameters: * **fine_length** ([float, float, float]) - fine grid length. * **nproc** ([int, int, int]) - number of processors in each dimension. * **coarse_length** ([float, float, float]) - coarse grid length. ### `set_length(maxlen, minlen)` Compute molecular dimensions, adjusting for zero-length values. #### Parameters: * **maxlen** ([float, float, float]) - maximum dimensions from molecule. * **minlen** ([float, float, float]) - minimum dimensions from molecule. #### Returns: molecular dimensions #### Return type: [float, float, float] ``` -------------------------------- ### DBREF Record Initialization Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/pdb.md Initializes the DBREF record, which provides cross-reference links between PDB sequences and database entries. ```APIDOC ## __init__(line) ### Description Initialize by parsing a DBREF PDB line. ### Parameters #### Request Body - **line** (str) - Required - Line with PDB class ### Data Fields - **id_code** (string) - ID code of this entry - **chain_id** (string) - Chain identifier - **seq_begin** (int) - Initial sequence number - **insert_begin** (string) - Initial insertion code - **seq_end** (int) - Ending sequence number - **insert_end** (string) - Ending insertion code - **database** (string) - Sequence database name - **db_accession** (string) - Sequence database accession code - **db_id_code** (string) - Sequence database identification code - **db_seq_begin** (int) - Initial sequence number of database segment - **db_ins_begin** (string) - Insertion code of initial residue - **dbseq_end** (int) - Ending sequence number of database segment - **db_ins_end** (string) - Insertion code of ending residue ``` -------------------------------- ### build_parser Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/psize.md Constructs the argument parser for the psize module. ```APIDOC ## build_parser() ### Description Build argument parser for the module. ### Response - **Returns** (argparse.ArgumentParser) - argument parser ``` -------------------------------- ### main Function Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/inputgen.md The main driver function for the input generation process. ```APIDOC ## `pdb2pqr.inputgen.main()` Function ### Description Main driver ### Method `main` ### Parameters None ### Request Example None ### Response None ``` -------------------------------- ### Lint code with Ruff Source: https://github.com/electrostatics/pdb2pqr/blob/main/CONTRIBUTING.md Run essential and optional lints to ensure code quality before submission. ```bash # The essential lints must pass ruff check --config ruff_essential.toml . # Follow the optional lints as much as possible ruff check . ``` -------------------------------- ### pdb2pqr.quatfit.find_coordinates Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/quatfit.md Driver for the quaternion file to obtain coordinates for a new atom. ```APIDOC ## pdb2pqr.quatfit.find_coordinates ### Description Provide the coordinates as inputs and obtain the coordinates for the new atom as output. ### Parameters #### Path Parameters - **numpoints** (int) - Required - the number of points in each list - **refcoords** ([[float, float, float]]) - Required - the reference coordinates - **defcoords** ([[float, float, float]]) - Required - the definition coordinates - **defatomcoords** ([[float, float, float]]) - Required - the definition coordinates for the atom to be placed in the reference frame ### Response - **Returns** ([[float, float, float]]) - the coordinates of the new atom in the reference frame ``` -------------------------------- ### Execute Long Test Suite Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/releases.md Runs PDB2PQR tests on a large set of PDB files, with an optional environment variable to limit the number of tests. ```bash export TESTNUM=50; make test-long ``` -------------------------------- ### Water Optimization Methods Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/hydrogens.md Provides methods for completing, finalizing, and attempting optimizations for water residues. ```APIDOC ## Water Optimization Methods ### Description Methods for completing, finalizing, and attempting optimizations for water residues. ### complete() #### Description Complete the water optimization process. ### finalize() #### Description Finalize a water residue. Try to minimize conflict with nearby atoms by building away from them. Called when LPs are still present so as to account for their bonds. ### try_acceptor(acc, donor) #### Description The main driver for adding an LP to an optimizeable residue. #### Parameters ##### Path Parameters - **donor** (Atom) - Required - hydrogen bond donor - **acc** (Atom) - Required - hydrogen bond acceptor #### Returns - **bool** - indication of whether addition was successful ### try_both(donor, acc, accobj) #### Description Attempt to optimize both the donor and the acceptor. If one is fixed, we only need to try one side. First try to satisfy the donor - if that's successful, try to satisfy the acceptor. An undo may be necessary if the donor is satisfied and the acceptor isn’t. #### Parameters ##### Path Parameters - **donor** (Atom) - Required - hydrogen bond donor - **acc** (Atom) - Required - hydrogen bond acceptor - **accobj** (Flip) - Required - a Flip-like hydrogen bond structure object #### Returns - **bool** - indication of whether hydrogen was added ### try_donor(donor, acc) #### Description Add hydrogen to an optimizable residue. #### Parameters ##### Path Parameters - **donor** (Atom) - Required - hydrogen bond donor - **acc** (Atom) - Required - hydrogen bond acceptor #### Returns - **bool** - indication of whether addition was successful ``` -------------------------------- ### CRYST1 Record Initialization Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/pdb.md Initializes the CRYST1 record by parsing a PDB line to extract unit cell dimensions and space group information. ```APIDOC ## __init__(line) ### Description Initialize by parsing a CRYST1 PDB line. ### Parameters #### Request Body - **line** (str) - Required - Line with PDB class ### Data Fields - **a** (float) - a (Angstroms) - **b** (float) - b (Angstroms) - **c** (float) - c (Angstroms) - **alpha** (float) - alpha (degrees) - **beta** (float) - beta (degrees) - **gamma** (float) - gamma (degrees) - **space_group** (string) - Space group - **z** (int) - Z value ``` -------------------------------- ### Run PDB2PQR Tests Source: https://github.com/electrostatics/pdb2pqr/blob/main/tests/README.md Execute all tests for the PDB2PQR project using pytest. Note that some tests can take a significant amount of time to complete. ```bash $ python -m pytest ``` -------------------------------- ### Biomolecule Class Initialization Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/biomolecule.md Initializes a Biomolecule object using a list of parsed PDB lines and a topology definition. ```APIDOC ## __init__ Biomolecule ### Description Initialize using parsed PDB file ### Parameters * **pdblist** (*list*) – list of objects from `pdb` from lines of PDB file * **definition** ([*Definition*](definitions.md#pdb2pqr.definitions.Definition)) – topology definition object ``` -------------------------------- ### DefinitionHandler Class Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/definitions.md Handles XML file content parsing for topology definitions. ```APIDOC ## DefinitionHandler Class ### Description Handles definition XML file content parsing. ### Methods - **characters(text)**: Parse text data in XML. - **endElement(name)**: End XML element parsing. Raises KeyError for invalid names or RuntimeError for format issues. - **startElement(name, _)**: Start XML element parsing. ``` -------------------------------- ### Mol2Atom Class Initialization Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/ligand.md Initializes a MOL2 molecule atom object. This class represents atoms within a MOL2 file. ```python class pdb2pqr.ligand.mol2.Mol2Atom: def __init__(self): pass ``` -------------------------------- ### pdb2pqr.ligand.mol2.Mol2Molecule Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/ligand.md Methods for managing Tripos MOL2 molecule structures, including parsing, charge assignment, and structural analysis. ```APIDOC ## pdb2pqr.ligand.mol2.Mol2Molecule ### Description Represents a Tripos MOL2 molecule and provides methods to parse files, assign charges/radii, and identify structural features like torsions and rings. ### Methods - **assign_charges()**: Assign charges to atoms in molecule. - **assign_parameters(primary_dict, secondary_dict)**: Assign charges and radii to atoms in molecule. - **assign_radii(primary_dict, secondary_dict)**: Assign radii to atoms in molecule. - **find_atom_torsions(start_atom)**: Set the torsion angles that start with this atom. - **find_new_rings(path, rings, level=0)**: Find new rings in molecule. - **parse_atoms(mol2_file)**: Parse @ATOM section of file. - **parse_bonds(mol2_file)**: Parse @BOND section of file. - **read(mol2_file)**: Routines for reading MOL2 file. - **rotate_to_smallest(path)**: Rotate cycle path so that it begins with the smallest node. - **set_rings()**: Set all rings in molecule. - **set_torsions()**: Set all torsions in molecule. ``` -------------------------------- ### Ligand Module API Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/extending.md API endpoints for handling ligand structures and properties. ```APIDOC ## Ligand API ### Description Provides functionalities for processing ligand data, including atom radius assignment. ### Methods - `pdb2pqr.ligand` (module level) - `Mol2Atom.assign_radius()` ``` -------------------------------- ### pdb2pqr.pdb.PDB Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/pdb.md Represents a PDB entry, initialized by parsing a line. ```APIDOC ## PDB Class ### Description Represents a PDB entry, initialized by parsing a line. ### Method __init__ ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response None ### Error Handling None ``` -------------------------------- ### Reading QCD Files Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/io.md Functions for reading data from QCD files. ```APIDOC ## POST /pdb2pqr.io.read_qcd ### Description Reads data from a QCD file (UHDB QCARD format). ### Method POST ### Endpoint /pdb2pqr.io.read_qcd ### Parameters #### Request Body - **qcd_file** (file) - Required - A file object ready for reading as text. ### Response #### Success Response (200) - **atoms** (list) - A list of atoms read from the file. #### Response Example ```json { "atoms": [ { "serial": 1, "name": "CA", "residue_name": "ALA", "chain_id": "A", "residue_id": 1, "insertion_code": "", "x": 1.0, "y": 2.0, "z": 3.0, "occupancy": 1.0, "temperature_factor": 20.0, "element": "C", "charge": 0.5 } ] } ``` ``` -------------------------------- ### Flip Class for Flippable Residues Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/hydrogens.md Manages the optimization of flippable residues, including initialization, completion, and state finalization. ```APIDOC ## Class: pdb2pqr.hydrogens.structures.Flip ### Description The holder for optimization of flippable residues. ### Methods #### __init__(residue, optinstance, routines) Initialize a potential flip. Rather than flipping the given residue back and forth, take each atom that would be flipped and pre-flip it, making a new `*FLIP` atom in its place. * **Parameters:** * **residue** (*Residue*) – the residue to flip * **optinstance** (*OptimizationHandler*) – the optimization instance containing information about what to optimize * **routines** (*Debump*) – debumping routines object #### complete() Complete the flippable residue optimization. Call the [`finalize()`](#pdb2pqr.hydrogens.structures.Flip.finalize) function, and then rename all `FLIP` atoms back to their standard names. #### finalize() Finalize a flippable group back to its original state. Since the original atoms are now `*FLIP`, it deletes the `*` atoms and renames the `*FLIP` atoms back to `*`. #### fix_flip(bondatom) Remove atoms if hydrogen bond has been found for specified atom. If bondatom is of type `*FLIP`, remove all `*` atoms, otherwise remove all `*FLIP` atoms. * **Parameters:** * **bondatom** (*Atom*) – atom to flip #### try_acceptor(acc, donor) Add a lone pair to an optimizable residue. * **Parameters:** * **acc** (*Atom*) – hydrogen bond acceptor * **donor** (*Atom*) – hydrogen bond donor * **Returns:** indication of whether addition was successful * **Return type:** bool ``` -------------------------------- ### Input Generation API Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/extending.md API endpoints for generating input files for PDB2PQR. ```APIDOC ## Input Generation API ### Description Provides functionalities for initializing and managing input data for PDB2PQR calculations. ### Methods - `Elec._init_()` - `Input.dump_pickle()` ``` -------------------------------- ### Main Functionality API Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/extending.md Core API endpoints for PDB2PQR main functionalities. ```APIDOC ## Main API ### Description Core functionalities of PDB2PQR, including argument parsing, water removal, file format conversions, and printing PDB/PQR files. ### Methods - `build_main_parser()` - `drop_water()` - `dx_to_cube()` - `non_trivial()` - `print_pdb()` - `print_pqr()` - `transform_arguments()` ``` -------------------------------- ### pdb2pqr.cif.keywds Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/cif.md Handles the KEYWDS block in CIF files, returning parsed CONECT objects and any unparsed data. ```APIDOC ## pdb2pqr.cif.keywds(block) ### Description Handle KEYWDS block. ### Parameters #### Path Parameters - **block** (str) – PDBx data block ### Returns (array of pdb.conect objects, array of things that did not parse) ### Return type ([[pdb.CONECT](pdb.md#pdb2pqr.pdb.CONECT)], [str]) ``` -------------------------------- ### Run PDB2PKA Source: https://github.com/electrostatics/pdb2pqr/blob/main/docs/source/api/run.md Executes the PDB2PKA tool to determine protonation states of proteins. ```APIDOC ## pdb2pka.run.run_pdb2pka ### Description Run PDB2PKA ### Method Not specified (assumed to be a function call within a Python environment) ### Parameters - **ph** (float) - Description not specified - **force_field** (string) - Description not specified - **pdb_list** (list) - Description not specified - **ligand** (string) - Description not specified - **pdb2pka_params** (object) - Description not specified ```