Skip to content

Commit

Permalink
edits for documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
NDoering99 committed Sep 30, 2024
1 parent de2f11e commit 96454e9
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/mdpath_classes/mdpath.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.. automodule:: mdpath.mdpath
:members:
:functions:
:undoc-members:
:show-inheritance:
:noindex: # Avoid indexing this module in the API section
1 change: 1 addition & 0 deletions docs/mdpath_classes/mdpath_tools.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.. automodule:: mdpath.mdpath_tools
:members:
:functions:
:undoc-members:
:show-inheritance:
:noindex: # Avoid indexing this module in the API section
17 changes: 17 additions & 0 deletions mdpath/mdpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
This is the main script of MDPath. It is used to run MDPath from the command line.
MDPath can be called from the comadline using 'mdapth' after instalation
Use the -h flag to see the available options.
Functions
----------
"""

import os
Expand All @@ -35,6 +38,20 @@


def main():
"""Main function for running MDPath from the command line.
It can be called using 'mdpath' after installation.
Command-line inputs:
-top: Topology file of your MD simulation
-traj: Trajectory file of your MD simulation
-cpu: Amount of cores used in multiprocessing (default: half of available cores)
-lig: Protein ligand interacting residues (default: False)
-bs: How often bootstrapping should be performed (default: False)
-fardist: Default distance for faraway residues (default: 12.0)
-closedist: Default distance for close residues (default: 12.0)
-graphdist: Default distance for residues making up the graph (default: 5.0)
-numpath: Default number of top paths considered for clustering (default: 500).
"""
parser = argparse.ArgumentParser(
prog="mdpath",
description="Calculate signal transduction paths in your MD trajectories",
Expand Down
86 changes: 84 additions & 2 deletions mdpath/mdpath_tools.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
"""MDPath Tools
=============================
This module contains the command-line interface (CLI) functions for editing and visualizing the results of MDPath analysis.
All functions can be called from the command line after installation of the package.
Functions
-----------
"""

import os
import argparse
import pandas as pd
Expand All @@ -15,6 +24,28 @@


def edit_3D_visualization_json():
"""Edit the 3D visualization JSONS to your visualization needs from the command line.
This function provides a command-line interface (CLI) for editing 3D visualization JSON files.
It supports various operations such as recoloring, scaling, and flatting the radius of the entries in the JSON file.
It cann be called using 'mdpath_json_editor' after installation.
Command-line inputs:
-json (str): The path to the JSON file to edit for 3D visualization.
-scale (float): The factor to multiply the radius of path cylinders with.
-recolor (str): The path to the color file for 3D visualization colors.
-flat (float): Sets every radius of path cylinders to the input value.
-clusterscale (float): The maximum radius for the cluster-based scaling.
Note: Only one operation can be performed at a time. If multiple operations are specified, an error will be displayed.
Command-line usage:
$ mdpath_json_editor -json <path_to_json_file> -scale <scaling_factor_float>
$ mdpath_json_editor -json <path_to_json_file> -recolor <path_to_color_json_file>
$ mdpath_json_editor -json <path_to_json_file> -flat <flat_radius_value_float>
$ mdpath_json_editor -json <path_to_json_file> -clusterscale <scaling_factor_float>
"""

parser = argparse.ArgumentParser(
prog="mdpath_json_edit",
description="Edit the 3D visualization JSONS to your visualization needs.",
Expand Down Expand Up @@ -157,6 +188,20 @@ def edit_3D_visualization_json():


def path_comparison():
"""Compare Pathways of different simulations.
This function provides a command-line interface (CLI) for morphing the 3d visualization of a simulation to fit ontop of the coordinates of another simulatuion.
This enables easy comparison of the pathways of different simulations.
It cann be called using 'mdpath_compare' after installation.
Command-line inputs:
- atop: The path to the file containing the residue coordinates that are used as a template.
- bcluster: The path to the file containing the cluster that is morphed ontop.
Command-line usage:
$ mdpath_compare -atop <path_to_atop_file> -bcluster <path_to_bcluster_file>
"""
parser = argparse.ArgumentParser(
prog="mdpath_compare",
description="Compare Pathways of different simulations",
Expand Down Expand Up @@ -195,6 +240,24 @@ def path_comparison():


def multitraj_analysis():
"""
Merge and analyze multiple trajectories.
This function provides a command-line interface (CLI) for merging and analyzing multiple trajectories.
It requires the topology file of the MD simulation and a list of multiple pathways from previous analysis.
The function calculates various properties of the merged pathways, clusters them, and saves the results in JSON files.
It cann be called using 'mdpath_multitraj' after installation.
Command-line inputs:
-top: Topology file of your MD simulation.
-multitraj: List of multiple pathways from previous analysis.
-cpu: Amount of cores used in multiprocessing.
-closedist: Default distance for close residues.
Command-line usage:
$ mdpath_multitraj -top <path_to_topology_file> -multitraj <path_to_multitraj_file> -cpu <number_of_cores> -closedist <default_distance>
"""
parser = argparse.ArgumentParser(
prog="mdpath_multitraj",
description="Merge and analyze multiple trajectories.",
Expand Down Expand Up @@ -276,9 +339,28 @@ def multitraj_analysis():


def gpcr_2D_vis():
"""
Create a 2D Visualization of Paths through a GPCR using the Ballesteros-Weinstein-System for numbering(querries gpcrdb.org for numbering).
This function provides a command-line interface (CLI) for creating a 2D visualization of paths through a GPCR.
It queries gpcrdb.org for the Ballesteros-Weinstein-System numbering and assigns generic numbers to the protein atoms.
Then a 2D visualization of the GPCR paths is created based on the updated cluster pathways and the specified cutoff percentage.
Command-line inputs:
-top: Topology file of your MD simulation
-clust: Pickle file with cluster pathways dictionary
-cut: Percentage of the top paths to visualize (default is 0 = all paths are drawn)
-num: Path to write the numbered structure file to (default is "./numbered_structure.pdb")
Note: This function requires access to the internet to query gpcrdb.org for the Ballesteros-Weinstein-System numbering.
Example usage:
$ mdpath_gpcr_image -top <path_to_topology_file> -clust <path_to_cluster_pathways.pickl> -cut <cutoff_float> -num <path_where_to_save_numberd_structure>
"""
parser = argparse.ArgumentParser(
prog="mdpath_gpcr",
description="Create a 2D Visualization of Paths throught a GPCR.",
description="Create a 2D Visualization of Paths through a GPCR.",
formatter_class=argparse.RawTextHelpFormatter,
)
parser.add_argument(
Expand All @@ -290,7 +372,7 @@ def gpcr_2D_vis():
parser.add_argument(
"-clust",
dest="cluster_pathways",
help="Picle file with cluster pathways dict.",
help="Pickle file with cluster pathways dict.",
required=True,
)
parser.add_argument(
Expand Down

0 comments on commit 96454e9

Please sign in to comment.