Subsections

 
7.5 Creating New Columns

Figure 7.4: Creating a new column from an expression
 
[Creating a new column] createcolumn.png [Using a math function in the expression] createstupidcolumn.png [Referencing another column] createstupidcolumn2.png

New columns can be added to the spreadsheet containing values that are based on or calculated from molecular properties or existing spreadsheet data. To create a new columns, select the ``Create Column" option in the top level Data menu. This will launch a dialog to guide the process and can be seen in Figure 7.4.

The text entry field at the top contains the name for the new column. A new, empty and editable column can be easily be created by supplying a new column name and then clicking the ``Create" button.

Beneath the name is a collection of three drop down boxes containing functions which can be used in building the expression to be evaluated when populating the column. The first drop down box contains a collection of available mathematical functions which can be used in the expression (see Section 7.5.1 for more details). The second drop down box contains a collection of available molecular properties that can be used in the expression (see Section 7.5.2 for more details). The last drop down box contains a list of the other already existing columns which can be used as part of the expression.

Any of the above described functions can be added to the expression simply by selecting them in the appropriate drop down box. If that function requires additional input (such as functions like cos), the cursor in the expression editor window will automatically be placed inside the function. Functions can be combined with standard math operators such as *, +, -, and . If a function requires additional input that is not provided, an error will be displayed in the Test section at the bottom of the dialog as seen in Figure 7.4(b). Frequently, the desired input is contained within another column which can be referenced by selecting the desired column from the third drop down box or simply by typing ``COL(`COLUMN NAME')" as seen in Figure 7.4(c).

Once the desired expression has been assembled, the column can be created and added to the spreadsheet by clicking on the ``Create" button.

 
7.5.1 Math Functions


Table 7.1: Available math functions
Name Description
   
acos(x) Return the arc cosine (measured in radians) of x.
asin(x) Return the arc sine (measured in radians) of x.
atan(x) Return the arc tangent (measured in radians) of x.
atan2(y,x) Return the arc tangent (measured in radians) of y/x.
  Unlike atan(y/x), the signs of both x and y are considered.
ceil(x) Return the ceiling of x as a float. This is the smallest integral value >= x.
cos(x) Return the cosine of x (measured in radians).
cosh(x) Return the hyperbolic cosine of x.
degrees(x) Converts angle x from radians to degrees.
e The numeric constant ``e'' or 2.7182818284590451.
exp(x) Return $e^x$.
fabs(x) Return the absolute value of the float x.
floor(x) Return the floor of x as a float. This is the largest integral value <= x.
fmod (x,y) Return the floating point remainder of x/y.
hypot(x,y) Return the Euclidean distance: $\sqrt{x*x + y*y}$.
ldexp(x,y) Returns $x * 2^i$.
log(x[,base]) The logarithm of x to the given base. If the base is not specified, returns ln(x).
log10(x) The base 10 logarithm of x.
pi The numeric constant PI or 3.1415926535897931.
pow(x,y) Return $x^y$.
radians(x) Converts angle x from degrees to radians.
sin(x) Return the sine of x (measured in radians).
sinh(x) Return the hyperbolic sine of x.
sqrt(x) Return $\sqrt{x}$.
tan(x) Return the tangent of x (measured in radians).
tanh(x) Return the hyperbolic tangent of x.


A large number of math functions are available for use in spreadsheet expressions as described in the previous section. The currently available math functions can be found in Table 7.1.

 
7.5.2 OEChem Functions


Table 7.2: Available molecular properties
Name Property
   
MW Molecular weight.
Num Atoms Number of atoms in the molecule.
Num Bonds Number of bonds in the molecule.
Carbon-Hetero Ratio Ratio of carbons to hetero atoms in the molecule.
  Returns 1 if there are no carbons in the molecule.
Energy Molecular energy of the molecule as specified in the input file.
Actual Charge Sum of the partial charges on all atoms.
Formal Charge Sum of the formal charges on all atoms.
Halide Count Number of halogen atoms in the molecule.
Num Carbons Number of carbon atoms in the molecule.
Num Formal Charges Number of atoms with a specified formal charge.
Num Heavy Atoms Number of heavy atoms (non hydrogen) in the molecule.
Num Hetero Atoms Number of hetero atoms in the molecule.
Num Hydrogens Number of hydrogen atoms in the molecule.
Num Rigid Bonds Number of rigid bonds in the molecule.
Nom Rotatable Bonds Number of rotatable bonds in the molecule.
Num Chiral Atoms Number of chiral atoms in the molecule.
Num Chiral Bonds Number of chiral bonds in the molecule.


A large number of molecular properties are available for use in spreadsheet expressions as described above. The currently available molecular properties can be found in Table 7.2.