Coverage for biobb_pdb_tools/pdb_tools/biobb_pdb_selres.py: 90%
10 statements
« prev ^ index » next coverage.py v7.18.0, created at 2026-12-03 15:44 +0000
« prev ^ index » next coverage.py v7.18.0, created at 2026-12-03 15:44 +0000
1#!/usr/bin/env python3
3"""Module containing the Pdbselres class and the command line interface."""
5from typing import Optional
6from biobb_common.generic.biobb_object import launcher
7from biobb_pdb_tools.pdb_tools.common import PdbToolsBase
10class Pdbselres(PdbToolsBase):
11 """
12 | biobb_pdb_tools Pdbselres
13 | Selects residues by their index, piecewise or in a range.
14 | Works by selecting residues based on their index. Can select individual residues, a range of residues, or residues at regular intervals.
16 Args:
17 input_file_path (str): Input PDB file. File type: input. `Sample file <https://raw.githubusercontent.com/bioexcel/biobb_pdb_tools/master/biobb_pdb_tools/test/data/pdb_tools/1IGY.pdb>`_. Accepted formats: pdb (edam:format_1476).
18 output_file_path (str): PDB file with selected residues. File type: output. `Sample file <https://raw.githubusercontent.com/bioexcel/biobb_pdb_tools/master/biobb_pdb_tools/test/reference/pdb_tools/ref_pdb_selres.pdb>`_. Accepted formats: pdb (edam:format_1476).
19 properties (dic):
20 * **selection** (*string*) - (None) Residue selection format: individual residues "1,2,4,6", range "1:10", multiple ranges "1:10,20:30", open ranges "1:", ":5", or intervals "::5", "1:10:5".
21 * **binary_path** (*str*) - ("pdb_selres") Path to the pdb_selres executable binary.
22 * **remove_tmp** (*bool*) - (True) [WF property] Remove temporal files.
23 * **restart** (*bool*) - (False) [WF property] Do not execute if output files exist.
25 Examples:
26 This is a use example of how to use the building block from Python::
28 from biobb_pdb_tools.pdb_tools.biobb_pdb_selres import biobb_pdb_selres
30 prop = {
31 'selection': '1:20:2'
32 }
33 biobb_pdb_selres(input_file_path='/path/to/input.pdb',
34 output_file_path='/path/to/output.pdb',
35 properties=prop)
37 Info:
38 * wrapped_software:
39 * name: pdb_tools
40 * version: >=2.5.0
41 * license: Apache-2.0
42 * ontology:
43 * name: EDAM
44 * schema: http://edamontology.org/EDAM.owl
46 """
48 option_property = "selection"
50 def __init__(
51 self, input_file_path: str, output_file_path: str, properties: Optional[dict] = None, **kwargs
52 ) -> None:
53 super().__init__(**locals())
56biobb_pdb_selres = launcher(Pdbselres)
58if __name__ == "__main__":
59 Pdbselres.main()