Utils
structure.pdb.utils.cli_align_pdb()
¶
Command-line interface for aligning PDB file.
structure.pdb.utils.cli_filter_pdb()
¶
Command-line interface for filtering PDB file lines
structure.pdb.utils.cli_merge_pdbs()
¶
Command-line interface for merging PDB files
structure.pdb.utils.cli_write_pdb()
¶
Command-line interface for writing PDB from topology and coordinate files.
structure.pdb.utils.keep_lines(lines, record_types=('ATOM', 'HETATM', 'TER', 'END', 'MODEL', 'ENDMDL'))
¶
Filter PDB lines to keep in file.
PARAMETER | DESCRIPTION |
---|---|
lines |
List of lines in the PDB file.
TYPE:
|
record_types |
Records to keep in the PDB file.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list[str]
|
Filtered lines. |
structure.pdb.utils.parse_atomname(line)
¶
Gets the atom name from a line.
PARAMETER | DESCRIPTION |
---|---|
line |
Line of a PDB file that starts with ATOM or HETATM.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
str
|
Atom name. |
structure.pdb.utils.parse_resid(line)
¶
Gets the residue ID from a line.
PARAMETER | DESCRIPTION |
---|---|
line |
Line of a PDB file that starts with ATOM or HETATM.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
str
|
Residue ID. |
structure.pdb.utils.parse_resname(line)
¶
Gets the residue name from a line.
PARAMETER | DESCRIPTION |
---|---|
line |
Line of a PDB file that starts with ATOM or HETATM.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
str
|
Residue ID. |
structure.pdb.utils.replace_in_pdb_line(line, orig, new, start, stop)
¶
General function to replace parts of a PDB line.
PARAMETER | DESCRIPTION |
---|---|
line |
PDB line.
TYPE:
|
orig |
Original value to check if it exists.
TYPE:
|
new |
If
TYPE:
|
start |
Slice the line starting here to replace.
TYPE:
|
stop |
Slice the line stopping here to replace.
TYPE:
|
structure.pdb.utils.run_align_pdb(pdb_path, out_path, selection_str=None)
¶
Align structure in PDB file.
PARAMETER | DESCRIPTION |
---|---|
pdb_path |
Path to PDB file.
TYPE:
|
out_path |
Path to write aligned PDB file.
TYPE:
|
selection_str |
Selection string for MDAnalysis universe.
TYPE:
|
structure.pdb.utils.run_filter_pdb(pdb_path, output_path=None, record_types=None)
¶
Only keep PDB lines that contain specified record types.
PARAMETER | DESCRIPTION |
---|---|
pdb_path |
Path to PDB file.
TYPE:
|
output_path |
Path to save new PDB file. If
TYPE:
|
record_types |
Records to keep in the PDB file. Defaults to
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list[str]
|
PDB file lines. |
structure.pdb.utils.run_merge_pdbs(*pdb_paths, output_path=None)
¶
Merge PDB files. No atoms are removed, only added.
PARAMETER | DESCRIPTION |
---|---|
*pdb_paths |
Paths to PDB files in order of decreasing precedence. We assume the residue indices are consistent across PDB files.
TYPE:
|
structure.pdb.utils.run_write_pdb(file_paths, output_path, selection_str=None, stride=1)
¶
Write PDB file from file paths.
PARAMETER | DESCRIPTION |
---|---|
file_paths |
Paths of files to load into MDAnalysis.
TYPE:
|
output_path |
Path to save PDB file.
TYPE:
|
selection_str |
Selection string for MDAnalysis universe.
TYPE:
|
structure.pdb.utils.write_in_pdb_line(line, new, start, stop)
¶
General function to write parts of a PDB line.
PARAMETER | DESCRIPTION |
---|---|
line |
PDB line.
TYPE:
|
new |
If
TYPE:
|
start |
Slice the line starting here to replace.
TYPE:
|
stop |
Slice the line stopping here to replace.
TYPE:
|