Coverage for biobb_mem/gorder/gorder_cg.py: 91%

11 statements  

« prev     ^ index     » next       coverage.py v7.18.0, created at 2026-11-30 14:15 +0000

1#!/usr/bin/env python3 

2 

3"""Module containing the gorder coarse-grained class and the command line interface.""" 

4from biobb_common.generic.biobb_object import launcher 

5from biobb_mem.gorder.common import GorderBase 

6import gorder 

7 

8 

9class GorderCG(GorderBase): 

10 """ 

11 | biobb_mem GorderCG 

12 | Wrapper of the gorder coarse-grained module for computing lipid order parameters per atom for carbon tails. 

13 | `gorder <https://ladme.github.io/gorder-manual/cgorder_basics.html>`_ uses `GSL <https://ladme.github.io/gsl-guide/>`_ for all its selections. 

14 

15 Args: 

16 input_top_path (str): Path to the input structure or topology file. File type: input. `Sample file <https://github.com/bioexcel/biobb_mem/raw/main/biobb_mem/test/data/CG/cg_test.tpr>`_. Accepted formats: tpr (edam:format_2333). 

17 input_traj_path (str): Path to the input trajectory to be processed. File type: input. `Sample file <https://github.com/bioexcel/biobb_mem/raw/main/biobb_mem/test/data/CG/cg_test.xtc>`_. Accepted formats: xtc (edam:format_3875), trr (edam:format_3910), gro (edam:format_2033). 

18 output_order_path (str): Path to results of the order analysis. File type: output. `Sample file <https://github.com/bioexcel/biobb_mem/raw/main/biobb_mem/test/reference/gorder/order_cg.yaml>`_. Accepted formats: yaml (edam:format_3570), xvg (edam:format_2330), csv (edam:format_3752). 

19 properties (dic - Python dictionary object containing the tool parameters, not input/output files): 

20 * **beads** (*str*) - ("@membrane") Selection query specifying the beads to be used in the analysis. 

21 * **handle_pbc** (*bool*) - (True) If False, ignores periodic boundary conditions (PBC). 

22 * **remove_tmp** (*bool*) - (True) [WF property] Remove temporal files. 

23 * **restart** (*bool*) - (False) [WF property] Do not execute if output files exist. 

24 * **sandbox_path** (*str*) - ("./") [WF property] Parent path to the sandbox directory. 

25 

26 Examples: 

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

28 

29 from biobb_mem.gorder.gorder_cg import gorder_cg 

30 prop = { 

31 'handle_pbc': False 

32 } 

33 gorder_cg(input_top_path='/path/to/myTopology.tpr', 

34 input_traj_path='/path/to/myTrajectory.xtc', 

35 output_order_path='/path/to/orderAnalysis.yaml', 

36 properties=prop) 

37 

38 Info: 

39 * wrapped_software: 

40 * name: gorder 

41 * version: 1.1.0 

42 * license: MIT 

43 * ontology: 

44 * name: EDAM 

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

46 

47 """ 

48 

49 def __init__(self, 

50 input_top_path: str, 

51 input_traj_path: str, 

52 output_order_path: str, 

53 properties: dict | None = None, 

54 **kwargs) -> None: 

55 super().__init__(**locals()) 

56 

57 def analysis_type(self) -> "gorder.analysis_types.CGOrder": 

58 """Go from the beads to the coarse-grained analysis type of gorder.""" 

59 return gorder.analysis_types.CGOrder(self.beads) 

60 

61 

62gorder_cg = launcher(GorderCG) 

63 

64if __name__ == '__main__': 

65 GorderCG.main()