pwspy.utility.DConversion.S2DMatlabBridge

class pwspy.utility.DConversion.S2DMatlabBridge(s2dPath)[source]

Bases: object

Opens a MATLAB process to run the Sigma2D conversion code. You must have the MATLAB engine for Python installed in your Python environment.

Parameters

s2dPath (str) – The file path to the SigmaConversion MATLAB package.

SigmaToD_AllInputs(sigmaIn, system_config, Nf, thickIn)[source]

Run the complete sigma to D conversion function.

Parameters
  • sigmaIn (Union[Sequence[float], float]) – The sigma values you want to convert.

  • system_config (S2D.SystemConfiguration) – The SystemConfiguration object to use.

  • Nf (float) – The genomic length of a packing domain.

  • thickIn (float) – The expected thickness of the sample.

Returns

This is analogous to D_b in Aya’s paper. The model parameter. dCorrected: This is the true D. This is usually what we care about. Nf_expected: The genomic length we expect based on D and the calculated lMax. lmax_corrected: Calculation of LMax from Nf and Db based on eqn. 2.

Return type

dOut

close()[source]

Close the MATLAB engine. This may not be necessary as the engine will be automatically closed when Python shuts down.

createRIDefinitionFromGladstoneDale(mediaRI, CVC)[source]

Create an S2D.RIDefinition object from the GladstoneDale equation.

Parameters
  • mediaRI (float) – The refractive index of the media that the chromatin is immersed in.

  • CVC (float) – The CVC, also referred to as Phi. The ratio of Chromatin Volume : Total Volume, kind of like density.

Return type

matlab.object

Returns

A S2D.RIDefinition object.

createSystemConfiguration(ri_def, na_i, na_c, center_lambda, oil_immersion, cell_glass_interface)[source]

Create a system configuration object. This object contains all information about the microscope and sample refractive indices.

Parameters
  • ri_def (S2D.RIDefinition) – An RI definition object

  • na_i (float) – The illumination NA of the objective.

  • na_c (float) – The collection NA of the objective.

  • center_lambda (float) – The center wavelength of illumination. This should be the center in K-space. So, the wavelength of the center wavenumber.

  • oil_immersion (bool) – If True then the objective is treated as though it is immersed in RI_glass. If False it is treated as though it is immersed in RI_media.

  • cell_glass_interface (bool) – If True then the cell/glass interface is treated as the reference reflection of the configuration. If False then the cell/media interface is treated as the reference reflection.

Return type

matlab.object

Returns

A S2D.SystemConfiguration MATLAB object.