File: deut.py

package info (click to toggle)
mmtk 2.7.9-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 11,788 kB
  • ctags: 6,600
  • sloc: python: 18,050; ansic: 12,400; makefile: 129; csh: 3
file content (29 lines) | stat: -rw-r--r-- 1,112 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from MMTK import *
from MMTK.ChemicalObjects import Group
from Scientific.N import sqrt

residues = ['alanine', 'arginine', 'asparagine', 'aspartic_acid',
            'cysteine', 'cystine_ss', 'glutamic_acid', 'glutamine',
            'glycine', 'histidine', 'histidine_deltah',
            'histidine_epsilonh', 'histidine_plus', 'isoleucine',
            'leucine', 'lysine', 'methionine', 'phenylalanine',
            'proline', 'serine', 'threonine', 'tryptophan',
            'tyrosine', 'valine']

for r in residues:
    binc = 0.
    binc_deut = 0.
    bcoh_sq = 0.
    bcoh_deut_sq = 0.
    mass = 0.
    for a in Group(r).atomList():
        binc = binc + a.b_incoherent/Units.fm
        binc_deut = binc_deut + a.b_incoherent_deut/Units.fm
        bcoh_sq = bcoh_sq + (a.b_coherent/Units.fm)**2
        bcoh_deut_sq = bcoh_deut_sq + (a.b_coherent_deut/Units.fm)**2
        mass = mass + a.mass()
    print r
    print "b_coherent = %f*fm" % sqrt(bcoh_sq)
    print "b_incoherent = %f*fm" % binc
    print "b_coherent_deut = %f*fm" % sqrt(bcoh_deut_sq)
    print "b_incoherent_deut = %f*fm" % binc_deut