sansPotTools
index
sansPotTools.py


 

 
Functions
       
absScattLength(atom)

 
return the abs values of the atom's scattering length
    
create_SANSPot(instanceName, aSelection='all', experiment=0, normalizeIndex=-2, preweighted=True, numPoints=None, weightByExpt=False, globProtons=0, radiusScale=1, volumeScale=None, fractionD2O=1, exchangeFraction=0.90000000000000002, simulation=0)

 
create a solnScatPot.SolnScatPot term appropriate for refining
against solution neutron scattering data.
 
For efficient refinement against scattering curves, the experimental SANS
data should be extrapolated to q=0 and downsampled at constant spacing in
q. 
 
aSelection specifies the atoms which the SANS experiment measures.
 
normalizeIndex specifies which grid point to use to normalize data.
A value of -2 denotes average normalization
Other values mean no normalization. 
 
experiment is a string or filename which contains the lines of the form
q I(q) w(q)
the # symbol introduces a comment. If preweighted=False, the third
entry is standard deviation instead of a weight, and the weight is computed
as 1/sigma^2 if sigma!=0, else 0. If normalizeIndex>=0, sigma is also
normalized.
 
numPoints specifies the number of datapoints to sample. The experimental
I(q) and errors/weights are fit to cubic splines and sampled uniformly
over the entire range. No smoothing is performed.
 
If the q values are evenly spaced or numPoints is specified,
calcType is set to 'uniform'.
 
If weightByExpt is true, weights are multiplied by (I(0)/I(q))^2, where
I(q) is the scattering intensity at scattering amplitude q.
 
globProtons specifies whether or not to glob protons on to their bonded
heavy atoms
 
radiusScale specifies a radius correction factor
 
If specified, volumeScale is a separate scale factor for the effective
volume. If it is not specified, this scale factor will be consistent with
radiusScale
 
fractionD2O specifies the fraction of D2O
 
exchangeFraction specifies the percentage of exchangable protons which
actually exchange.
exchangableName(atom)

 
return True if the atom is a proton exchangable with solvent
    
exp(...)

 
exp(x)
 
Return e raised to the power of x.
groupProtons(sel='known')

 
return a list of heavy atom/proton groupings.
    
useGlobs(term, globTable=[], 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')], ...}, verbose=0)

 
set up solnScatPot.SolnScatPot term to use the atom globbing
approximation for solution X-ray scattering.
 
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 atoms to be globed.
 
Atoms in term.selection() which are not specified by globTable or by
globRules are placed into single-atom globs.

 
Data
        __package__ = None
exchangableProtons = {'ALA': ['HN'], 'ARG': ['HN', 'HE', 'HH21', 'HH22', 'HH11', 'HH12'], 'ASN': ['HN', 'HD21', 'HD22'], 'ASP': ['HN'], 'CYS': ['HN', 'HG'], 'GLN': ['HN', 'HE21', 'HE22'], 'GLU': ['HN'], 'GLY': ['HN'], 'HIS': ['HN', 'HD1'], 'ILE': ['HN'], ...}
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')], ...}
pi = 3.1415926535897931
scattLength = {'C': 0.66510000000000002, 'D': 0.66710000000000003, 'Fe': 0.95099999999999996, 'H': -0.37419999999999998, 'Mn': -0.35999999999999999, 'N': 0.93999999999999995, 'O': 0.58040000000000003, 'P': 0.51700000000000002, 'Pt': 0.94999999999999996, 'S': 0.28470000000000001}
solventVolume = {'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), ...}
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), ...}}