Skip to content

JMB-Scripts/SAXS-Graphs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 

Repository files navigation

SAXS-Graphs

Regain control of your SAXS data. This Python script is designed to process SAXS (Small Angle X-ray Scattering) data and to generate results such as the Guinier approximation, the Kratky graph and the volume of correlation in a text file format. Then you can make YOUR OWN representations for these graphs, with YOUR preferred software (Excel, Prism, Origin etc.).

User manual

Prerequisites

  • Python 3.x
  • Necessary packages: numpy, matplotlib, scipy
  • SAXS Data need to be in Å-1

Command syntax

python Sexier-vXX.py filename.dat qmin_offset qmax_offset

  • filename.dat : the name of the .dat file containing the SAXS experimental data.
  • qmin_offset : the offset (in a number of lines) to be added to the first usable line to determine qmin, use the value from PRIMUS (Range) or RAW (nmin).
  • qmax_offset: the offset (in a number of lines) to be added to the first usable line to determine qmax use the value from PRIMUS (Range) or RAW (nmax).

Features

  1. Guinier approximation :
  • Read .dat file and determine a first usable line.
  • Data extraction for q and I(q) in the selected range.
  • Linear regression to calculate Rg (radius of gyration) and I0 (intensity at q=0).
  • Write data to text file.
  • Display graph with experimental points and theoretical curve.
  1. Kratky 2:
  • Extract data in the selected range for Kratky.
  • Calculation and normalisation of values for Kratky (𝑞𝑅𝑔)^2.𝐼(𝑞)/𝐼(0) vs 𝑞𝑅𝑔.
  • Write data to a text file.
  • Display Kratky graph.
  1. Correlation volume (CV):
  • Extract data up to q=0.3 or up to 8/Rg. Calculate the integral of the product I(q)*q.
  • Calculation of VC, QR (quality factor) and MW (molecular weight).
  • Calculation of the Mw from Porod using SAXSMOW approach with a cut at 8/Rg
  • Write data to text file.
  1. Summary file:
  • Write values for Rg, I0, qmin_Rg, qmax_Rg, MW to a text file.

Output

The script will generate the following files:

  • filename_01_Rg.txt: Guinier approximation data (q^2, ln(I_exp), ln(I_theo), normalized residuals)
  • file_name_02_Norm-Kratky.txt: data for normalized Kratky (x, y)
  • file_name_03_VC.txt: data for VC (q, I(q)*q)
  • file_name_04_VC_integral.txt: data for VC
  • file_name_05_Summary.txt: summary file (Rg, I0, qmin_Rg, qmax_Rg, MW)

image

Plots:

1- Form factor 2- Guinier Fit (Rg, I(0), qminRg qmaxRg,nbeg, nend) & Residuals of the fit (check aggregation and or repulsion, here looks nice) 3- Normalised Kratky plot (here presence of disordered regions) 4- Plot of the Volume of correlation and cumulative integral (MW determination at 0.3, 8/Rg and from Porod cut at 8/Rg)

Capture d’écran 2024-10-25 à 13 39 00

Notes:

  1. It's possible to make an exe file for Windows using "pyinstaller", to distribute the script on computers without Python.
  2. I can also provide the stand-alone version for Windows upon request.