Commit c84fe5f3 authored by eric pellegrini's avatar eric pellegrini
Browse files

completed the oldnumeric removal

parent a09f317d
......@@ -10,15 +10,9 @@ import os, sys
compile_args = []
include_dirs = ['../../../../Include']
from Scientific import N
try:
num_package = N.package
except AttributeError:
num_package = "Numeric"
if num_package == "NumPy":
compile_args.append("-DNUMPY=1")
import numpy.distutils.misc_util
include_dirs.extend(numpy.distutils.misc_util.get_numpy_include_dirs())
compile_args.append("-DNUMPY=1")
import numpy.distutils.misc_util
include_dirs.extend(numpy.distutils.misc_util.get_numpy_include_dirs())
setup (name = "ElectricField",
version = "1.0",
......
......@@ -11,15 +11,9 @@ import os, sys
compile_args = []
include_dirs = ['../../../../Include']
from Scientific import N
try:
num_package = N.package
except AttributeError:
num_package = "Numeric"
if num_package == "NumPy":
compile_args.append("-DNUMPY=1")
import numpy.distutils.misc_util
include_dirs.extend(numpy.distutils.misc_util.get_numpy_include_dirs())
compile_args.append("-DNUMPY=1")
import numpy.distutils.misc_util
include_dirs.extend(numpy.distutils.misc_util.get_numpy_include_dirs())
setup (name = "ElectricField",
version = "1.0",
......
......@@ -10,15 +10,9 @@ import os, sys
compile_args = []
include_dirs = ['../../../../Include']
from Scientific import N
try:
num_package = N.package
except AttributeError:
num_package = "Numeric"
if num_package == "NumPy":
compile_args.append("-DNUMPY=1")
import numpy.distutils.misc_util
include_dirs.extend(numpy.distutils.misc_util.get_numpy_include_dirs())
compile_args.append("-DNUMPY=1")
import numpy.distutils.misc_util
include_dirs.extend(numpy.distutils.misc_util.get_numpy_include_dirs())
setup (name = "HarmonicOscillatorForceField",
version = "1.0",
......
......@@ -11,15 +11,9 @@ import os, sys
compile_args = []
include_dirs = ['../../../../Include']
from Scientific import N
try:
num_package = N.package
except AttributeError:
num_package = "Numeric"
if num_package == "NumPy":
compile_args.append("-DNUMPY=1")
import numpy.distutils.misc_util
include_dirs.extend(numpy.distutils.misc_util.get_numpy_include_dirs())
compile_args.append("-DNUMPY=1")
import numpy.distutils.misc_util
include_dirs.extend(numpy.distutils.misc_util.get_numpy_include_dirs())
setup (name = "HarmonicOscillatorForceField",
version = "1.0",
......
......@@ -6,20 +6,14 @@ import os, sys
compile_args = []
include_dirs = ['.']
from Scientific import N
try:
num_package = N.package
except AttributeError:
num_package = "Numeric"
if num_package == "NumPy":
compile_args.append("-DNUMPY=1")
if sys.platform == 'win32':
include_dirs.append(os.path.join(sys.prefix,
"Lib/site-packages/numpy/core/include"))
else:
include_dirs.append(os.path.join(sys.prefix,
"lib/python%s.%s/site-packages/numpy/core/include"
% sys.version_info [:2]))
compile_args.append("-DNUMPY=1")
if sys.platform == 'win32':
include_dirs.append(os.path.join(sys.prefix,
"Lib/site-packages/numpy/core/include"))
else:
include_dirs.append(os.path.join(sys.prefix,
"lib/python%s.%s/site-packages/numpy/core/include"
% sys.version_info [:2]))
setup (name = "MMTK-LangevinDynamics",
version = "2.7",
......
......@@ -8,9 +8,6 @@ import os, sys
compile_args = ['-g', '-O0']
include_dirs = ['.', '../../Include']
from Scientific import N
assert N.package == "NumPy"
compile_args.append("-DNUMPY=1")
include_dirs.extend(numpy.distutils.misc_util.get_numpy_include_dirs())
......
# Retrieve atomic fluctuation information from a PDBConfiguration object.
#
import numpy
from MMTK import *
from MMTK.PDB import PDBConfiguration
from Scientific import N
# Read a PDB file containing ANISOU records.
conf = PDBConfiguration('1G66.pdb')
......@@ -37,4 +38,4 @@ for c in conf.peptide_chains:
u_trace = pdb_atom.properties['u'].trace()/3. * Units.Ang**2
except KeyError:
u_trace = "[no ANISOU record]"
print atom, b_factor/(8*N.pi**2), u_trace
print atom, b_factor/(8*numpy.pi**2), u_trace
# A normal mode calculation in the subspace of residue rigid-body motion.
#
import numpy
from MMTK import *
from MMTK.Proteins import Protein
from MMTK.ForceFields import Amber94ForceField
......@@ -9,8 +11,6 @@ from MMTK.Subspace import RigidMotionSubspace
from MMTK.Minimization import ConjugateGradientMinimizer
from MMTK.Trajectory import StandardLogOutput
from Scientific import N
# Construct system
universe = InfiniteUniverse(Amber94ForceField())
universe.protein = Protein('bala1')
......@@ -38,8 +38,8 @@ for i in range(6, len(modes)):
overlap = []
for m2 in full_modes:
o = m1.massWeightedDotProduct(m2) / \
N.sqrt(m1.massWeightedDotProduct(m1)) / \
N.sqrt(m2.massWeightedDotProduct(m2))
numpy.sqrt(m1.massWeightedDotProduct(m1)) / \
numpy.sqrt(m2.massWeightedDotProduct(m2))
overlap.append(abs(o))
best = N.argsort(overlap)[-1]
best = numpy.argsort(overlap)[-1]
print m1.frequency, full_modes[best].frequency, overlap[best]
import numpy
from MMTK import *
from MMTK.Subspace import Subspace
from Scientific.Statistics.Histogram import WeightedHistogram, Histogram
from Scientific import N
#
# You ned to provide a mode file as input for this script; the
......@@ -22,13 +23,13 @@ for chain in protein:
dihedrals_with_index = zip(range(1, 1+len(dihedrals)), dihedrals)
helix_indices = [index for index, (phi, psi) in dihedrals_with_index
if 4.5 < phi < 5.8 and 5. < psi < 6.]
helix_indices = N.array(helix_indices)
breaks = N.repeat(N.arange(len(helix_indices)-1),
helix_indices = numpy.array(helix_indices)
breaks = numpy.repeat(numpy.arange(len(helix_indices)-1),
(helix_indices[1:]-helix_indices[:-1]) > 1)
breaks = N.concatenate(([0], breaks + 1))
breaks = numpy.concatenate(([0], breaks + 1))
backbone = chain.backbone()
for i in range(len(breaks)-1):
residues = N.take(backbone, helix_indices[breaks[i]:breaks[i+1]])
residues = numpy.take(backbone, helix_indices[breaks[i]:breaks[i+1]])
helices.append(Collection(list(residues)))
helices = [h for h in helices if len(h) > 4]
......@@ -41,7 +42,7 @@ for helix in helices:
cms, inertia = helix.centerAndMomentOfInertia()
moments, axes = inertia.diagonalization()
axes = [a.asVector() for a in axes]
helix_axis = axes[N.argmax([abs(end_to_end*v) for v in axes])]
helix_axis = axes[numpy.argmax([abs(end_to_end*v) for v in axes])]
hmv = ParticleVector(universe)
helix_motion_vectors.append(hmv)
for residue in helix:
......
......@@ -9,8 +9,6 @@ from MMTK.Subspace import Subspace
from MMTK.Minimization import ConjugateGradientMinimizer
from MMTK.Trajectory import StandardLogOutput
from Scientific import N
# Construct system
universe = InfiniteUniverse(Amber94ForceField())
universe.protein1 = Protein('bala1')
......
# Modify sidechain dihedral angles
#
import numpy
from MMTK import *
from MMTK.Proteins import Protein
from MMTK.Trajectory import Trajectory, SnapshotGenerator, TrajectoryOutput
from Scientific import N
# Construct system: lysozyme in vaccuum
universe = InfiniteUniverse()
......@@ -27,7 +28,7 @@ snapshot()
for residue in residues:
print residue
chi = residue.chiAngle()
for angle in N.arange(-N.pi, N.pi, N.pi/10.):
for angle in numpy.arange(-numpy.pi, numpy.pi, numpy.pi/10.):
chi.setValue(angle)
print angle
snapshot()
......
......@@ -9,10 +9,11 @@
# "full_trajectory.nc" below.
#
import numpy
from MMTK import *
from MMTK.Trajectory import Trajectory, TrajectoryOutput, SnapshotGenerator
from MMTK.Proteins import Protein, PeptideChain
from Scientific import N
# Open the input trajectory.
trajectory = Trajectory(None, 'full_trajectory.nc')
......@@ -62,7 +63,7 @@ first = 1
for step in trajectory:
conf = universe.contiguousObjectConfiguration(proteins,
step['configuration'])
conf_calpha = Configuration(universe_calpha, N.take(conf.array, map),
conf_calpha = Configuration(universe_calpha, numpy.take(conf.array, map),
None)
universe_calpha.setConfiguration(conf_calpha)
if first:
......
# Generate a protein backbone representation plus an indication
# of the principal axes of inertia by arrows.
#
import numpy
from MMTK import *
from MMTK.Proteins import Protein
from Scientific import N, LA
from Scientific import LA
# Import the graphics module. Substitute any other graphics
# module name to make the example use that module.
......@@ -16,7 +19,7 @@ center, inertia = protein.centerAndMomentOfInertia()
# Diagonalize the inertia tensor and scale the axes to a suitable length.
mass = protein.mass()
diagonal, directions = LA.eigenvectors(inertia.array)
diagonal = N.sqrt(diagonal/mass)
diagonal = numpy.sqrt(diagonal/mass)
# Generate the backbone graphics objects.
graphics = protein.graphicsObjects(graphics_module = module,
......
......@@ -24,7 +24,7 @@ cdef extern from "MMTK/arrayobject.h":
PyArray_Descr *descr
int flags
ctypedef class Scientific.N.ArrayType [object PyArrayObject]:
ctypedef class numpy.ndarray [object PyArrayObject]:
cdef char *data
cdef int nd
cdef int *dimensions, *strides
......
......@@ -7,9 +7,9 @@ color = 'black'
vdW_radius = 0.17
from Scientific import N
import numpy
b_coherent = (6.648 + (-3.741))*fm
b_incoherent = N.sqrt(0.285**2 + 25.217**2)*fm
b_incoherent = numpy.sqrt(0.285**2 + 25.217**2)*fm
b_coherent_deut = (6.648 + (6.674))*fm
b_incoherent_deut = N.sqrt(0.285**2 + 4.022**2)*fm
del N
b_incoherent_deut = numpy.sqrt(0.285**2 + 4.022**2)*fm
del numpy
......@@ -7,9 +7,9 @@ color = 'black'
vdW_radius = 0.17
from Scientific import N
import numpy
b_coherent = (6.648 + 2*(-3.741))*fm
b_incoherent = N.sqrt(0.285**2 + 2*25.217**2)*fm
b_incoherent = numpy.sqrt(0.285**2 + 2*25.217**2)*fm
b_coherent_deut = (6.648 + 2*6.674)*fm
b_incoherent_deut = N.sqrt(0.285**2 + 2*4.022**2)*fm
del N
b_incoherent_deut = numpy.sqrt(0.285**2 + 2*4.022**2)*fm
del numpy
......@@ -7,9 +7,9 @@ color = 'black'
vdW_radius = 0.17
from Scientific import N
import numpy
b_coherent = (6.648 + 3*(-3.741))*fm
b_incoherent = N.sqrt(0.285**2 + 3*25.217**2)*fm
b_incoherent = numpy.sqrt(0.285**2 + 3*25.217**2)*fm
b_coherent_deut = (6.648 + 3*6.674)*fm
b_incoherent_deut = N.sqrt(0.285**2 + 3*4.022**2)*fm
del N
b_incoherent_deut = numpy.sqrt(0.285**2 + 3*4.022**2)*fm
del numpy
import numpy
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',
......@@ -23,7 +24,7 @@ for r in residues:
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_coherent = %f*fm" % numpy.sqrt(bcoh_sq)
print "b_incoherent = %f*fm" % binc
print "b_coherent_deut = %f*fm" % sqrt(bcoh_deut_sq)
print "b_coherent_deut = %f*fm" % numpy.sqrt(bcoh_deut_sq)
print "b_incoherent_deut = %f*fm" % binc_deut
......@@ -4,9 +4,9 @@ mass = 15.014699
color = 'blue'
vdW_radius = 0.155000
from Scientific import N
import numpy
b_coherent = (9.300 + 1*(-3.741))*fm
b_incoherent = N.sqrt(2.241**2 + 1*25.217**2)*fm
b_incoherent = numpy.sqrt(2.241**2 + 1*25.217**2)*fm
b_coherent_deut = (9.300 + 1*6.674)*fm
b_incoherent_deut = N.sqrt(2.241**2 + 1*4.022**2)*fm
del N
b_incoherent_deut = numpy.sqrt(2.241**2 + 1*4.022**2)*fm
del numpy
......@@ -4,9 +4,9 @@ mass = 16.022675
color = 'blue'
vdW_radius = 0.155000
from Scientific import N
import numpy
b_coherent = (9.300 + 2*(-3.741))*fm
b_incoherent = N.sqrt(2.241**2 + 2*25.217**2)*fm
b_incoherent = numpy.sqrt(2.241**2 + 2*25.217**2)*fm
b_coherent_deut = (9.300 + 2*6.674)*fm
b_incoherent_deut = N.sqrt(2.241**2 + 2*4.022**2)*fm
del N
b_incoherent_deut = numpy.sqrt(2.241**2 + 2*4.022**2)*fm
del numpy
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment