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) – 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) – Path to the source file.

  • out_file (str) – 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) – Working directory.

  • in_map (str) – Input map filename.

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

reforge.martini.martini_tools.martinize_go(wdir, topdir, aapdb, cgpdb, name='protein', go_eps=9.414, go_low=0.3, go_up=1.1, go_res_dist=3, go_write_file='map/contacts.map', **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.

  • go_write_file (str, optional) – Output file for Go-map. Default is “map/contacts.map”.

  • **kwargs – Additional keyword arguments.

reforge.martini.martini_tools.martinize_en(wdir, aapdb, cgpdb, ef=700, el=0.0, eu=0.9, **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.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.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_nucleotides module

class reforge.martini.martinize_nucleotides.Option(func=<class 'str'>, num=1, default=None, description='')[source]

Bases: object

setvalue(v)[source]
reforge.martini.martinize_nucleotides.help()[source]

Print help text and list of options and end the program.

reforge.martini.martinize_nucleotides.str2atom(a)[source]
reforge.martini.martinize_nucleotides.option_parser(args, options, lists, version=0)[source]
reforge.martini.martinize_nucleotides.spl(x)[source]
reforge.martini.martinize_nucleotides.nsplit(*x)[source]
reforge.martini.martinize_nucleotides.hash(x, y)[source]
reforge.martini.martinize_nucleotides.pat(x, c='.')[source]
reforge.martini.martinize_nucleotides.formatString(i)[source]
reforge.martini.martinize_nucleotides.cos_angle(a, b)[source]
reforge.martini.martinize_nucleotides.norm2(a)[source]
reforge.martini.martinize_nucleotides.norm(a)[source]
reforge.martini.martinize_nucleotides.distance2(a, b)[source]
class reforge.martini.martinize_nucleotides.CoarseGrained[source]

Bases: object

dna_bb = [['P', 'OP1', 'OP2', "O5'", "O3'"], ["C5'", "O4'", "C4'"], ["C3'", "C2'", "C1'"]]
rna_bb = [['P', 'OP1', 'OP2', "O5'", "O3'"], ["C5'", "O4'", "C4'"], ["C3'", "C2'", "O2'", "C1'"]]
residue_bead_names_dna = ['BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8']
residue_bead_names_rna = ['BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8']
names = {'1MG': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), '2MA': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), '2MG': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), '3MP': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), '3MU': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), '4SU': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), '5MC': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), '5MG': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), '5MU': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), '6MA': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), '7MG': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'A': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'C': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'DA': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'DC': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'DG': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'DHU': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'DMA': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'DT': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'G': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'MRA': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'MRC': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'MRG': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'MRU': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'NMC': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'PSU': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'RA3': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'RA5': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'RAP': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'RC3': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'RC5': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'RG3': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'RG5': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'RU3': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'RU5': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'SPA': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8'), 'U': ('BB1', 'BB2', 'BB3', 'SC1', 'SC2', 'SC3', 'SC4', 'SC5', 'SC6', 'SC7', 'SC8')}
mass = {'C': 1, 'H': 1, 'M': 0, 'N': 1, 'O': 1, 'P': 1, 'S': 1}
reforge.martini.martinize_nucleotides.aver(b)[source]
reforge.martini.martinize_nucleotides.map(r, ff)[source]

ff - chosen force field for the mapping

reforge.martini.martinize_nucleotides.mapIndex(r, ff)[source]
reforge.martini.martinize_nucleotides.tt(program)[source]
reforge.martini.martinize_nucleotides.typesub(seq, patterns, types)[source]
reforge.martini.martinize_nucleotides.ssClassification(ss, program='self')[source]
class reforge.martini.martinize_nucleotides.ForceField[source]

Bases: object

static read_itp(itp_file)[source]
static read_itps(mol, directory, version)[source]
static itp_to_indata(itp_data)[source]
bbGetBead(r1, ss='F')[source]
bbGetBond(r, ca, ss)[source]
bbGetAngle(r, ca, ss)[source]
bbGetExclusion(r, ca, ss)[source]
bbGetPair(r, ca, ss)[source]
bbGetDihedral(r, ca, ss)[source]
getCharge(atype, aname)[source]
messages()[source]

Prints any force-field specific logging messages.

update_adenine(mapping, connectivity, itp_params)[source]
update_cytosine(mapping, connectivity, itp_params)[source]
update_guanine(mapping, connectivity, itp_params)[source]
update_uracil(mapping, connectivity, itp_params)[source]
static update_non_standard_mapping(mapping)[source]
class reforge.martini.martinize_nucleotides.martini30nucleic[source]

Bases: ForceField

bb_mapping = [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"]]
mapping = {'1MG': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8', 'H8', 'N9'], ['C4', 'N3'], ['C2', 'N2', 'H21', 'H22'], ['N1'], ['C6', 'O6'], ['C5', 'N7']], '2MA': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N9', 'C8', 'H8'], ['N3', 'C4'], ['N1', 'C2', 'H2'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], '2MG': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8', 'H8', 'N9'], ['C4', 'N3'], ['C2', 'N2', 'H21', 'H22'], ['N1'], ['C6', 'O6'], ['C5', 'N7']], '3MP': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N1', 'C5', 'C6'], ['C2', 'O2'], ['N3'], ['C4', 'O4']], '3MU': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N1', 'C5', 'C6'], ['C2', 'O2'], ['N3'], ['C4', 'O4']], '4SU': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N1', 'C5', 'C6'], ['C2', 'O2'], ['N3'], ['C4', 'O4']], '5MC': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N1', 'C5', 'C6'], ['C2', 'O2'], ['N3'], ['N4', 'C4', 'H41', 'H42']], '5MU': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N1', 'C5', 'C6'], ['C2', 'O2'], ['N3'], ['C4', 'O4']], '6MA': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N9', 'C8', 'H8'], ['N3', 'C4'], ['N1', 'C2', 'H2'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], '7MG': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8', 'H8', 'N9'], ['C4', 'N3'], ['C2', 'N2', 'H21', 'H22'], ['N1'], ['C6', 'O6'], ['C5', 'N7']], 'A': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N9', 'C8', 'H8'], ['N3', 'C4'], ['N1', 'C2', 'H2'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], 'C': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N1', 'C5', 'C6'], ['C2', 'O2'], ['N3'], ['N4', 'C4', 'H41', 'H42']], 'DHA': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N9', 'C8', 'H8'], ['N3', 'C4'], ['N1', 'C2', 'H2'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], 'DHU': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N1', 'C5', 'C6'], ['C2', 'O2'], ['N3'], ['C4', 'O4']], 'DMA': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N9', 'C8', 'H8'], ['N3', 'C4'], ['N1', 'C2', 'H2'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], 'G': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8', 'H8', 'N9'], ['C4', 'N3'], ['C2', 'N2', 'H21', 'H22'], ['N1'], ['C6', 'O6'], ['C5', 'N7']], 'MRC': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N1', 'C5', 'C6'], ['C2', 'O2'], ['N3'], ['N4', 'C4', 'H41', 'H42']], 'MRG': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8', 'H8', 'N9'], ['C4', 'N3'], ['C2', 'N2', 'H21', 'H22'], ['N1'], ['C6', 'O6'], ['C5', 'N7']], 'MRU': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N1', 'C5', 'C6'], ['C2', 'O2'], ['N3'], ['C4', 'O4']], 'NMC': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N1', 'C5', 'C6'], ['C2', 'O2'], ['N3'], ['N4', 'C4', 'H41', 'H42']], 'PSU': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N1', 'C5', 'C6'], ['C2', 'O2'], ['N3'], ['C4', 'O4']], 'RA3': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N9', 'C8', 'H8'], ['N3', 'C4'], ['N1', 'C2', 'H2'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], 'RA5': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N9', 'C8', 'H8'], ['N3', 'C4'], ['N1', 'C2', 'H2'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], 'RAP': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N9', 'C8', 'H8'], ['N3', 'C4'], ['N1', 'C2', 'H2'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], 'RC3': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N1', 'C5', 'C6'], ['C2', 'O2'], ['N3'], ['N4', 'C4', 'H41', 'H42']], 'RC5': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N1', 'C5', 'C6'], ['C2', 'O2'], ['N3'], ['N4', 'C4', 'H41', 'H42']], 'RG3': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8', 'H8', 'N9'], ['C4', 'N3'], ['C2', 'N2', 'H21', 'H22'], ['N1'], ['C6', 'O6'], ['C5', 'N7']], 'RG5': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8', 'H8', 'N9'], ['C4', 'N3'], ['C2', 'N2', 'H21', 'H22'], ['N1'], ['C6', 'O6'], ['C5', 'N7']], 'RU3': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N1', 'C5', 'C6'], ['C2', 'O2'], ['N3'], ['C4', 'O4']], 'RU5': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N1', 'C5', 'C6'], ['C2', 'O2'], ['N3'], ['C4', 'O4']], 'SPA': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N9', 'C8', 'H8'], ['N3', 'C4'], ['N1', 'C2', 'H2'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], 'U': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['N1', 'C5', 'C6'], ['C2', 'O2'], ['N3'], ['C4', 'O4']]}
class reforge.martini.martinize_nucleotides.martini31nucleic[source]

Bases: ForceField

bb_mapping = [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"]]
mapping = {'1MG': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8'], ['C4', 'N3'], ['C2', 'N2', 'H22', 'H21'], ['N1'], ['O6'], ['C5', 'N7'], ['H1'], ['C6']], '2MA': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8'], ['N3', 'C4'], ['C2'], ['N1'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], '2MG': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8'], ['C4', 'N3'], ['C2', 'N2', 'H22', 'H21'], ['N1'], ['O6'], ['C5', 'N7'], ['H1'], ['C6']], '3MP': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C6'], ['O2'], ['N3'], ['O4'], ['C2'], ['H3'], ['C4']], '3MU': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C6'], ['O2'], ['N3'], ['O4'], ['C2'], ['H3'], ['C4']], '4SU': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C6'], ['O2'], ['N3'], ['O4'], ['C2'], ['H3'], ['C4']], '5MC': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C6'], ['O2'], ['N3'], ['N4', 'C4', 'H41', 'H42'], ['C2']], '5MU': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C6'], ['O2'], ['N3'], ['O4'], ['C2'], ['H3'], ['C4']], '6MA': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8'], ['N3', 'C4'], ['C2'], ['N1'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], '7MG': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8'], ['C4', 'N3'], ['C2', 'N2', 'H22', 'H21'], ['N1'], ['O6'], ['C5', 'N7'], ['H1'], ['C6']], 'A': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8'], ['N3', 'C4'], ['C2'], ['N1'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], 'C': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C6'], ['O2'], ['N3'], ['N4', 'C4', 'H41', 'H42'], ['C2']], 'DHA': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8'], ['N3', 'C4'], ['C2'], ['N1'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], 'DHU': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C6'], ['O2'], ['N3'], ['O4'], ['C2'], ['H3'], ['C4']], 'DMA': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8'], ['N3', 'C4'], ['C2'], ['N1'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], 'G': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8'], ['C4', 'N3'], ['C2', 'N2', 'H22', 'H21'], ['N1'], ['O6'], ['C5', 'N7'], ['H1'], ['C6']], 'MRC': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C6'], ['O2'], ['N3'], ['N4', 'C4', 'H41', 'H42'], ['C2']], 'MRG': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8'], ['C4', 'N3'], ['C2', 'N2', 'H22', 'H21'], ['N1'], ['O6'], ['C5', 'N7'], ['H1'], ['C6']], 'MRU': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C6'], ['O2'], ['N3'], ['O4'], ['C2'], ['H3'], ['C4']], 'NMC': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C6'], ['O2'], ['N3'], ['N4', 'C4', 'H41', 'H42'], ['C2']], 'PSU': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C6'], ['O2'], ['N3'], ['O4'], ['C2'], ['H3'], ['C4']], 'RA3': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8'], ['N3', 'C4'], ['C2'], ['N1'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], 'RA5': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8'], ['N3', 'C4'], ['C2'], ['N1'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], 'RAP': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8'], ['N3', 'C4'], ['C2'], ['N1'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], 'RC3': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C6'], ['O2'], ['N3'], ['N4', 'C4', 'H41', 'H42'], ['C2']], 'RC5': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C6'], ['O2'], ['N3'], ['N4', 'C4', 'H41', 'H42'], ['C2']], 'RG3': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8'], ['C4', 'N3'], ['C2', 'N2', 'H22', 'H21'], ['N1'], ['O6'], ['C5', 'N7'], ['H1'], ['C6']], 'RG5': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8'], ['C4', 'N3'], ['C2', 'N2', 'H22', 'H21'], ['N1'], ['O6'], ['C5', 'N7'], ['H1'], ['C6']], 'RU3': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C6'], ['O2'], ['N3'], ['O4'], ['C2'], ['H3'], ['C4']], 'RU5': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C6'], ['O2'], ['N3'], ['O4'], ['C2'], ['H3'], ['C4']], 'SPA': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C8'], ['N3', 'C4'], ['C2'], ['N1'], ['N6', 'C6', 'H61', 'H62'], ['N7', 'C5']], 'U': [['P', 'OP1', 'OP2', "O5'", "O3'", 'O1P', 'O2P'], ["C5'", "1H5'", "2H5'", "H5'", "H5''", "C4'", "H4'", "O4'", "C3'", "H3'"], ["C1'", "C2'", "O2'", "O4'"], ['C6'], ['O2'], ['N3'], ['O4'], ['C2'], ['H3'], ['C4']]}
reforge.martini.martinize_nucleotides.decayFunction(distance, shift, rate, power)[source]
reforge.martini.martinize_nucleotides.rubberBands(atomList, lowerBound, upperBound, decayFactor, decayPower, forceConstant, minimumForce)[source]
reforge.martini.martinize_nucleotides.pdbBoxString(box)[source]
reforge.martini.martinize_nucleotides.pdbAtom(a)[source]
reforge.martini.martinize_nucleotides.pdbOut(atom, i=1)[source]
reforge.martini.martinize_nucleotides.isPdbAtom(a)[source]
reforge.martini.martinize_nucleotides.pdbBoxRead(a)[source]
reforge.martini.martinize_nucleotides.pdbChains(pdbAtomList)[source]
reforge.martini.martinize_nucleotides.pdbFrameIterator(streamIterator)[source]
reforge.martini.martinize_nucleotides.getChargeType(resname, resid, choices)[source]

Get user input for the charge of residues, based on list with choises.

reforge.martini.martinize_nucleotides.streamTag(stream)[source]
class reforge.martini.martinize_nucleotides.Residue(iterable=(), /)[source]

Bases: list

reforge.martini.martinize_nucleotides.residues(atomList)[source]
reforge.martini.martinize_nucleotides.residueDistance2(r1, r2)[source]
reforge.martini.martinize_nucleotides.breaks(residuelist, selection=('P', "C2'", "C3'", "O3'", "C4'", "C5'", "O5'"), cutoff=3.0)[source]
reforge.martini.martinize_nucleotides.contacts(atoms, cutoff=5)[source]
reforge.martini.martinize_nucleotides.add_dummy(beads, dist=0.11, n=2)[source]
reforge.martini.martinize_nucleotides.check_merge(chains, m_list=[], l_list=[], ss_cutoff=0)[source]
class reforge.martini.martinize_nucleotides.Chain(options, residuelist=[], name=None, multiscale=False)[source]

Bases: object

atoms()[source]
split()[source]
getname(basename=None)[source]
set_ss(ss, source='self')[source]
dss(method=None, executable=None)[source]
type(other=None)[source]
cg(force=False, com=False, dna=False)[source]
conect()[source]
class reforge.martini.martinize_nucleotides.Bonded(other=None, options=None, **kwargs)[source]

Bases: object

set(atoms, **kwargs)[source]
class reforge.martini.martinize_nucleotides.Bond(other=None, options=None, **kwargs)[source]

Bases: Bonded

set(atoms, **kwargs)[source]
class reforge.martini.martinize_nucleotides.Angle(other=None, options=None, **kwargs)[source]

Bases: Bonded

set(atoms, **kwargs)[source]
class reforge.martini.martinize_nucleotides.Vsite(other=None, options=None, **kwargs)[source]

Bases: Bonded

set(atoms, **kwargs)[source]
class reforge.martini.martinize_nucleotides.Exclusion(other=None, options=None, **kwargs)[source]

Bases: Bonded

set(atoms, **kwargs)[source]
class reforge.martini.martinize_nucleotides.Pair(other=None, options=None, **kwargs)[source]

Bases: Bonded

set(atoms, **kwargs)[source]
class reforge.martini.martinize_nucleotides.Dihedral(other=None, options=None, **kwargs)[source]

Bases: Bonded

set(atoms, **kwargs)[source]
class reforge.martini.martinize_nucleotides.CategorizedList(iterable=(), /)[source]

Bases: list

class reforge.martini.martinize_nucleotides.Topology(other=None, options=None, name='')[source]

Bases: object

fromNucleicAcidSequence(sequence, secstruc=None, links=None, breaks=None, mapping=None, rubber=False, multi=False)[source]
fromMoleculeList(other)[source]
reforge.martini.martinize_nucleotides.main(options)[source]

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.

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

Parse command-line arguments for RNA coarse-graining.

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.

Module contents