Coverage for biobb_pdb_tools/pdb_tools/biobb_pdb_chainxseg.py: 89%
9 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 Chainxseg 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 Chainxseg(PdbToolsBase):
11 """
12 | biobb_pdb_tools Pdbtidy
13 | Swaps the segment identifier for the chain identifier.
14 | This tool swaps the segment identifier for the chain identifier in a PDB file. It can be used to change the segment identifier of a PDB file or to remove the segment identifier from a PDB file.
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/1AKI.pdb>`_. Accepted formats: pdb (edam:format_1476).
18 output_file_path (str): PDB file with exchanged segment and string identifier. File type: output. `Sample file <https://raw.githubusercontent.com/bioexcel/biobb_pdb_tools/master/biobb_pdb_tools/test/reference/pdb_tools/ref_pdb_chainxseg.pdb>`_. Accepted formats: pdb (edam:format_1476).
19 properties (dic):
20 * **binary_path** (*str*) - ("pdb_chainxseg") Path to the pdb_chainxseg executable binary.
21 * **remove_tmp** (*bool*) - (True) [WF property] Remove temporal files.
22 * **restart** (*bool*) - (False) [WF property] Do not execute if output files exist.
24 Examples:
25 This is a use example of how to use the building block from Python::
27 from biobb_pdb_tools.pdb_tools.biobb_pdb_chainxseg import biobb_pdb_chainxseg
29 biobb_pdb_chainxseg(input_file_path='/path/to/input.pdb',
30 output_file_path='/path/to/output.pdb')
32 Info:
33 * wrapped_software:
34 * name: pdb_tools
35 * version: >=2.5.0
36 * license: Apache-2.0
37 * ontology:
38 * name: EDAM
39 * schema: http://edamontology.org/EDAM.owl
41 """
43 def __init__(
44 self, input_file_path: str, output_file_path: str, properties: Optional[dict] = None, **kwargs
45 ) -> None:
46 super().__init__(**locals())
49biobb_pdb_chainxseg = launcher(Chainxseg)
51if __name__ == "__main__":
52 Chainxseg.main()