Coverage for biobb_pdb_tools/pdb_tools/biobb_pdb_keepcoord.py: 89%

9 statements  

« prev     ^ index     » next       coverage.py v7.18.0, created at 2026-12-03 15:44 +0000

1#!/usr/bin/env python3 

2 

3"""Module containing the Pdbkeepcoord class and the command line interface.""" 

4 

5from typing import Optional 

6from biobb_common.generic.biobb_object import launcher 

7from biobb_pdb_tools.pdb_tools.common import PdbToolsBase 

8 

9 

10class Pdbkeepcoord(PdbToolsBase): 

11 """ 

12 | biobb_pdb_tools Pdbkeepcoord 

13 | Removes all non-coordinate records from the file. 

14 | Keeps only MODEL, ENDMDL, END, ATOM, HETATM, CONECT records from a PDB file. 

15 

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 only coordinate records. File type: output. `Sample file <https://raw.githubusercontent.com/bioexcel/biobb_pdb_tools/master/biobb_pdb_tools/test/reference/pdb_tools/ref_pdb_keepcoord.pdb>`_. Accepted formats: pdb (edam:format_1476). 

19 properties (dic): 

20 * **binary_path** (*str*) - ("pdb_keepcoord") Path to the pdb_keepcoord 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. 

23 

24 Examples: 

25 This is a use example of how to use the building block from Python:: 

26 

27 from biobb_pdb_tools.pdb_tools.biobb_pdb_keepcoord import biobb_pdb_keepcoord 

28 

29 # Keep only coordinate records 

30 biobb_pdb_keepcoord(input_file_path='/path/to/input.pdb', 

31 output_file_path='/path/to/output.pdb') 

32 

33 Info: 

34 * wrapped_software: 

35 * name: pdb_tools 

36 * version: >=2.5.0 

37 * license: Apache-2.0 

38 * ontology: 

39 * name: EDAM 

40 * schema: http://edamontology.org/EDAM.owl 

41 

42 """ 

43 

44 def __init__( 

45 self, input_file_path: str, output_file_path: str, properties: Optional[dict] = None, **kwargs 

46 ) -> None: 

47 super().__init__(**locals()) 

48 

49 

50biobb_pdb_keepcoord = launcher(Pdbkeepcoord) 

51 

52if __name__ == "__main__": 

53 Pdbkeepcoord.main()