varTensorTools
index
varTensorTools.py

tools for manipulation of tensors represented with 7 pseudo-atoms
 
this module presents functions to simplify the creation, manipulation and
analysis of varTensor.VarTensor objects, which are used to represent
orientation tensors.

 
Functions
       
VarTensor_analyze(potList)
perform analysis of VarTensor terms and return nicely formatted summary
addAxisAtoms(resid=-1, segid='')
 add atoms to the current structure. If the resid argument
    is omitted, a new number is automatically generated. If the
    segment name is omitted,  the default is used.  Initial coords
    for the various atoms are also generated.
 
    Returns a tuple of the segid and residue number.
    
calcTensor(vTensor, expts=0, coords=None, weights=None)
given a known structure, and a VarTensor object with associated
    experimental RDC or CSA terms, determine the orientation tensor, Da, and
    rhombicity. The Saupe matrix is returned. If there is an ensemble of
    structures, a single orientation tensor is calculated. Note when vTensor
    has multiple associated experiments: each term in the solution matrix is
    premultiplied by 1/sqrt( term.scale() ), so that the appropriate scaling
    is maintained.
 
    The optional expts argument specifies which RDC or CSA experiments to use
    in calculation of the tensor. If it is omitted, all expts associated with
    the tensor will be used in the tensor calculation.
 
    If coords is specified, it should be a sequence of sets of atomic
    coordinates (probably obtained from simulation.atomPosArr) to be 
    used in determination of the tensor. If the set has more than one
    coordinate set, the weights argument specifies the relative importance of
    each set (uniform weight if weights is not specified).
    
calcTensorOrientation(oTensor)

    given a known structure, and experimental RDCs, and 
    Da and rhombicity, determine the tensor orientation.
 
    All rdcs in oTensor.expts are used in determining the tensor.
 
    The Saupe matrix is returned.
    
calcTensor_ensemble(vTensor, expts=0, svdTolerance=0.01)
given a known structure, and a VarTensor object with associated
    experimental RDC or CSA terms, determine the orientation tensor, Da, and
    rhombicity. The Saupe matrix is returned. If there is an ensemble of
    structures, multiple alignment tensors are calculated. Note when vTensor
    has multiple associated experiments: each term in the solution matrix is
    premultiplied by 1/sqrt( term.scale() ), so that the appropriate scaling
    is maintained.
 
    The optional expts argument specifies which RDC or CSA experiments to use
    in calculation of the tensor. If it is omitted, all expts associated with
    the tensor will be used in the tensor calculation.
 
    svdTolerance specifies the size of the smallest singular value used in
    solving the linear equation. The equation for the unique elements of the
    Saupe tensor is
       t = v * diag * uT * b
    where v, diag and uT are results of SVD and b is a vector of observed
    measurements. diag is a diagonal matrix, the nonzero elements of which
    are reciprocals of singular values of a matrix composed of geometrical
    bond vector information. The elements of diag are set to zero if the
    absolute value of the corresponding singular value is less than
    svdTolerance times the average of the absoulte value of singular values.
    
configIVM(p, ivm)
first argument is an potential term containing a varTensor and the
    second is an IVM. This routine does the required initial topology setup.
configIVM_fix(p, ivm)
first argument is an RDCPot1 and the second is an IVM.
    this routine fixes all atoms such that the tensor does not vary.
configIVM_fixAxisToOther(p, ivm, pot2)
first argument is a VarTensor, the second an IVM, and the third another
    VarTensor.
    this routine does topology setup to fix the axis (tensor orientation)
    to that of another potential term.
configIVM_fixDa(p, ivm)
first argument is an RDCPot1 and the second is an IVM.
    this routine does topology setup for fixed Da.
configIVM_fixRh(p, ivm)
first argument is an RDCPot1 and the second is an IVM.
    this routine does topology setup for fixed Da.
configIVM_fixRhToOther(p, ivm, pot2)
first argument is a VarTensor, the second an IVM, and the third another
    VarTensor.
    this routine does topology setup for Rhombicity fixed to that of another
    potential term.
    NOTE: for this to work, the axes must also be fixed together. 
configIVM_varyDa(p, ivm)
first argument is an RDCPot1 and the second is an IVM.
    this routine does topology setup for varying Da.
 
    the o-p1 bond will rotate about an axis perpendicular to the
    y-o-p1 atom plane. since only the projection on the x-o-y plane is
    significant in the calculation of Da, o-p1 should always have
    zero-projection along the o-z axis.
    
configIVM_varyRh(p, ivm)
first argument is a VarTensor and the second is an IVM.
    this routine does topology setup for varying Rhombicity.
 
    the o-p2 bond will rotate about an axis perpendicular to the
    z-o2-p2 atom plane. Note that only the azimuthal angle p2-o2-z is
    considered in the calculation of Rh.
    
copyTensor(rdc1, rdc2)
copy positions of tensor atoms from rdc2 to rdc1
create_VarTensor(name, axis=0, esim=0)
create a VarTensor with given name, given segment and residue number
    associated with the axis atoms, and an ensemble simulation
    
ensembleTensorInfo(t)
 get info for all tensors of the ensemble
    
getVarTensors(potList)
 given a list of potential terms, return a list of unique VarTensor
    objects either in the list or refered to by another potential type.
    
massSetup(list, axisMass=300, pAtomFactor=3)

    appropriately setup tensor atom masses.
    tensor orientational atom's masses are set to axisMass, and
    the parameter atom masses are set to axisMass * pAtomFactor.
    
normalizedScalarProduct(t1, t2)
given two RDCPots determine the normalized tensor product
    J. Sass et. al. JACS 121, 2047-2055 (1999).
    
orthogonalize(t)
given a VarTensor t, check that the axis atoms are orthgonal. If not,
    print a warning message and then orthonalize.
    
saupeMatrix(t, eIndex=0)
given a VarTensor, calculate the associated Saupe matrix.
    The eIndex argument is used for ensembles in which members are allowed
    different alignment tensors.
scalarProd(t1, t2)
calculate the (unnormalized) tensor scalar product
syncAxisAtoms(t)
copy atoms representing orientation to member simulations>0
topologySetup(ivm, list)

    configure the given IVM object's topology setup using the freedom string
    for each VarTensor in list. This function should be called prior to
    ivm.IVM.autoTorsion() or protocol.torsionTopology()
 
    The freedom language contains the following keywords:
       fix
       fixDa, varyDa
       fixRh, varyRh
       fixAxisTo <name>
       fixRhTo <name>
 
    More than one can be specified, using a comma as a seperator.
    
xyzFromEuler(tensor, phi, theta, psi)
set the x, y, and z axes of tensor to correspond to the
    given Euler phi, theta and psi rotations (in radians)
    

 
Data
        current_axisResid = 500
current_axisSegid = 'AXIS'
parametersAdded = 0
psfTemplate = '\nstructure\nPSF\n\n 3 !NTITLE\n REMARKS auto... 0 !NGRP\n 0 0 0\nend \n'