episol package

Submodules

episol.basic_tests module

episol.epipy module

class episol.epipy.epipy(solute_structure, solute_topology, to_gro=False, gen_idc=False, convert=False, recenter=False, box_size=[10, 10, 10])[source]

Bases: object

static UC(closure)[source]

Function to get universal correction (UC) based on the closure used for RISM calculation. —————————- function returns a dictionaryy containing both the FEP and experimental correction constants ‘A’ and ‘B’ in the equation: delta G^{solv} = mu^{ex}+’A’*V_m+’B’, where V_m is partial molar volume from the free energy universal correction proposed by: David S Palmer, Andrey I Frolov, Ekaterina L Ratkova and Maxim V Fedorov http://dx.doi.org/10.1088/0953-8984/22/49/492101

dump(file_name='', out_name=False, list_values=False, value_to_extract=1)[source]

Extracts the compressed .ts4s file and writes to a txt file

file_name :: dump file to read out_name :: extract files to this txt file list_values :: return list of saved values value_to_extract :: given the list of values select index to extract

err(log_file_name=None)[source]

This function reads a log file and returns the SCF stdev in an array ======================== log_file_name :: string, name of .log file ======================== Returns out_arr :: np.array() with shape (1, # steps) array index represents the SCF step

extract_grid(input_file, sele='guv', out_name='out')[source]

This function extracts calc. data from the dump file by searching for the value corresponding to the selection string This way you dont need to list values to extract them

Parameters:
  • input_file (str)

  • sele (str)

  • out_name (str)

free_energy(conv='kj/mol', fit_value='EXP')[source]

Return the free energy of the most recent calculation according to the 3DRISM object ==================== fit_value: string, energy value to return options: EXP : experimental fitting FEP : free energy of pertubation fitting ==================== conv: sting expression default output unit is in !!!! in KJ/mol !!!! can specify what units you want to convert to by specifying the expression. Function will return the value based on original unit convversion e.g “kcal” resolves to taking original free energy value in Kj/mol and multipying it by (1/Kj)*(2kcal)*1mol to convert to kcal ———– keyword Options: ———– kcal, mol , kj, j , joule ——— all other standard math symbols allowed ———–

delta G^{solv} = mu^{ex}+’A’*V_m+’B’, where V_m is partial molar volume

Parameters:
  • conv (str)

  • fit_value (str)

get_help(search_str)[source]

searches episol by calling –help from the CLI

search_str :: string to search for

Parameters:

search_str (str)

get_version()[source]

returns the version by simply calling episol kernel from the command line

kernel(nt=1, v=1)[source]

v :: int(), verbose rating nt :: int(), number of threads to use

placement(num_waters_to_place, radius=1.9269073728633292, filename=False, grid_spacing=None, write_pdb=False, outname='out.pdb', weight=None)[source]
Parameters:

num_waters_to_place (int)

reader(file_in, laplacian=False, LoG=False, convolve=False, sigma=1.52, file_out='out', dx=False)[source]

This function takes in an uncompressed dump file txt file it reads the grid size and shape If specified we can save/export to a dx file which can be loaded into pymol/vmd/etc. ================================= file_in :: the decompress txt file from our ts4s dump command grid_spacing :: [x,y,z] values for delta grid, e.g. grid spacing of 0.5A would have grid_spacing = [0.5,0.5,0.5] ———- IF DX=TRUE ————— file_out :: filename for saved dx file ################# WARNINGS ################ since the dx file was made by IBM in the 90s many nont-so-modern softwares will struggle to read dx files with comments and it appears many follow their own format specifications

Parameters:
  • file_in (str)

  • laplacian (bool)

  • LoG (bool)

  • convolve (bool)

  • sigma (float)

  • file_out (str)

report(out_file_name, args='all')[source]

function specifies the name of the .log file and which params to write out into it file name can be specified with self.log as well ================================================ out_file :: name for .log file **args :: command save strings

Parameters:

out_file_name (str)

rism(step=500, resolution=1, args='all')[source]

Sets the steps and resolution of the calculation. Will automatically set number of grids based on the box dimensions acquired from self.solute() ======================================================= step :: int(), Number of SCF steps to perform resolution :: int(), grid resolution of box (will override if previously set) args :: string(), values to save to the dump file; options below: ++++++++++++++++++++++++++ SAVE ARGS ++++++++++++++++++++++++++ all : reports all of the below command : save the exact command that was run when the file was produced guv : g(r) foreach grid point ld : smoothed g(r) i.e. g(r) convolved with kernel coul : coulombic potential at each grid excess : mu^ex at each grid

select_around(rism_grid, in_coords, around=5.0)[source]
select_coords(in_file, sele, atom_sele=None, conv_fact=10)[source]

in_file: .gro file sele: selection string -> resname only so far returns:

Parameters:
  • in_file (str)

  • sele (str)

  • atom_sele (str)

  • conv_fact (int)

select_grid(input_string='guv', coord_array=None)[source]

select values in array based on the selection input string

so far selection string is limited to selection of grid-values around single residue names only: i.e. around 4 resname LYS But we reccommend using the coordinate array input for more in-depth selections :::::: in the future the selection commands will be updated :::::: ================================================== input_string : value to select and extract - default value is guv (atomic density) if a selection is made value is passed to -> self.get_coords -> self.extract else -> self.extract ================================================== selection string can include the following key-words any output value from 3DRISM, i.e ‘guv’, ‘uuv’ or ‘coul’ etc. etc. around ‘distance’ :: select grid values around coordinates within specified distance (in Angstrom) get :: get the exact grid value on the input coordinates (i.e. resname or coord_array) resname :: any 3-letter cannonical residue name, upper or lower case ‘laplace’ or ‘laplacian’ or ‘lap’ or ‘grad’ or ‘gradient’ or ‘del’ :: return laplacian of the whole grid this selection can be used in tandem with ‘around’ and ‘get’ but will always return the laplacian of the original unmasked grid, and NOT the laplacian of the selection region. ‘convolve’ or ‘log’ or ‘laplacian of gaussian’ :: return the grid convolved with a laplacian of gaussian (LoG) filter. Same specification as above sigma :: stdev. for gaussian kernel in the LoG filter ——————————————— ! All other strings will be ignored. ! resname will override any array input ——————————————— example selection self.select_grid(‘LoG of guv with sigma 3 around 4 resname MOL’) creates laplacian of gaussian of the g(r) grid with a gaussian std. of 3, then selects the region around 4 A of all atoms in the residue named ‘MOL’ !!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!! MESSY, NEEDS SOME WORK

Parameters:

input_string (str)

solute(solute_structure, solute_topology, to_gro=False, gen_idc=False, convert=False, recenter=False, box_size=[10, 10, 10])[source]

solute_structure :: .gro, .pdb or .xtc file solute_topology :: .top or .solte file gen_idc :: bool, generate an ion-dipole-correction (IDC) enabled .solute file this file will be used for the remainder of the calculation convert :: convert solute_topology to .solute file

========== IF GROMACS ==================== - requirements: GROMACS installed and properlly sourced to_gro :: convert solute_structure file to .gro using pdb2gmx recenter :: recenter solute incenter of box using gmx -edifconf

solvent(solvent_topology=None)[source]

Reads the solvent topology file. If no file specified, will default search the site-packages dir where episol.epipy is stored. this may fail as the os package sometimes encounters errors ================================= solvent_topology :: solvent correlation file ——————————- if solvent topology is set to None i.e. has no input then we will select the tip3p 0.01A file from the source directory of EPIPY, this way to avoid annoying paths

test(nt=1, v=1)[source]

Calls episol and adds -test flag to the CLI

v :: int(), verbose rating nt :: int(), number of threads to use

episol.fileutils module

Module contents