ATSAS.CorMapAnalysis#

obtained from GarmanGroup/CorMapAnalysis converted from Python2 to Python3

class ScatterAnalysis(intensities, scattering_angles, datcmp_data, x_axis_vec=[], x_metric='', x_units='')#

Bases: object

Scatter curve similarity analysis class.

CorMap class implementing analysis of data output from a run of the ATSAS suite program DATCMP.

Create a ScatterAnalysis object.

Constructor method to create ScatterAnalysis object which exposes a simple API for analysing the DATCMP data.

Parameters:
  • intensities (2D numpy array) – Array of intensity values where each column represents the intensity values for a single frame and each row represents the intensity at a particular scattering angle.

  • scattering_angles (1D numpy array) – Array of scattering angles measured for the SAXS run.

  • datcmp_data (dictionary) – dictionary containing all of the data from the DATCMP output. The key type is a string of image pairs and the value type is a list of the pairwise correlation results from the analysis between the image pairs.

  • x_axis_vec (numpy array, optional (default=[])) – Vector of values to use on the x-axis of plots. This can be things like dose values for example. If not specified then frame number is used as a default.

  • x_metric (str, optional (default="")) – String specifying the type of metric used for the x-axis. An example would be “Dose”. If not specified then the default metric used on the x-axis is “Frame Number”

  • x_units (str, optional (default="")) – String specifying the units used for the x-axis metric. For example if the x-axis metric was the ‘dose’, then x_units may be specified as “kGy”.

PLOT_LABEL = {'family': 'serif', 'size': 16, 'weight': 'normal'}#
PLOT_NUM = 0#
calc_cormap()#

Calculate correlation map.

Method to calculate the full correlation map for entire dataset.

Parameters:

N/A

Returns:

2D matrix of correlations for all SAXS frames

Return type:

numpy 2D array

Examples

>>>  correlation_matrix = scat_obj.calc_cormap()
calc_pwcormap(frame1, frame2)#

Calculate pairwise correlation map between two frames.

Calculation of the pairwise correlation map between two chosen frames.

Parameters:
  • frame1 (int) – Number of the 1st frame used for the pairwise analyis

  • frame2 (int) – Number of the 2nd frame used for the pairwise analyis

Returns:

Array with the correlation between two frames.

Return type:

2D Numpy array

Examples

Get the correlation map between frames 1 and 10.

>>>  pairwise_corr_map = scat_obj.calc_pwcormap(1, 10)
find_diff_frames(frame=1, P_threshold=0.01, P_type='adjP')#

List all statistically dissimilar frames.

This method finds all statistically dissimilar frames to any given frame using the CorMap test as outlined in Daniel Franke, Cy M Jeffries & Dmitri I Svergun (2015). The user can set the significance threshold as well as whether to use the Bonferroni corrected P values or not. (we recommend that you should use the Bonferroni corrected P values).

Parameters:
  • frame (int, optional (default=1)) – The frame that every other frame in the dataset is compared with. If not specified then all frames are compared to the first frame.

  • P_threshold (float, optional (default=0.01)) – The significance threshold of the test. If it’s not given then the default value is 1%.

  • P_type (str, optional (default="adjP")) – String denoting whether to use the Bonferroni corrected P value (input string=”adjP”) or the ordinary P value (input string=”P”). Default is to use the Bonferroni corrected P value.

Returns:

A list of integers corresponding to all of the dissimilar frames

Return type:

List

Examples

Find all frames that are dissimilar to frame 10

>>>  diff_frames = scat_obj.find_diff_frames(frame=10)
find_first_n_diff_frames(n=1, frame=1, P_threshold=0.01, P_type='adjP')#

Find the first of n consecutive dissimilar frames.

Return the first frame, F, where there are n-1 consecutive frames after F that are also statistically dissimilar from the chosen frame.

Parameters:
  • n (int, optional (default=1)) – The number of consecutive dissimilar frames to be considered significant.

  • frame (int, optional (default=1)) – The frame that every other frame in the dataset is compared with. If not specified then all frames are compared to the first frame.

  • P_threshold (float, optional (default=0.01)) – The significance threshold of the test. If it’s not given then the default value is 1%.

  • P_type (str, optional (default="adjP")) – string denoting whether to use the Bonferroni corrected P value (input string=”adjP”) or the ordinary P value (input string=”P”). Default is to use the Bonferroni corrected P value.

Returns:

Frame number of the first of n consecutive dissimilar frames.

Return type:

int

Examples

Get the frame number that is the first of 3 consecutive dissimilar frames to frame 10.

>>>  first_diff_frames = scat_obj.find_first_n_diff_frames(n=3, frame=10)
classmethod from_1d_curves(scat_curve_location, x_axis_vec=[], metric='', units='', first=-1, last=-1, smin=-1, smax=-1)#

Create a ScatterAnalysis object from .

Method to create ScatterAnalysis object from a set of 1D scattering curve files.

Parameters:
  • scattering_curve_location (str) – Location of the scattering curves for the dataset.

  • x_axis (numpy array, optional (default=[])) – Vector of values to use on the x-axis of plots. This can be things like dose values for example. If not specified then frame number is used as a default.

  • x_metric (str, optional (default="")) – String specifying the type of metric used for the x-axis. An example would be “Dose”. If not specified then the default metric used on the x-axis is “Frame Number”

  • x_units (str, optional (default="")) – String specifying the units used for the x-axis metric. For example if the x-axis metric was the ‘dose’, then x_units may be specified as “kGy”.

  • first (int, optional (default=-1)) – Index of the first point to be kept. This is mutually exclusive with argument parameter ‘smin’. Default value is -1. This will ultimately result in the method not using this value.

  • last (int, optional (default=-1)) – Index of the last point to be kept. This is mutually exclusive with argument parameter ‘smax’. Default value is -1. This will ultimately result in the method not using this value.

  • smin (float, optional (Default=-1)) – Minimal scattering angle value to be kept. This is mutually exclusive with argument parameter ‘first’. Default value is -1. This will ultimately result in the method not using this value.

  • smax (float, optional (Default=-1)) – Maximal scattering angle value to be kept. This is mutually exclusive with argument parameter ‘last’. Default value is -1. This will ultimately result in the method not using this value.

Returns:

The ScatterAnalysis object

Return type:

ScatterAnalysis

Examples

To create a ScatterAnalysis object that will plot only against frame numbers then the only input required is the location of the set of files:

>>>  scat_obj = ScatterAnalysis.from_1d_curves("saxs_files.00*.dat")

If you want to plot an x-axis that is different from the frame number, e.g. the dose, then we would specify something like:

>>>  scat_obj = ScatterAnalysis.from_1d_curves("saxs_files.00*.dat", np.array([10, 20, 30, 40]), "Dose", "kGy")

If you don’t want to compare the entire range of the SAXS curve (this may be the case where there are sections of the 1D curves that are noisy) then there is the option to crop the curves before running the CorMap test to create the ScatterAnalysis object. In the example below we create a ScatterAnalysis object where we crop the first 99 frames and use data up to a scattering angle of 3 nm^{-1}.

>>>  scat_obj = ScatterAnalysis.from_1d_curves("saxs_files.00*.dat", first=99, smax=3.0)

Note

The x_axis_vec array needs to be the same length as the total number of frames in the dataset otherwise the frame number will be used on the x-axis by default

classmethod get_datcmp_info(scattering_curve_files)#

Extract the data produced by DATCMP.

This method is used by the constructor method of the ScatterAnalysis class. It runs the DATCMP program on the dataset and returns a dictionary containing the main results from the DATCMP run.

Parameters:

scattering_curve_files (str) – Location of the scattering curves for the dataset.

Returns:

Dictionary containing the results of the DATCMP run. The dictionary key is a string (with no spaces) denoting the pair of frames that were compared e.g. “1,2” would be frames 1 and 2. The dictionary value is an array of DATCMP results for the corresponding pairwise comparison.

Return type:

dict(str, numpy.array)

Examples

>>>  datcmp_data = scat_obj.get_datcmp_info("saxs_files.00*.dat")
get_pw_data(frame1, frame2, datcmp_data_type='adj P(>C)')#

Get the CorMap results for a given pair of frames.

Return C, P(>C) or Bonferroni adjusted P(>C) value from the DATCMP output.

Parameters:
  • frame1 (int) – number of the 1st frame used for the pairwise analyis

  • frame2 (int) – number of the 2nd frame used for the pairwise analyis

  • datcmp_data_type (str, optional (default="adj P(>C)")) – String specifying the pairwise result to be returned. The input options are: 1) ‘C’ - This will return the C value i.e. the max observed patch of continuous runs of -1 or 1 2) ‘P(>C)’ - This will return the P value of observing a patch of continuous runs of -1 or 1 bigger than the corresponding C value. 3) ‘adj P(>C)’ - This will return the Bonferroni adjusted P value of observing a patch of continuous runs of -1 or 1 bigger than the corresponding C value.

Returns:

A value specifying the largest number of consecutive positive or negative values in a row, C, or the probability value (either standard P or Bonferroni corrected) the we observed more than C positive or negative values in a row.

Return type:

int or float

Examples

Get the number of the longest run of positive or negative values in a row between frames 1 and 2

>>>  C = scat_obj.get_pw_data(1, 2, datcmp_data_type='C')

Get the Bonferroni corrected probability that we would observed a run of positive or negative values greater than C

>>>  C = scat_obj.get_pw_data(1, 2, datcmp_data_type='adj P(>C)')
get_pw_data_array(frame=0, delete_zero_row=True)#

Get C, P(>C) and Bonferroni corrected P(>C) values for a given frame.

Return an array of all C, P(>C) and Bonferroni adjusted P(>C) values from the DATCMP output for the requested frame. E.g. if you choose frame 1 then this means that the method with return an array of C, P(>C) and Bonferroni adjusted P(>C) values calculated between frame 1 and all other frames.

Parameters:
  • frame (int, optional (default=0)) – The frame that every other frame in the dataset is compared with. If not specified then ALL data from the DATCMP results are returned.

  • delete_zero_row (bool, optional (default=True)) – Choose whether to include a row where the chosen frame would’ve been compared with itself - although this row is filled with zero. This makes sure that you’ll return an array whose number of rows is the same as the number of frames. By default this is set to false.

Returns:

Array of all C, P(>C) and Bonferroni adjusted P(>C) values from the DATCMP results for the requested frame.

Return type:

2D Numpy array

Examples

Get all DATCMP data for when all other frames are compared with frame 10

>>>  datcmp_data = scat_obj.get_pw_data_array(frame=10)
plot_1d_intensity(frames, start_point=1, end_point=-1, log_intensity=True, display=True, save=False, filename='', directory='', legend_loc='upper right', markersize=8)#

Plot 1D scatter curves.

Choose frames for which to plot the 1D scatter curves in the same figure.

Parameters:
  • frames (int or list) – Number of the frame or list of frame numbers to be plotted on the figure.

  • start_point (int, optional (default=1)) – The point on the scatter curve from which you would like to start the plot. Default is to plot from the first point.

  • end_point (int, optional (default=-1)) – The point on the scatter curve from which you would like to end the plot. Default is to plot up until to very last point on the curve.

  • log_intensity (bool, optional (default=True)) – Choose whether to plot the intensity curve on a logarithmic scale (default) or on an absolute scale.

  • display (bool, optional (default=True)) – Choose whether to display the plot. By default it is displayed.

  • save (bool, optional (default=True)) – Choose whether to save the plot. By default the plot is not saved.

  • filename (str, optional (default="")) – Choose a filename for the plot that you want to save. This includes the file extension.

  • directory (str, optional (default="")) – Select the directory in which you want the plot to be saved.

  • legend_loc (str or int, optional (default="upper left")) – Set the location of the legend in the figure. All possible values can be found in the Matplotlib Legend API documentation: http://matplotlib.org/api/legend_api.html. Default is set to the upper left of the figure.

  • markersize (float, optional (default=60)) – Change the size of the markers on the plot. Default value is 60.

Examples

Plot the 1D intensity curve for frames 1, 10 and 100

>>>  scat_obj.plot_1d_intensity([1, 10, 100], start_point=200, end_point=400)

Plot the 1D intensity curve for frames 1, 10 and 100 between point 200 and 400.

>>>  scat_obj.plot_1d_intensity([1, 10, 100])

Save the 1D intensity plot in the current working directory without displaying it.

>>>  scat_obj.plot_1d_intensity(display=False, save=True, filename="MyPlot.png")
plot_cormap(colour_scheme='gray', display=True, save=False, filename='', directory='')#

Plot the full correlation map.

Plot the correlation map of all frames in the dataset.

Parameters:
  • colour_scheme (str, optional (default="gray")) – The colour scheme used to plot the correlation map. The list of schemes can be found on the relevant matplotlib webpage: http://matplotlib.org/examples/color/colormaps_reference.html

  • display (bool, optional (default=True)) – Choose whether to display the plot. By default it is displayed.

  • save (bool, optional (default=True)) – Choose whether to save the plot. By default the plot is not saved.

  • filename (str, optional (default="")) – Choose a filename for the plot that you want to save. This includes the file extension.

  • directory (str, optional (default="")) – Select the directory in which you want the plot to be saved.

Examples

Plot the full correlation map

>>>  scat_obj.plot_cormap()

Save the correlation map in the current working directory without displaying it

>>>  scat_obj.plot_cormap(display=False, save=True, filename="MyPlot.png")
plot_first_n_diff_frames(n=1, P_threshold=0.01, P_type='adjP', display=True, save=False, filename='', directory='')#

Plot dissimilar frames

For each frame in the dataset you can perform a similarity analysis against every other frame. From this you can calculate the first frame for which the probability value (P(>C) or adj P(>C)) for n consecutive frames is below the significance value (signifying that the frames are likely to be dissimilar). Note here that n and the P_threshold (significance value) are user defined values. This methods plots the first frame in that consecutive run for each ‘reference’ frame in the dataset. By reference frame, we mean the frame for which every other frame is compared.

Parameters:
  • n (int, optional (default=1)) – Number of consecutive dissimilar frames to be considered dissimilar.

  • P_threshold (float, optional (default=0.01)) – The significance level for the data. If the probability is below this value then one frame is considered dissimilar to the frame to which it is being compared. Default significance level is 0.01.

  • P_type (str, optional (default="adjP")) – String denoting whether to use the Bonferroni corrected P value (input string=”adjP”) or the ordinary P value (input string=”P”). Default is to use the Bonferroni corrected P value.

  • display (bool, optional (default=True)) – Choose whether to display the plot. By default it is displayed.

  • save (bool, optional (default=True)) – Choose whether to save the plot. By default the plot is not saved.

  • filename (str, optional (default="")) – Choose a filename for the plot that you want to save. This includes the file extension.

  • directory (str, optional (default="")) – Select the directory in which you want the plot to be saved.

Examples

Plot the first dissimilar frame for each frame in the dataset used as the reference frame.

>>>  scat_obj.plot_first_n_diff_frames()

Plot the first of 3 consecutive dissimilar frames for each frame in the dataset used as the reference frame (as was the case described in Brooks-Bartlett et al. 2016 - Development of tools to automate quantitative analysis of radiation damage in SAXS experiments).

>>>  scat_obj.plot_first_n_diff_frames(n=3)

Save the plot in the current working directory without displaying it.

>>>  scat_obj.plot_first_n_diff_frames(display=False, save=True, filename="MyPlot.png")
plot_heatmap(P_threshold=0.01, markersize=60, display=True, save=False, filename='', directory='', legend_loc=2, x_change=False, use_adjP=True, xaxis_frame_num=False, P_values=True, colours=['#0072B2', '#009E73', '#D55E00'])#

Create Heatmap of the frame similarity data.

The heatmap provides a visual representation of the pairwise similarity analyis of the SAXS dataset.

Parameters:
  • P_threshold (float, optional (default=0.01)) – The significance level for the data. If the probability is below this value then one frame is considered dissimilar to the frame to which it is being compared. Default significance level is 0.01.

  • markersize (float, optional (default=60)) – Change the size of the markers on the plot. Default value is 60.

  • display (bool, optional (default=True)) – Choose whether to display the plot. By default it is displayed.

  • save (bool, optional (default=True)) – Choose whether to save the plot. By default the plot is not saved.

  • filename (str, optional (default="")) – Choose a filename for the plot that you want to save. This includes the file extension.

  • directory (str, optional (default="")) – Select the directory in which you want the plot to be saved.

  • legend_loc (str or int, optional (default=2)) – Set the location of the legend in the figure. All possible values can be found in the Matplotlib Legend API documentation: http://matplotlib.org/api/legend_api.html. Default is set to the upper left (integer value is 2) of the figure.

  • x_change (bool, optional (default=False)) – This option changes whether the x-axis is plotted with absolute values (x_change=True) or if it’s plotted with differences between the x-axis values (x_change=False). For example if we compare choose the reference frame to be frame 10 (frame=10) then compare this with frame 30 then setting x_change=True will put the relevant point at frame 30. However if we set x_change=False this will put the relevant point to be at abs(10 - 30) = 20. This option allows you to determine if the dissimilar frames are frames that are collected far from the current frame. Default is set to x_change=True.

  • use_adjP (bool, optional (default=True)) – Choose whether to use the Bonferroni corrected P values or to use the unadjusted P values. Default is to use the Bonferroni corrected P values.

  • xaxis_frame_num (bool, optional (default=True)) – Choose whether to plot the x-axis with the frame number or whether to use the custom x-axis metric values that may (or may not) have been defined when the ScatterAnalysis object was constructed. Default is to use the custom metric (if it was defined).

  • P_values (bool, optional (default=True)) – Choose whether to plot probability values or C values - the maximum observed patch of continuous runs of -1 or 1. Default is to use the P values.

  • colours (list, optional (default=["#0072B2", "#009E73", "#D55E00"])) – Choose the colour scheme for the markers in the scatter plot, which is differentiated by the P value.

Examples

Create heatmap.

>>>  scat_obj.plot_heatmap()

Save the heatmap in the current working directory withot displaying it.

>>>  scat_obj.plot_heatmap(display=False, save=True, filename="MyPlot.png")
plot_histogram(frame=0, datcmp_data_type='C', display=True, save=False, filename='', directory='', num_bins=20)#

Plot the histogram of the DATCMP data.

For any chosen frame this methods plots a histogram of the DATCMP data for all pairwise comparisons with that frame. If no frames are chosen then the method plots all pairwise frame comparison data.

Parameters:
  • frame (int, optional (default=0)) – Number of the frame for which all pairwise comparison data is plotted. If not specified then all pairwise frame comparison data is shown.

  • datcmp_data_type (str, optional (default="C")) – The data type from the DATCMP results that is plotted. The input options are: 1) ‘C’ - This will return the C value i.e. the max observed patch of continuous runs of -1 or 1 2) ‘P(>C)’ - This will return the P value of observing a patch of continuous runs of -1 or 1 bigger than the corresponding C value. 3) ‘adj P(>C)’ - This will return the Bonferroni adjusted P value of observing a patch of continuous runs of -1 or 1 bigger than the corresponding C value.

  • display (bool, optional (default=True)) – Choose whether to display the plot. By default it is displayed.

  • save (bool, optional (default=True)) – Choose whether to save the plot. By default the plot is not saved.

  • filename (str, optional (default="")) – Choose a filename for the plot that you want to save. This includes the file extension.

  • directory (str, optional (default="")) – Select the directory in which you want the plot to be saved.

  • num_bins (int, optional (default=20)) – Number of bins used to plot in the histogram.

Examples

Plot histogram of all of the DATCMP data with data type “C” (as defined above)

>>>  scat_obj.plot_histogram()

Plot histogram of all of Bonferroni corrected P values with all frames compared to frame 10.

>>> scat_obj.plot_histogram(frame=10, datcmp_data_type="adj P(>C)")

Save the histogram in the current working directory without displaying it

>>>  scat_obj.plot_histogram(display=False, save=True, filename="MyPlot.png")
plot_pwcormap(fr1, fr2, colour_scheme='gray', display=True, save=False, filename='', directory='')#

Plot the pairwise correlation map between two chosen frames.

Plot the pairwise correlation map between two frames fr1 and fr2.

Parameters:
  • fr1 (int) – Number of the 1st frame used for the pairwise analyis

  • fr2 (int) – Number of the 2nd frame used for the pairwise analyis

  • colour_scheme (str, optional (default="gray")) – The colour scheme used to plot the correlation map. The list of schemes can be found on the relevant matplotlib webpage: http://matplotlib.org/examples/color/colormaps_reference.html

  • display (bool, optional (default=True)) – Choose whether to display the plot. By default it is displayed.

  • save (bool, optional (default=True)) – Choose whether to save the plot. By default the plot is not saved.

  • filename (str, optional (default="")) – Choose a filename for the plot that you want to save. This includes the file extension.

  • directory (str, optional (default="")) – Select the directory in which you want the plot to be saved.

Examples

Plot the pairwise correlation map between frame 1 and frame 2

>>>  scat_obj.plot_pwcormap(1, 2)

Save the pairwise correlation map in the current working directory without displaying it

>>>  scat_obj.plot_pwcormap(1, 2, display=False, save=True, filename="MyPlot.png")
plot_scatter(frame=1, P_threshold=0.01, markersize=60, display=True, save=False, filename='', directory='', legend_loc='upper left', x_change=False, use_adjP=True, xaxis_frame_num=False, colours=['#0072B2', '#009E73', '#D55E00'], markers=['o', 'o', 'o'])#

Create scatter plot of the frame similarity data.

For any chosen frame this methods creates a scatter plot of the C values - the maximum observed patch of continuous runs of -1 or 1 - for a chosen frame against all other frames. The probabilities of those C values occuring by chance are also coloured accordingly, and this can be changed by the user.

Parameters:
  • frame (int, optional (default=0)) – Number of the frame for which all pairwise comparison data is plotted. If not specified then all pairwise frame comparison data against frame 1 is plotted.

  • P_threshold (float, optional (default=0.01)) – The significance level for the data. If the probability is below this value then the current frame is considered dissimilar to the frame to which it is being compared. Default significance level is 0.01.

  • markersize (float, optional (default=60)) – Change the size of the markers on the plot. Default value is 60.

  • display (bool, optional (default=True)) – Choose whether to display the plot. By default it is displayed.

  • save (bool, optional (default=True)) – Choose whether to save the plot. By default the plot is not saved.

  • filename (str, optional (default="")) – Choose a filename for the plot that you want to save. This includes the file extension.

  • directory (str, optional (default="")) – Select the directory in which you want the plot to be saved.

  • legend_loc (str or int, optional (default="upper left")) – Set the location of the legend in the figure. All possible values can be found in the Matplotlib Legend API documentation: http://matplotlib.org/api/legend_api.html. Default is set to the upper left of the figure.

  • x_change (bool, optional (default=False)) – This option changes whether the x-axis is plotted with absolute values (x_change=True) or if it’s plotted with differences between the x-axis values (x_change=False). For example if we compare choose the reference frame to be frame 10 (frame=10) then compare this with frame 30 then setting x_change=True will put the relevant point at frame 30. However if we set x_change=False this will put the relevant point to be at abs(10 - 30) = 20. This option allows you to determine if the dissimilar frames are frames that are collected far from the current frame. Default is set to x_change=True.

  • use_adjP (bool, optional (default=True)) – Choose whether to use the Bonferroni corrected P values or to use the unadjusted P values. Default is to use the Bonferroni corrected P values.

  • xaxis_frame_num (bool, optional (default=True)) – Choose whether to plot the x-axis with the frame number or whether to use the custom x-axis metric values that may (or may not) have been defined when the ScatterAnalysis object was constructed. Default is to use the custom metric (if it was defined).

  • colours (list, optional (default=["#0072B2", "#009E73", "#D55E00"])) – Choose the colour scheme for the markers in the scatter plot, which is differentiated by the P value.

  • markers (list, optional (default=["o", "o", "o"])) – Choose the markers used for the markers in the scatter plot, which is differentiated by the P value. A list of the markers that can be used can be found on the Matplotlib Markers API webpage: http://matplotlib.org/api/markers_api.html

Examples

Create the scatter plot of the data compared against frame 1

>>>  scat_obj.plot_scatter()

Create scatter plot where all frames are compared against frame 30 and the x axis plots the difference in frame number from frame 30.

>>> scat_obj.plot_scatter(frame=30, x_change=True)

Save the scatter plot in the current working directory without displaying it.

>>>  scat_obj.plot_scatter(display=False, save=True, filename="MyPlot.png")
similar_frames(frame=1, P_threshold=0.01, P_type='adjP')#

List all statistically similar frames.

This method finds all statistically similar frames to any given frame using the CorMap test as outlined in Daniel Franke, Cy M Jeffries & Dmitri I Svergun (2015). The user can set the significance threshold as well as whether to use the Bonferroni corrected P values or not. (we recommend that you should use the Bonferroni corrected P values).

Parameters:
  • frame (int, optional (default=1)) – The frame that every other frame in the dataset is compared with. If not specified then all frames are compared to the first frame.

  • P_threshold (float, optional (default=0.01)) – The significance threshold of the test. If it’s not given then the default value is 1%.

  • P_type (str, optional (default="adjP")) – string denoting whether to use the Bonferroni corrected P value (input string=”adjP”) or the ordinary P value (input string=”P”). Default is to use the Bonferroni corrected P value.

Returns:

A list of integers corresponding to all of the similar frames

Return type:

List

Examples

Find all frames that are similar to frame 10

>>>  similar_frames = scat_obj.similar_frames(frame=10)
autowrap_text(textobj, renderer)#

Wraps the given matplotlib text object so that it exceed the boundaries of the axis it is plotted in.

crop_saxs_files(file_list, temp_dir_name, temp_file_prefix, first, last, smin, smax)#

Crop SAXS files.

Uses DATCROP from the ATSAS suite of programs to crop the SAXS Data.

min_dist_inside(point, rotation, box)#

Gets the space in a given direction from “point” to the boundaries of “box” (where box is an object with x0, y0, x1, & y1 attributes, point is a tuple of x,y, and rotation is the angle in degrees)

on_draw(event)#

Auto-wraps all text objects in a figure at draw-time.

parse_saxs_dat_file(filename, data_type, array_size=-1)#

Parse .dat file containing SAXS data.

run_system_command(command_string)#

Function used to run the system command and return the log