pysoftk.pol_analysis.tools package

Submodules

pysoftk.pol_analysis.tools.clustering_prob_distribution_plot module

pysoftk.pol_analysis.tools.clustering_prob_distribution_plot.total_number_clusters(dataframe, start, color='#fde725')[source]

The dataframe input should be the output of the spatial_clustering

pysoftk.pol_analysis.tools.utils_mda module

class pysoftk.pol_analysis.tools.utils_mda.MDA_input(tpr_file, xtc_file)[source]

Bases: object

Class to load in memory a trajectory using MDA.

xtc

Path and Name of the file with extension xtc.

Type:

str

tpr

Path and Name of the file with extension tpr.

Type:

str

get_mda_universe()[source]
Function to create a MDAnalysis object loading

the trajectory.

Parameters:

None

Returns:

u – MDAnalysis object containing relevant information.

Return type:

MDAnalysis.object

pysoftk.pol_analysis.tools.utils_tools module

pysoftk.pol_analysis.tools.utils_tools.coord_matrix_calc(u, atom_name, polymer_oxygen_pos, water_positions, cut_off)[source]

Function to calculate coordination number of the chosen atoms of the polymer and water

Parameters:
  • atom_name (class.str) – polymer atom names to calculate the hydration for

  • polymer_oxygen_pos (np.array) – 3D np.array with positions of atom_name

  • water_positions (np.array) – np.array with the positions of the waters

cut_offclass.float

number cut off of the distance between the polymer beads and the water for hydration calculation

Returns:

sums_coord – coordination numbers of atom_name

Return type:

class.list

pysoftk.pol_analysis.tools.utils_tools.create_binned_space(binned_space)[source]

Funcion to create a binned array

Parameters:

binned_space (np.array) – array with all the bin values

Returns:

binned_space_volume – array with the bins

Return type:

np.array

pysoftk.pol_analysis.tools.utils_tools.create_network(list_of_tuples)[source]

Function to create a network provided by the list of tuples.

Parameters:

list_of_tuples (class.tuple) – List of all edges

Returns:

final – Networkx.object with connected components

Return type:

networkx.object

pysoftk.pol_analysis.tools.utils_tools.distance_matrix_calc(u, group1_positions, group2_positions)[source]

Function to calculate the distane between two atom groups

Parameters:
  • u (MDAnalysis.Universe) – An user-provided MDAnalysis trajectory.

  • group1_positions (np.array) – Array with the positions of the first atom group

  • group2_positions (np.array) – Array with the positions of the second atom group

Returns:

distance_matrix – Matrix with the pair-wise distance between every atoms in group1 and group2

Return type:

np.array

pysoftk.pol_analysis.tools.utils_tools.find_values(array, pairs, len1, len2)[source]

Function to find the minors of a matrix

Parameters:
  • array (np.array) – Matrix to perform the calculations on

  • pairs (class.list) – Column and row of specific value to be found in matrix

  • len1 (class.int) – Length of group 1

  • len2 (class.int) – Length of group 2

Returns:

mat – Minor of array

Return type:

np.array

pysoftk.pol_analysis.tools.utils_tools.get_atom_name_list(atom_sel)[source]

Function to obtain the residues combination based on user-provided atom selection.

Parameters:

atom_sel (class.str) – User Provided name/tag of the molecules inside the box.

Returns:

final – List containing all names of atoms.

Return type:

class.list

pysoftk.pol_analysis.tools.utils_tools.get_frames(tpr_file, xtc_file, start, stop, step)[source]

Function to obtain the frames of a trajectory

Parameters:
  • tpr_file (MDAnalysis.tpr_file) – A tpr trajectory to analyse.

  • xtc_file (MDAnalysis.xtc_file) – A XTC trajectory to analyse

  • start (class.int) – frame to start calculation

  • stop (class.int) – frame to stop calculation

  • step (class.int) – number of frames to skip

Returns:

frames – np.array with the selected frames

Return type:

np.array

pysoftk.pol_analysis.tools.utils_tools.get_frames_hydr(u, start, stop, step)[source]

Function to obtain the frames of a trajectory

Parameters:
  • u (MDAnalysis.Universe) – An user-provided MDAnalysis trajectory.

  • start (class.int) – frame to start calculation

  • stop (class.int) – frame to stop calculation

  • step (class.int) – number of frames to skip

Returns:

frames – np.array with the selected frames

Return type:

np.array

pysoftk.pol_analysis.tools.utils_tools.get_index_pairs(len1, step1, len2, step2)[source]

Function to get atom pairs

Parameters:
  • len1 (class.int) – Length of group 1

  • step1 (class.int) – Number of atoms of molecules belonging to group 1

len2class.int

Length of group 2

step2class.int

Number of atom of molecules belonging to group 2

Returns:

pairs – List with atom indices pairs between the two groups

Return type:

class.list

pysoftk.pol_analysis.tools.utils_tools.get_universe_per_frame(u, start, stop, skip)[source]

Function to split an MDAnalysis Universe into user-provided timeframes.

Parameters:
  • u (MDAnalysis.Universe) – An user-provided MDAnalysis trajectory.

  • start (class.int) – frame to start calculation

  • stop (class.int) – frame to stop calculation

  • step (class.int) – number of frames to skip

Returns:

frames – A list with the selected frames

Return type:

class.list

pysoftk.pol_analysis.tools.utils_tools.pair(array)[source]

Function to divde array into pairs

Parameters:

array (MDAnalysis.Object) – An user-provided array.

Returns:

a,b – A tuple containing the values of the provided array.

Return type:

tuple

pysoftk.pol_analysis.tools.utils_tools.selecting_atoms(u, atom_resids)[source]

Funcion to calculate the radius of gyration of the chosen atoms

Parameters:

u (MDAnalysis.Universe) – An User-provided Universe.

atom_sel_typeclass.str

Atom selection of the atoms that form the micelle for rgyr calculation.

atom_residsclass.list

list with the resids of the polymers that form the micelle for rgyr calculation.

Returns:

selected_atoms – Atom selection

Return type:

MDAnalysis.selection

pysoftk.pol_analysis.tools.utils_tools.selecting_atoms_density(u, atom_sel_type, atom_names)[source]

Function to select specific atoms

Parameters:
  • u (mda.Universe) – mda.Universe

  • atom_sel_type – type of atom selection, resid, names etc…

Returns:

selected_atoms – atom selection

Return type:

mda.selection

pysoftk.pol_analysis.tools.utils_tools_old module

pysoftk.pol_analysis.tools.utils_tools_old.coord_matrix_calc(u, atom_name, polymer_oxygen_pos, water_positions, cut_off, parallel='OpenMP')[source]

Function to calculate coordination number of the chosen atoms of the polymer and water

Parameters:
  • atom_name (class.str) – polymer atom names to calculate the hydration for.

  • polymer_oxygen_pos (np.array) – 3D np.array with positions of atom_name.

  • water_positions (np.array) – np.array with the positions of the water moieties.

cut_offclass.float

number cut off of the distance between the polymer beads and the water for hydration calculation.

Returns:

sums_coord – coordination numbers of atom_name

Return type:

class.list

pysoftk.pol_analysis.tools.utils_tools_old.create_network(list_of_tuples)[source]

Function to create a network provided by the list of tuples.

Parameters:

list_of_tuples (class.tuple) – List of all edges

Returns:

final – Networkx.object with connected components

Return type:

networkx.object

pysoftk.pol_analysis.tools.utils_tools_old.distance_matrix_calc(u, group1_positions, group2_positions, parallel='OpenMP')[source]

Function to calculate the distane between two atom groups

Parameters:
  • u (MDAnalysis.Universe) – An user-provided MDAnalysis trajectory.

  • group1_positions (np.array) – Array with the positions of the first atom group

  • group2_positions (np.array) – Array with the positions of the second atom group

Returns:

distance_matrix – Matrix with the pair-wise distance between every atoms in group1 and group2

Return type:

np.array

pysoftk.pol_analysis.tools.utils_tools_old.find_values(array, pairs, len1, len2)[source]

Function to find the minors of a matrix

Parameters:
  • array (np.array) – Matrix to perform the calculations on

  • pairs (class.list) – Column and row of specific value to be found in matrix

  • len1 (class.int) – Length of group 1

  • len2 (class.int) – Length of group 2

Returns:

mat – Minor of array

Return type:

np.array

pysoftk.pol_analysis.tools.utils_tools_old.get_atom_name_list(atom_sel)[source]

Function to obtain the residues combination based on user-provided atom selection.

Parameters:

atom_sel (class.str) – User Provided name/tag of the molecules inside the box.

Returns:

final – List containing all names of atoms.

Return type:

class.list

pysoftk.pol_analysis.tools.utils_tools_old.get_frames(tpr_file, xtc_file, start, stop, step)[source]

Function to obtain the frames of a trajectory

Parameters:
  • tpr_file (MDAnalysis.tpr_file) – A tpr trajectory to analyse.

  • xtc_file (MDAnalysis.xtc_file) – A XTC trajectory to analyse

  • start (class.int) – frame to start calculation

  • stop (class.int) – frame to stop calculation

  • step (class.int) – number of frames to skip

Returns:

frames – np.array with the selected frames

Return type:

np.array

pysoftk.pol_analysis.tools.utils_tools_old.get_frames_hydr(u, start, stop, step)[source]

Function to obtain the frames of a trajectory

Parameters:
  • u (MDAnalysis.Universe) – An user-provided MDAnalysis trajectory.

  • start (class.int) – frame to start calculation

  • stop (class.int) – frame to stop calculation

  • step (class.int) – number of frames to skip

Returns:

frames – np.array with the selected frames

Return type:

np.array

pysoftk.pol_analysis.tools.utils_tools_old.get_index_pairs(len1, step1, len2, step2)[source]

Function to get atom pairs

Parameters:
  • len1 (class.int) – Length of group 1

  • step1 (class.int) – Number of atoms of molecules belonging to group 1

len2class.int

Length of group 2

step2class.int

Number of atom of molecules belonging to group 2

Returns:

pairs – List with atom indices pairs between the two groups

Return type:

class.list

pysoftk.pol_analysis.tools.utils_tools_old.get_universe_per_frame(u, start, stop, skip)[source]

Function to split an MDAnalysis Universe into user-provided timeframes.

Parameters:
  • u (MDAnalysis.Universe) – An user-provided MDAnalysis trajectory.

  • start (class.int) – frame to start calculation

  • stop (class.int) – frame to stop calculation

  • step (class.int) – number of frames to skip

Returns:

frames – A list with the selected frames

Return type:

class.list

pysoftk.pol_analysis.tools.utils_tools_old.pair(array)[source]

Function to divde array into pairs

Parameters:

array (MDAnalysis.Object) – An user-provided array.

Returns:

a,b – A tuple containing the values of the provided array.

Return type:

tuple

pysoftk.pol_analysis.tools.utils_tools_old.selecting_atoms(u, atom_resids)[source]

Funcion to calculate the radius of gyration of the chosen atoms

Parameters:

u (MDAnalysis.Universe) – An User-provided Universe.

atom_sel_typeclass.str

Atom selection of the atoms that form the micelle for rgyr calculation.

atom_residsclass.list

list with the resids of the polymers that form the micelle for rgyr calculation.

Returns:

selected_atoms – Atom selection

Return type:

MDAnalysis.selection

Module contents