solnScatPotTools
index
solnScatPotTools.py


 
tools to aid in setup/analysis of potential terms employing solution
scattering data.
 
this module provides functions to simplify the analysis of
solnScatPot.SolnScatPot potential terms.  

 
Classes
       
Interp

 
class Interp
   
 
class for linear interpoation (/extrapolation)
 
  Methods defined here:
__call__(s, x)

 
return the result of interpolation (/extrapolation) to the point x.
__init__(s, listOfTuples)

 
specify a list of (x,y) pairs sorted such that the x values are
monotonically increasing.

 
Functions
       
Pr(numBins, rMax, selection='known', weights=None)

 
return the unnormalized pairwise distance distribution function.
 
numBins specifies the granulaity of the distribution, and rMax specifies
the upper distance cutoff.
 
The calculation is performed using all atoms in selection
  [all atoms whose positions have been defined, by default].
 
The optional weights array specifies a weight for each atom.
SolventAtomParams(volume=-1, radius=-1)

 
analyze(potList)

 
perform analysis of SolnScatPot terms and return nicely formatted
summary.
A Chi^2 value is calculated based on the assumption that the weights are
1/sigma_i^2, where sigma_i is the error in the observed value of I_i.
 
The deviation value should be nonzero only for EnsembleSimulation
calculations with Ne>1. It is calculated as
 
Dev^2 = 1/Ne 1/Nk \sum_i \sum_j w_j * (I_ij-I_j)^2
 
where Nk is the number of datapoints and all values of I are normalized by
calcdScale, and multiplied by globCorrect.
analyze_chi2(term)

 
compute the Chi^2 value for the solnScatPot.SolnScatPot term
argument.
chi2(weights, I, expt, normalizeIndex=-3)

 
return chi^2 using the specified normalization method
fitParams(scat, r0Start=None, r0End=None, r0Num=None, V0Start=None, V0End=None, V0Num=None, rhobStart=None, rhobEnd=None, rhobNum=None, writer=None, verbose=False)

 
given a SolnScatPot instance, optimize the boundary layer
solvent density, the excluded volume effective radius, and excluded
volume parameters. These parameters are the same as those optimized in
the crysol program (J. Appl. Cryst. 28, 768-773 (1995)]
 
scat is a SolnScatPot instance
 
   r0Start=0.9,  r0End=1.1,    r0Num=21,
   V0Start=0.92, V0End=1.08,   V0Num=21,
   rhobStart=0,  rhobEnd=0.02, rhobNum=20,
 
specify the ranges for the three fitting parameters r0, V0 and rhob.
The r0 and V0 parameters specify a multiplicative factors relative to
rm and Vm, respectively. Default values are specified above.
 
If writer is specified, it should be a function to take informational
output.
interpolateCurve(experiment, weights, numPoints)

 
given a curve with elements (q,I) and corresponding weights, return the
corresponding linearly interpolated curves sampled uniformly over
numPoints.
normalize(weights, I, expt, normalizeIndex)

 
    
splineCurve(experiment, weights, numPoints)

 
given a curve with elements (q,I) and corresponding weights, return the
corresponding splined curves sampled uniformly over numPoints.
useGlobs(term, globTable=[], globRules=[], verbose=0, weightFunction=<function <lambda> at 0x1fef5f0>)

 
set up solnScatPot.SolnScatPot term to use the atom globbing
approximation.
 
globTable contains a list of list of atoms with in user-defined globs.
Atoms not specified in globTable are glob'ed by the pre-residue definitions
in the globRules dictionary.
 
globRules is a dictionary whose keys are upper case residue names
each entry containing a list of list of atom names to be globed.
 
weightFunction takes an atom as an argument and returns the relative
weight to give it within the glob.
 
Atoms in term.selection() which are not specified by globTable or by
globRules are placed into single-atom globs.

 
Data
        __package__ = None
globRules = {'ADE': [('P', 'O1P', 'O2P'), ("O5'", "C5'"), ("O3'", "C3'"), ("O4'", "C4'"), ("C1'", "C2'"), ('N1', 'C2'), ('N3', 'C4'), ('C5', 'C6', 'N6'), ('N7', 'C8', 'N9')], 'ALA': [('C', 'O', 'N', 'HN'), ('CA', 'HA', 'CB', 'HB1', 'HB2', 'HB3')], 'ARG': [('C', 'O', 'N', 'HN'), ('CA', 'HA', 'CB', 'HB1', 'HB2', 'CG', 'HG1', 'HG2'), ('CD', 'HD1', 'HD2', 'NE', 'HE', 'CZ', 'NH1', 'NH2', 'HH11', 'HH12', 'HH21', 'HH22')], 'ASN': [('C', 'O', 'N', 'HN'), ('CA', 'HA', 'CB', 'HB1', 'HB2'), ('CG', 'OD1', 'ND2', 'HD21', 'HD22')], 'ASP': [('C', 'O', 'N', 'HN'), ('CA', 'HA', 'CB', 'HB1', 'HB2'), ('CG', 'OD1', 'OD2')], 'CYS': [('C', 'O', 'N', 'HN'), ('CA', 'HA', 'CB', 'HB1', 'HB2', 'SG', 'HG')], 'CYT': [('P', 'O1P', 'O2P'), ("O5'", "C5'"), ("O3'", "C3'"), ("O4'", "C4'"), ("C1'", "C2'"), ('N1', 'C2', 'O2'), ('N3', 'C4', 'N4'), ('C5', 'C6')], 'GLN': [('C', 'O', 'N', 'HN'), ('CA', 'HA', 'CB', 'HB1', 'HB2', 'CG', 'HG1', 'HG2'), ('CD', 'OE1', 'NE2', 'HE21', 'HE22')], 'GLU': [('C', 'O', 'N', 'HN'), ('CA', 'HA', 'CB', 'HB1', 'HB2', 'CG', 'HG1', 'HG2'), ('CD', 'OE1', 'OE2')], 'GLY': [('C', 'O', 'N', 'HN'), ('CA', 'HA1', 'HA2')], ...}
params = {'Br': (26.52, 1.6824786822618245), 'C': (16.440000000000001, 1.4345829602682996), 'CH': (21.59, 1.5709991296307175), 'CH2': (26.739999999999998, 1.6871182809580803), 'CH3': (31.890000000000001, 1.7891355151247366), 'Ca': (31.890000000000001, 1.7891355151247366), 'Cl': (22.449999999999999, 1.5915874724077386), 'Cu(2)': (9.1999999999999993, 1.1821910653824932), 'Fe(2)': (8.3000000000000007, 1.1423111811746613), 'Fe(3)': (8.3000000000000007, 1.1423111811746613), ...}
solventParamSets = {'svergun': {'C': (16.52189547022142, 1.5800000000000001), 'CH': (21.688370252755973, 1.73), 'CH2': (26.521848780380633, 1.8500000000000001), 'CH3': (32.024863534338337, 1.97), 'Ca': (32.024863534338337, 1.97), 'Cu': (8.7845297555481903, 1.28), 'Fe': (7.9864479354106468, 1.24), 'H': (5.131448118842135, 1.0700000000000001), 'MN': (9.2027720799157002, 1.3), 'Mg': (17.157284678805059, 1.6000000000000001), ...}, 'tiede': {'Br': (26.52, 1.6824786822618245), 'C': (9.0, 1.1735616258720787), 'CH': (20.0, 1.5314461446813734), 'CH2': (21.0, 1.5565562821123009), 'CH3': (33.0, 1.8096574578554767), 'Ca': (31.0, 1.7723342420376789), 'Cl': (22.449999999999999, 1.5915874724077386), 'Cu(2)': (9.1999999999999993, 1.1821910653824932), 'Fe(2)': (8.3000000000000007, 1.1423111811746613), 'Fe(3)': (8.3000000000000007, 1.1423111811746613), ...}, 'xiaobing': {'Br': (26.52, 1.6824786822618245), 'C': (16.440000000000001, 1.4345829602682996), 'CH': (21.59, 1.5709991296307175), 'CH2': (26.739999999999998, 1.6871182809580803), 'CH3': (31.890000000000001, 1.7891355151247366), 'Ca': (31.890000000000001, 1.7891355151247366), 'Cl': (22.449999999999999, 1.5915874724077386), 'Cu(2)': (9.1999999999999993, 1.1821910653824932), 'Fe(2)': (8.3000000000000007, 1.1423111811746613), 'Fe(3)': (8.3000000000000007, 1.1423111811746613), ...}}
solventVolumeSets = {'svergun': {'C': (16.52189547022142, 1.5800000000000001), 'CH': (21.688370252755973, 1.73), 'CH2': (26.521848780380633, 1.8500000000000001), 'CH3': (32.024863534338337, 1.97), 'Ca': (32.024863534338337, 1.97), 'Cu': (8.7845297555481903, 1.28), 'Fe': (7.9864479354106468, 1.24), 'H': (5.131448118842135, 1.0700000000000001), 'MN': (9.2027720799157002, 1.3), 'Mg': (17.157284678805059, 1.6000000000000001), ...}, 'tiede': {'Br': (26.52, 1.6824786822618245), 'C': (9.0, 1.1735616258720787), 'CH': (20.0, 1.5314461446813734), 'CH2': (21.0, 1.5565562821123009), 'CH3': (33.0, 1.8096574578554767), 'Ca': (31.0, 1.7723342420376789), 'Cl': (22.449999999999999, 1.5915874724077386), 'Cu(2)': (9.1999999999999993, 1.1821910653824932), 'Fe(2)': (8.3000000000000007, 1.1423111811746613), 'Fe(3)': (8.3000000000000007, 1.1423111811746613), ...}, 'xiaobing': {'Br': (26.52, 1.6824786822618245), 'C': (16.440000000000001, 1.4345829602682996), 'CH': (21.59, 1.5709991296307175), 'CH2': (26.739999999999998, 1.6871182809580803), 'CH3': (31.890000000000001, 1.7891355151247366), 'Ca': (31.890000000000001, 1.7891355151247366), 'Cl': (22.449999999999999, 1.5915874724077386), 'Cu(2)': (9.1999999999999993, 1.1821910653824932), 'Fe(2)': (8.3000000000000007, 1.1423111811746613), 'Fe(3)': (8.3000000000000007, 1.1423111811746613), ...}}