Coverage for biobb_mem/gorder/gorder_aa.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 all atom 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 GorderAA(GorderBase): 

10 """ 

11 | biobb_mem GorderAA 

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

13 | `gorder <https://ladme.github.io/gorder-manual/aaorder_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/A01IP/A01IP.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/A01IP/A01IP.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_aa.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 * **heavy_atoms** (*str*) - ("@membrane and name r'C3.+|C2.+'") Selection query specifying the heavy atoms to be used in the analysis (typically carbon atoms in lipid tails). 

21 * **hydrogens** (*str*) - ("@membrane and element name hydrogen") Selection query specifiying the hydrogen atoms to be used in the analysis (only those bonded to heavy atoms will be considered). 

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

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

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

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

26 

27 Examples: 

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

29 

30 from biobb_mem.gorder.gorder_aa import gorder_aa 

31 prop = { 

32 'handle_pbc': False 

33 } 

34 gorder_aa(input_top_path='/path/to/myTopology.tpr', 

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

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

37 properties=prop) 

38 

39 Info: 

40 * wrapped_software: 

41 * name: gorder 

42 * version: 1.1.0 

43 * license: MIT 

44 * ontology: 

45 * name: EDAM 

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

47 

48 """ 

49 

50 def __init__(self, 

51 input_top_path: str, 

52 input_traj_path: str, 

53 output_order_path: str, 

54 properties: dict | None = None, 

55 **kwargs) -> None: 

56 super().__init__(**locals()) 

57 

58 def analysis_type(self) -> "gorder.analysis_types.AAOrder": 

59 """Go from the heavy_atoms and hydrogens to the atomistic analysis type of gorder.""" 

60 return gorder.analysis_types.AAOrder(self.heavy_atoms, self.hydrogens) 

61 

62 

63gorder_aa = launcher(GorderAA) 

64 

65if __name__ == '__main__': 

66 GorderAA.main()