text: user9383: I am doing my research on nanobodies. Currently, I am trying to do a comparison study of the flexibility of CDR loops using B-factor values. I would like to know if there is any statistical analysis tool for this or if anyone has done anything similar.
  
  user6322: So B-factors, for "blur factors", are how much movement an atom has in the crystal structure. They are not reliable. B-factor putty in PyMOL is the most you should push them.
  B-factors bad
  This is partly a result of flexibility, but it is highly influenced by crystal packing, which is not natural. Many enzymes, for example, are seen with an active site entrance way that is closed up in a crystal structure whereas in an MD run there is a gate loop that flops around.
  Additionally, a B-factor is a single value that masks lots of forms of movement. Partial occupancy after all is at the discretion of the experimenter, so you might even have a residue in two or three low energy states that result nevertheless in B-factor disorder.
  Furthermore, incorrectly fitted residues will have a higher B-factor.
  Also, the meaning of B-factor are mighty cryptic, and depend on the refinement —the units are Å^2 as opposed to say Å, like a standard deviation.
  MD RMSF good
  The best way to determine the movement of a residue is to do an MD run. Gromacs has very nice tutorial and is the most accessible.
  The metric in that case is the RMSF, which is the RMSD relative to the average. Gromacs has a utility for it called rmsf. Alternatively RMSD relative to your original structure is fine —but less of a metric of movement.
  MD is complained about for three reasons, none are valid here:
  
  Tricky to set up: this is a straightforward case
  Lengthy: You would not be after large scale conformational changes so a limited amount of steps would suffice —possibly even on a laptop on a single core for a couple of hours (cluster is always better though!). Running at different temperatures and switching the intermediate steps (replica exchange) is often done to speed things up, but would just confuse the results.
  Small molecules: A nanobody has no cofactors or small molecule ligands so you'd avoid the topology parameterisation issues. If Eukaryotic made, your nanobodies may be glycosylated — play it safe and ignore.
  
  B-factor extraction
  If you want to extract the B-factors, you can use pymol as a python module —installed with conda and not the binary/exe installer. And use python as follows:
  pdb_filename = ""
  selector = "name CA"
  import pymol2
  with pymol2.PyMOL() as pymol:
       pymol.cmd.load(pdb_filename)
       bfactors = {atom.resi: atom.b for atom in pymol.cmd.get_model(selector).atom}
  
  From there do whatever you fancy with the b-factors. For alternative selector strings see Pymol selection algebra. One operation is to divide the values by 8 pi^2 and take the square root of that, which is the amplitude of oscillation (U) of the atom around its equilibrium position —ie. that stated in the coordinates.
  
original_text: 9383: <p>I am doing my research on nanobodies. Currently, I am trying to do a comparison study of the flexibility of CDR loops using B-factor values. I would like to know if there is any statistical analysis tool for this or if anyone has done anything similar.</p>
   6322: <p>So B-factors, for &quot;blur factors&quot;, are how much movement an atom has in the crystal structure. They are not reliable. B-factor putty in PyMOL is the most you should push them.</p>
  <h2>B-factors bad</h2>
  <p>This is partly a result of flexibility, but it is highly influenced by crystal packing, which is not natural. Many enzymes, for example, are seen with an active site entrance way that is closed up in a crystal structure whereas in an MD run there is a gate loop that flops around.</p>
  <p>Additionally, a B-factor is a single value that masks lots of forms of movement. Partial occupancy after all is at the discretion of the experimenter, so you might even have a residue in two or three low energy states that result nevertheless in B-factor disorder.</p>
  <p>Furthermore, incorrectly fitted residues will have a higher B-factor.</p>
  <p>Also, the meaning of B-factor are mighty cryptic, and depend on the refinement —the units are Å^2 as opposed to say Å, like a standard deviation.</p>
  <h2>MD RMSF good</h2>
  <p>The best way to determine the movement of a residue is to do an MD run. <a href="http://www.gromacs.org/" rel="nofollow noreferrer">Gromacs</a> has very nice tutorial and is the most accessible.
  The metric in that case is the RMSF, which is the RMSD relative to the average. Gromacs has a <a href="http://manual.gromacs.org/documentation/5.1/onlinehelp/gmx-rmsf.html" rel="nofollow noreferrer">utility for it called rmsf</a>. Alternatively RMSD relative to your original structure is fine —but less of a metric of movement.
  MD is complained about for three reasons, none are valid here:</p>
  <ul>
  <li>Tricky to set up: this is a straightforward case</li>
  <li>Lengthy: You would not be after large scale conformational changes so a limited amount of steps would suffice —possibly even on a laptop on a single core for a couple of hours (cluster is always better though!). Running at different temperatures and switching the intermediate steps (replica exchange) is often done to speed things up, but would just confuse the results.</li>
  <li>Small molecules: A nanobody has no cofactors or small molecule ligands so you'd avoid the topology parameterisation issues. If Eukaryotic made, your nanobodies may be glycosylated — play it safe and ignore.</li>
  </ul>
  <h2>B-factor extraction</h2>
  <p>If you want to extract the B-factors, you can use pymol as a python module —<a href="https://anaconda.org/schrodinger/pymol" rel="nofollow noreferrer">installed with conda</a> and not the binary/exe installer. And use python as follows:</p>
  <pre><code>pdb_filename = &quot;&quot;
  selector = &quot;name CA&quot;
  import pymol2
  with pymol2.PyMOL() as pymol:
       pymol.cmd.load(pdb_filename)
       bfactors = {atom.resi: atom.b for atom in pymol.cmd.get_model(selector).atom}
  </code></pre>
  <p>From there do whatever you fancy with the b-factors. For alternative selector strings see <a href="https://pymolwiki.org/index.php/Selection_Algebra" rel="nofollow noreferrer">Pymol selection algebra</a>. One operation is to divide the values by 8 pi^2 and take the square root of that, which is the amplitude of oscillation (U) of the atom around its equilibrium position —ie. that stated in the coordinates.</p>
  