IMP logo
saxs examples

profile

In this example, we read a protein from a PDB file and experimental profile file. Next we compute the theoretical profile from the PDB file and fit it to the experimental one.

This application is available as a web service at salilab.org/foxs. It is also available as C++ code in IMP/applications.

The experimental data for lysozyme is taken from crysol program (www.embl-hamburg.de/ExternalInfo/Research/Sax/crysol.html)

import IMP
import IMP.atom
import IMP.core
import IMP.saxs
import os
m = IMP.Model()
#! read PDB
mp= IMP.atom.read_pdb(IMP.saxs.get_example_path('6lyz.pdb'), m,
#! read experimental profile
exp_profile = IMP.saxs.Profile(IMP.saxs.get_example_path('lyzexp.dat'))
print 'min_q = ' + str(exp_profile.get_min_q())
print 'max_q = ' + str(exp_profile.get_max_q())
print 'delta_q = ' + str(exp_profile.get_delta_q())
#! select particles from the model
particles = IMP.atom.get_by_type(mp, IMP.atom.ATOM_TYPE)
#! calculate SAXS profile
model_profile = IMP.saxs.Profile()
model_profile.calculate_profile(particles)
model_profile.write_SAXS_file('6lyz.dat')
#! calculate chi score (should be ~0.5 for this example)
saxs_score = IMP.saxs.Score(exp_profile)
chi = saxs_score.compute_chi_score(model_profile)
print 'Chi = ' + str(chi)
#! convert to p(r)
model_profile.profile_2_distribution(pr, 48.0)
pr.normalize()
pr.show()

profile fit

In this example, we read a protein from a PDB file and experimental profile file. Next we compute the theoretical profile from the PDB file and fit it to the experimental one. Unlike in profile.py example, here we fit the profile with adjustment of the excluded volume and hydration layer density of the molecule.

This application is available as a web service at salilab.org/foxs. It is also available as C++ code in IMP/applications.

The experimental data for lysozyme is taken from crysol program (www.embl-hamburg.de/ExternalInfo/Research/Sax/crysol.html)

import IMP
import IMP.atom
import IMP.core
import IMP.saxs
import os
m = IMP.Model()
#! read PDB
mp= IMP.atom.read_pdb(IMP.saxs.get_example_path('6lyz.pdb'), m,
#! read experimental profile
exp_profile = IMP.saxs.Profile(IMP.saxs.get_example_path('lyzexp.dat'))
print 'min_q = ' + str(exp_profile.get_min_q())
print 'max_q = ' + str(exp_profile.get_max_q())
print 'delta_q = ' + str(exp_profile.get_delta_q())
#! select particles from the model
particles = IMP.atom.get_by_type(mp, IMP.atom.ATOM_TYPE)
#! add radius for water layer computation
for i in range(0, len(particles)):
radius = ft.get_radius(particles[i])
IMP.core.XYZR.setup_particle(particles[i], radius)
# compute surface accessibility
surface_area = s.get_solvent_accessibility(IMP.core.XYZRs(particles))
#! calculate SAXS profile
delta_q = 0.5 / 500
model_profile = IMP.saxs.Profile(0.0, 0.5, delta_q)
model_profile.calculate_profile_partial(particles, surface_area)
model_profile.write_SAXS_file('6lyz.dat')
#! calculate chi score (should be ~0.5 for this example)
saxs_score = IMP.saxs.Score(exp_profile)
chi = saxs_score.compute_chi_score(model_profile)
print 'Chi without parameter fitting = ' + str(chi)
chi = (saxs_score.fit_profile(model_profile)).get_chi()
print 'Chi after adjustment of excluded volume and water layer parameters = ' + str(chi)


Generated on Tue May 22 2012 23:33:21 for IMP by doxygen 1.8.1