Author: bugman Date: Fri Jun 1 16:11:03 2012 New Revision: 16593 URL: http://svn.gna.org/viewcvs/relax?rev=16593&view=rev Log: Converted a number of add_verbatim() calls to add_item_list_element() with items of None. This allows for proper formatting and indentation of equations. In the future, a possible add_equation() method might be added to provide text and LaTeX representations of equations in the user function documentation. Modified: branches/uf_redesign/user_functions/align_tensor.py branches/uf_redesign/user_functions/diffusion_tensor.py branches/uf_redesign/user_functions/palmer.py branches/uf_redesign/user_functions/spectrum.py Modified: branches/uf_redesign/user_functions/align_tensor.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/align_tensor.py?rev=16593&r1=16592&r2=16593&view=diff ============================================================================== --- branches/uf_redesign/user_functions/align_tensor.py (original) +++ branches/uf_redesign/user_functions/align_tensor.py Fri Jun 1 16:11:03 2012 @@ -258,9 +258,9 @@ uf.desc[-1].add_item_list_element("6", "{Pxx, Pyy, Pxy, Pxz, Pyz} (unitless),") uf.desc[-1].add_item_list_element("7", "{Pzz, Pxx-yy, Pxy, Pxz, Pyz} (unitless).") uf.desc[-1].add_paragraph("Other formats may be added later. The relationship between the Saupe order matrix S and the alignment tensor A is") -uf.desc[-1].add_verbatim(" S = 3/2 A.") +uf.desc[-1].add_item_list_element(None, "S = 3/2 A.") uf.desc[-1].add_paragraph("The probability matrix P is related to the alignment tensor A by") -uf.desc[-1].add_verbatim(" A = P - 1/3 I,") +uf.desc[-1].add_item_list_element(None, "A = P - 1/3 I,") uf.desc[-1].add_paragraph("where I is the identity matrix. For the alignment tensor to be supplied in Hertz, the bond vectors must all be of equal length.") # Prompt examples. uf.desc.append(Desc_container("Prompt examples")) Modified: branches/uf_redesign/user_functions/diffusion_tensor.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/diffusion_tensor.py?rev=16593&r1=16592&r2=16593&view=diff ============================================================================== --- branches/uf_redesign/user_functions/diffusion_tensor.py (original) +++ branches/uf_redesign/user_functions/diffusion_tensor.py Fri Jun 1 16:11:03 2012 @@ -176,9 +176,7 @@ uf.desc[-1].add_item_list_element("0", "{tm} (Default),") uf.desc[-1].add_item_list_element("1", "{Diso},") uf.desc[-1].add_paragraph("where") -uf.desc[-1].add_verbatim(""" - 1 / tm = 6Diso. -""") +uf.desc[-1].add_item_list_element(None, "1 / tm = 6Diso.") # The spheroid (axially symmetric diffusion). uf.desc.append(Desc_container("The spheroid (axially symmetric diffusion)")) uf.desc[-1].add_paragraph("When two of the three eigenvalues of the diffusion tensor are equal, the molecule diffuses as a spheroid. Four pieces of information are required to specify this tensor, the two geometric parameters, Diso and Da, and the two orientational parameters, the polar angle theta and the azimuthal angle phi describing the orientation of the axis of symmetry. The correlation function of the global diffusion is") @@ -190,17 +188,13 @@ i=-1 """) uf.desc[-1].add_paragraph("where") -uf.desc[-1].add_verbatim(""" - c-1 = 1/4 (3 dz^2 - 1)^2, - c0 = 3 dz^2 (1 - dz^2), - c1 = 3/4 (dz^2 - 1)^2, -""") +uf.desc[-1].add_item_list_element(None, "c-1 = 1/4 (3 dz^2 - 1)^2,") +uf.desc[-1].add_item_list_element(None, "c0 = 3 dz^2 (1 - dz^2),") +uf.desc[-1].add_item_list_element(None, "c1 = 3/4 (dz^2 - 1)^2,") uf.desc[-1].add_paragraph("and") -uf.desc[-1].add_verbatim(""" - 1 / tau -1 = 6Diso - 2Da, - 1 / tau 0 = 6Diso - Da, - 1 / tau 1 = 6Diso + 2Da. -""") +uf.desc[-1].add_item_list_element(None, "1 / tau -1 = 6Diso - 2Da,") +uf.desc[-1].add_item_list_element(None, "1 / tau 0 = 6Diso - Da,") +uf.desc[-1].add_item_list_element(None, "1 / tau 1 = 6Diso + 2Da.") uf.desc[-1].add_paragraph("The direction cosine dz is defined as the cosine of the angle alpha between the XH bond vector and the unique axis of the diffusion tensor.") uf.desc[-1].add_paragraph("To select axially symmetric anisotropic diffusion, the parameters argument should be a tuple of floating point numbers of length four. A tuple is a type of data structure enclosed in round brackets, the elements of which are separated by commas. Alternative sets of parameters, 'param_types', are") uf.desc[-1].add_item_list_element("0", "{tm, Da, theta, phi} (Default),") @@ -209,21 +203,15 @@ uf.desc[-1].add_item_list_element("3", "{Dpar, Dper, theta, phi},") uf.desc[-1].add_item_list_element("4", "{Diso, Dratio, theta, phi},") uf.desc[-1].add_paragraph("where") -uf.desc[-1].add_verbatim(""" - tm = 1 / 6Diso, - Diso = 1/3 (Dpar + 2Dper), - Da = Dpar - Dper, - Dratio = Dpar / Dper. -""") +uf.desc[-1].add_item_list_element(None, "tm = 1 / 6Diso,") +uf.desc[-1].add_item_list_element(None, "Diso = 1/3 (Dpar + 2Dper),") +uf.desc[-1].add_item_list_element(None, "Da = Dpar - Dper,") +uf.desc[-1].add_item_list_element(None, "Dratio = Dpar / Dper.") uf.desc[-1].add_paragraph("The spherical angles {theta, phi} orienting the unique axis of the diffusion tensor within the PDB frame are defined between") -uf.desc[-1].add_verbatim(""" - 0 <= theta <= pi, - 0 <= phi <= 2pi, -""") +uf.desc[-1].add_item_list_element(None, "0 <= theta <= pi,") +uf.desc[-1].add_item_list_element(None, "0 <= phi <= 2pi,") uf.desc[-1].add_paragraph("while the angle alpha which is the angle between this axis and the given XH bond vector is defined between") -uf.desc[-1].add_verbatim(""" - 0 <= alpha <= 2pi. -""") +uf.desc[-1].add_item_list_element(None, "0 <= alpha <= 2pi.") uf.desc[-1].add_paragraph("The 'spheroid_type' argument should be 'oblate', 'prolate', or None. The argument will be ignored if the diffusion tensor is not axially symmetric. If 'oblate' is given, then the constraint Da <= 0 is used while if 'prolate' is given, then the constraint Da >= 0 is used. If nothing is supplied, then Da will be allowed to have any values. To prevent minimisation of diffusion tensor parameters in a space with two minima, it is recommended to specify which tensor is to be minimised, thereby partitioning the two minima into the two subspaces along the boundary Da = 0.") # The ellipsoid (rhombic diffusion). uf.desc.append(Desc_container("The ellipsoid (rhombic diffusion)")) @@ -236,30 +224,22 @@ i=-2 """) uf.desc[-1].add_paragraph("where the weights on the exponentials are") -uf.desc[-1].add_verbatim(""" - c-2 = 1/4 (d + e), - c-1 = 3 dy^2 dz^2, - c0 = 3 dx^2 dz^2, - c1 = 3 dx^2 dy^2, - c2 = 1/4 (d + e). -""") +uf.desc[-1].add_item_list_element(None, "c-2 = 1/4 (d + e),") +uf.desc[-1].add_item_list_element(None, "c-1 = 3 dy^2 dz^2,") +uf.desc[-1].add_item_list_element(None, "c0 = 3 dx^2 dz^2,") +uf.desc[-1].add_item_list_element(None, "c1 = 3 dx^2 dy^2,") +uf.desc[-1].add_item_list_element(None, "c2 = 1/4 (d + e).") uf.desc[-1].add_paragraph("Let") -uf.desc[-1].add_verbatim(""" - R = sqrt(1 + 3Dr), -""") +uf.desc[-1].add_item_list_element(None, "R = sqrt(1 + 3Dr),") uf.desc[-1].add_paragraph("then") -uf.desc[-1].add_verbatim(""" - d = 3 (dx^4 + dy^4 + dz^4) - 1, - e = - 1 / R ((1 + 3Dr)(dx^4 + 2dy^2 dz^2) + (1 - 3Dr)(dy^4 + 2dx^2 dz^2) - 2(dz^4 + 2dx^2 dy^2)). -""") +uf.desc[-1].add_item_list_element(None, "d = 3 (dx^4 + dy^4 + dz^4) - 1,") +uf.desc[-1].add_item_list_element(None, "e = - 1 / R ((1 + 3Dr)(dx^4 + 2dy^2 dz^2) + (1 - 3Dr)(dy^4 + 2dx^2 dz^2) - 2(dz^4 + 2dx^2 dy^2)).") uf.desc[-1].add_paragraph("The correlation times are") -uf.desc[-1].add_verbatim(""" - 1 / tau -2 = 6Diso - 2Da . R, - 1 / tau -1 = 6Diso - Da (1 + 3Dr), - 1 / tau 0 = 6Diso - Da (1 - 3Dr), - 1 / tau 1 = 6Diso + 2Da, - 1 / tau 1 = 6Diso + 2Da . R. -""") +uf.desc[-1].add_item_list_element(None, "1 / tau -2 = 6Diso - 2Da . R,") +uf.desc[-1].add_item_list_element(None, "1 / tau -1 = 6Diso - Da (1 + 3Dr),") +uf.desc[-1].add_item_list_element(None, "1 / tau 0 = 6Diso - Da (1 - 3Dr),") +uf.desc[-1].add_item_list_element(None, "1 / tau 1 = 6Diso + 2Da,") +uf.desc[-1].add_item_list_element(None, "1 / tau 1 = 6Diso + 2Da . R.") uf.desc[-1].add_paragraph("The three direction cosines dx, dy, and dz are the coordinates of a unit vector parallel to the XH bond vector. Hence the unit vector is [dx, dy, dz].") uf.desc[-1].add_paragraph("To select fully anisotropic diffusion, the parameters argument should be a tuple of length six. A tuple is a type of data structure enclosed in round brackets, the elements of which are separated by commas. Alternative sets of parameters, 'param_types', are") uf.desc[-1].add_item_list_element("0", "{tm, Da, Dr, alpha, beta, gamma} (Default),") @@ -267,23 +247,17 @@ uf.desc[-1].add_item_list_element("2", "{Dx, Dy, Dz, alpha, beta, gamma},") uf.desc[-1].add_item_list_element("3", "{Dxx, Dyy, Dzz, Dxy, Dxz, Dyz},") uf.desc[-1].add_paragraph("where") -uf.desc[-1].add_verbatim(""" - tm = 1 / 6Diso, - Diso = 1/3 (Dx + Dy + Dz), - Da = Dz - (Dx + Dy)/2, - Dr = (Dy - Dx)/2Da. -""") +uf.desc[-1].add_item_list_element(None, "tm = 1 / 6Diso,") +uf.desc[-1].add_item_list_element(None, "Diso = 1/3 (Dx + Dy + Dz),") +uf.desc[-1].add_item_list_element(None, "Da = Dz - (Dx + Dy)/2,") +uf.desc[-1].add_item_list_element(None, "Dr = (Dy - Dx)/2Da.") uf.desc[-1].add_paragraph("The angles alpha, beta, and gamma are the Euler angles describing the diffusion tensor within the PDB frame. These angles are defined using the z-y-z axis rotation notation where alpha is the initial rotation angle around the z-axis, beta is the rotation angle around the y-axis, and gamma is the final rotation around the z-axis again. The angles are defined between") -uf.desc[-1].add_verbatim(""" - 0 <= alpha <= 2pi, - 0 <= beta <= pi, - 0 <= gamma <= 2pi. -""") +uf.desc[-1].add_item_list_element(None, "0 <= alpha <= 2pi,") +uf.desc[-1].add_item_list_element(None, "0 <= beta <= pi,") +uf.desc[-1].add_item_list_element(None, "0 <= gamma <= 2pi.") uf.desc[-1].add_paragraph("Within the PDB frame, the XH bond vector is described using the spherical angles theta and phi where theta is the polar angle and phi is the azimuthal angle defined between") -uf.desc[-1].add_verbatim(""" - 0 <= theta <= pi, - 0 <= phi <= 2pi. -""") +uf.desc[-1].add_item_list_element(None, "0 <= theta <= pi,") +uf.desc[-1].add_item_list_element(None, "0 <= phi <= 2pi.") uf.desc[-1].add_paragraph("When param_types is set to 3, then the elements of the diffusion tensor matrix defined within the PDB frame can be supplied.") # Units. uf.desc.append(Desc_container("Units")) Modified: branches/uf_redesign/user_functions/palmer.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/palmer.py?rev=16593&r1=16592&r2=16593&view=diff ============================================================================== --- branches/uf_redesign/user_functions/palmer.py (original) +++ branches/uf_redesign/user_functions/palmer.py Fri Jun 1 16:11:03 2012 @@ -142,7 +142,7 @@ uf.desc[-1].add_list_element("'dir/mfmodel'") uf.desc[-1].add_list_element("'dir/run.sh'") uf.desc[-1].add_paragraph("The file 'dir/run.sh' contains the single command,") -uf.desc[-1].add_verbatim("'modelfree4 -i mfin -d mfdata -p mfpar -m mfmodel -o mfout -e out',") +uf.desc[-1].add_item_list_element(None, "'modelfree4 -i mfin -d mfdata -p mfpar -m mfmodel -o mfout -e out',") uf.desc[-1].add_paragraph("which can be used to execute modelfree4.") uf.desc[-1].add_paragraph("If you would like to use a different Modelfree executable file, change the keyword argument 'binary' to the appropriate file name. If the file is not located within the environment's path, include the full path in front of the binary file name.") uf.backend = palmer.create Modified: branches/uf_redesign/user_functions/spectrum.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/spectrum.py?rev=16593&r1=16592&r2=16593&view=diff ============================================================================== --- branches/uf_redesign/user_functions/spectrum.py (original) +++ branches/uf_redesign/user_functions/spectrum.py Fri Jun 1 16:11:03 2012 @@ -126,7 +126,7 @@ # Peak heights with partially replicated spectra. uf.desc.append(Desc_container("Peak heights with partially replicated spectra")) uf.desc[-1].add_paragraph("When spectra are replicated, the variance for a single spin at a single replicated spectra set is calculated by the formula") -uf.desc[-1].add_verbatim(" sigma^2 = sum({Ii - Iav}^2) / (n - 1),") +uf.desc[-1].add_item_list_element(None, "sigma^2 = sum({Ii - Iav}^2) / (n - 1),") uf.desc[-1].add_paragraph("where sigma^2 is the variance, sigma is the standard deviation, n is the size of the replicated spectra set with i being the corresponding index, Ii is the peak intensity for spectrum i, and Iav is the mean over all spectra i.e. the sum of all peak intensities divided by n.") uf.desc[-1].add_paragraph("As the value of n in the above equation is always very low since normally only a couple of spectra are collected per replicated spectra set, the variance of all spins is averaged for a single replicated spectra set. Although this results in all spins having the same error, the accuracy of the error estimate is significantly improved.") uf.desc[-1].add_paragraph("If there are in addition to the replicated spectra loaded peak intensities which only consist of a single spectrum, i.e. not all spectra are replicated, then the variances of replicated replicated spectra sets will be averaged. This will be used for the entire experiment so that there will be only a single error value for all spins and for all spectra.") @@ -136,9 +136,9 @@ # Peak volumes with baseplane noise RMSD. uf.desc.append(Desc_container("Peak volumes with baseplane noise RMSD")) uf.desc[-1].add_paragraph("The method of error analysis when no spectra have been replicated and peak volumes are used is highly dependent on the integration method. Many methods simply sum the number of points within a fixed region, either a box or oval object. The number of points used, N, must be specified by another user function in this class. Then the error is simply given by the sum of variances:") -uf.desc[-1].add_verbatim(" sigma_vol^2 = sigma_i^2 * N,") +uf.desc[-1].add_item_list_element(None, "sigma_vol^2 = sigma_i^2 * N,") uf.desc[-1].add_paragraph("where sigma_vol is the standard deviation of the volume, sigma_i is the standard deviation of a single point assumed to be equal to the RMSD of the baseplane noise, and N is the total number of points used in the summation integration method. For a box integration method, this converts to the Nicholson, Kay, Baldisseri, Arango, Young, Bax, and Torchia (1992) Biochemistry, 31: 5253-5263 equation:") -uf.desc[-1].add_verbatim(" sigma_vol = sigma_i * sqrt(n*m),") +uf.desc[-1].add_item_list_element(None, "sigma_vol = sigma_i * sqrt(n*m),") uf.desc[-1].add_paragraph("where n and m are the dimensions of the box. Note that a number of programs, for example peakint (http://hugin.ethz.ch/wuthrich/software/xeasy/xeasy_m15.html) does not use all points within the box. And if the number N can not be determined, this category of error analysis is not possible.") uf.desc[-1].add_paragraph("Also note that non-point summation methods, for example when line shape fitting is used to determine peak volumes, the equations above cannot be used. Hence again this category of error analysis cannot be used. This is the case for one of the three integration methods used by Sparky (http://www.cgl.ucsf.edu/home/sparky/manual/peaks.html#Integration). And if fancy techniques are used, for example as Cara does to deconvolute overlapping peaks (http://www.cara.ethz.ch/Wiki/Integration), this again makes this error analysis impossible.") # Peak volumes with partially replicated spectra.