reforge.martini package

Submodules

reforge.martini.getgo module

Gets contact maps for Go-Martini from RCSU server

Description:

This module automates the download and extraction of Go maps from http://info.ifpan.edu.pl/~rcsu/rcsu/index.html using Selenium and various WebDriver managers. It checks for installed browsers, installs the appropriate WebDriver if needed, and then processes a list of PDB files.

Author: DY

reforge.martini.getgo.parse_arguments()[source]

Parse command-line arguments.

reforge.martini.getgo.check_browser(browser_name, command)[source]

Check if a browser is installed by looking for its executable command.

reforge.martini.getgo.check_debian_package(package_name)[source]

Check if a Debian package is installed.

reforge.martini.getgo.install_webdriver(browser_name)[source]

Install the WebDriver for the specified browser.

reforge.martini.getgo.check_browsers()[source]

Check for installed browsers and log their status.

reforge.martini.getgo.check_geckodriver_installed()[source]

Check if geckodriver is installed by running ‘–version’.

reforge.martini.getgo.init_webdriver(download_dir)[source]

Initialize the Firefox WebDriver with download preferences.

Args:

download_dir (str): Directory to download files to.

Returns:

webdriver.Firefox: The initialized Firefox WebDriver.

reforge.martini.getgo.get_go_maps(driver, pdb_files)[source]

Use Selenium to automate downloading Go maps from the server.

Args:

driver: Selenium WebDriver. pdb_files (list): List of PDB file paths.

reforge.martini.getgo.extract_go_maps(wdir)[source]

Extract downloaded Go maps from tar.gz files and organize them.

Args:

wdir (str): Working directory containing the downloads.

reforge.martini.getgo.get_go(wdir, path_to_pdbs)[source]

Check for browsers, initialize the WebDriver, download, and extract Go maps.

Args:

wdir (str): Working directory for downloads. path_to_pdbs (list): List of PDB file paths to process.

reforge.martini.martini_tools module

Module for Martini simulation tools.

This module provides tools for preparing Martini simulations, such as topology file generation, linking itp files, processing PDB files with GROMACS, and running various martinize2 routines. Note that this module is intended for internal use.

reforge.martini.martini_tools.dssp(in_file)[source]

Compute the DSSP secondary structure for the given PDB file.

Parameters:

in_file (str or Path) – Path to the PDB file.

Returns:

Secondary structure string with ‘-’ replaced by ‘C’.

Return type:

str

reforge.martini.martini_tools.append_to(in_file, out_file)[source]

Append the contents of in_file (excluding the first line) to out_file.

Parameters:
  • in_file (str or Path) – Path to the source file.

  • out_file (str or Path) – Path to the destination file.

reforge.martini.martini_tools.fix_go_map(wdir, in_map, out_map='go.map')[source]

Fix the Go-map file by removing the last column from lines that start with ‘R ‘.

Parameters:
  • wdir (str or Path) – Working directory.

  • in_map (str or Path) – Input map filename.

  • out_map (str or Path, optional) – Output map filename. Default is “go.map”.

reforge.martini.martini_tools.run_martinize_go(wdir, topdir, aapdb, cgpdb, name='protein', go_eps=9.414, go_low=0.3, go_up=1.1, go_res_dist=3, from_ff='amber', **kwargs)[source]

Run virtual site-based GoMartini via martinize2.

Parameters:
  • wdir (str) – Working directory.

  • topdir (str) – Topology directory.

  • aapdb (str) – Input all-atom PDB file.

  • cgpdb (str) – Coarse-grained PDB file.

  • name (str, optional) – Protein name. Default is “protein”.

  • go_eps (float, optional) – Strength of the Go-model bias. Default is 9.414.

  • go_low (float, optional) – Lower distance cutoff (nm). Default is 0.3.

  • go_up (float, optional) – Upper distance cutoff (nm). Default is 1.1.

  • go_res_dist (int, optional) – Minimum residue distance below which contacts are removed. Default is 3.

  • **kwargs – Additional keyword arguments.

reforge.martini.martini_tools.run_martinize_en(wdir, aapdb, cgpdb, ef=700, el=0.0, eu=0.9, from_ff='amber', **kwargs)[source]

Run protein elastic network generation via martinize2.

Parameters:
  • wdir (str) – Working directory.

  • aapdb (str) – Input all-atom PDB file.

  • cgpdb (str) – Coarse-grained PDB file.

  • ef (float, optional) – Force constant. Default is 700.

  • el (float, optional) – Lower cutoff. Default is 0.0.

  • eu (float, optional) – Upper cutoff. Default is 0.9.

  • **kwargs – Additional keyword arguments.

reforge.martini.martini_tools.run_martinize_nucleotide(wdir, aapdb, cgpdb, **kwargs)[source]

Run nucleotide coarse-graining using martinize_nucleotides.

Parameters:
  • wdir (str) – Working directory.

  • aapdb (str) – Input all-atom PDB file.

  • cgpdb (str) – Coarse-grained PDB file.

  • **kwargs – Additional parameters.

reforge.martini.martini_tools.run_martinize_rna(wdir, **kwargs)[source]

Run RNA coarse-graining using martinize_rna.

Parameters:
  • wdir (str) – Working directory.

  • **kwargs – Additional parameters.

reforge.martini.martini_tools.insert_membrane(**kwargs)[source]

Insert a membrane using the insane tool.

reforge.martini.martinize_rna module

Usage: python martinize_rna.py -f ssRNA.pdb -mol rna -elastic yes -ef 100 -el 0.5 -eu 1.2 -os molecule.pdb -ot molecule.itp

This script processes an all-atom RNA structure and returns coarse-grained topology in the GROMACS’ .itp format and coarse-grained PDB. It parses command-line arguments, processes each chain of the input PDB, maps them to coarse-grained representations, merges the resulting topologies, optionally applies an elastic network, and writes the output ITP file.

Please cite: Yangaliev D, Ozkan SB. Coarse-grained RNA model for the Martini 3 force field. Biophys J. 2025 Aug 5:S0006-3495(25)00483-7. doi: 10.1016/j.bpj.2025.07.034.

reforge.martini.martinize_rna.martinize_rna(f, ot='molecule.itp', os='molecule.pdb', ff='reg', mol='molecule', merge='yes', elastic='yes', ef=200, el=0.3, eu=1.2, p='backbone', pf=1000, debug=False)[source]

Main martinization function that can be imported and used programmatically.

Converts an all-atom RNA structure to coarse-grained Martini representation: 1. Parse all-atom PDB structure 2. Map to coarse-grained beads using Martini 3.0 RNA force field 3. Generate topology with bonded interactions 4. Optionally add elastic network for structural stability 5. Write coarse-grained structure and topology files

Parameters:

fstr

Path to input all-atom RNA structure PDB file

otstr, optional

Output topology file path (default: ‘molecule.itp’)

osstr, optional

Output CG structure file path (default: ‘molecule.pdb’)

ffstr, optional

Force field variant: ‘reg’ for regular (default: ‘reg’)

molstr, optional

Molecule name in topology file (default: ‘molecule’)

mergestr, optional

Merge separate chains if detected: ‘yes’/’no’ (default: ‘yes’)

elasticstr, optional

Add elastic network: ‘yes’/’no’ (default: ‘yes’)

effloat, optional

Elastic network force constant in kJ/mol/nm² (default: 200)

elfloat, optional

Elastic network lower cutoff in nm (default: 0.3)

eufloat, optional

Elastic network upper cutoff in nm (default: 1.2)

pstr, optional

Position restraints: ‘no’/’backbone’/’all’ (default: ‘backbone’)

pffloat, optional

Position restraint force constant in kJ/mol/nm² (default: 1000)

debugbool, optional

Enable debug logging (default: False)

Returns:

tuple(str, str)

Paths to generated structure and topology files

reforge.martini.martinize_rna.process_chain(_chain, _ff, _start_idx, _mol_name)[source]

Process an individual RNA chain: map it to coarse-grained representation and generate a topology.

Args:

chain (iterable): An RNA chain from the parsed system. ff: Force field object. start_idx (int): Starting atom index for mapping. mol_name (str): Molecule name.

Returns:

tuple: (cg_atoms, chain_topology)

reforge.martini.martinize_rna.merge_topologies(top_list)[source]

Merge multiple Topology objects into one.

Args:

top_list (list): List of Topology objects.

Returns:

Topology: The merged Topology.

reforge.martini.martinize_rna.main()[source]

Command-line interface for RNA martinization.

Module contents