code

=Solubility calculation code using NMR= = Code license: [|MIT License] =

Description
The following code is used in the web service described in the [|following post]and uses this [|SAMS template] [|SAMS template2] for JCAMP-DX file located anywhere (see [|blog post] for description) As [|described here], the method makes two assumptions:
 * no volume expansion or contraction upon mixing the solute and solvent
 * predicted densities of solid solutes are obtained from [|ChemSpider]

Requirements
PHP capable Web Server, [|JSpecView] (specifically jspecview.jar and JSVfunctions.js) and JCAMP-DX XY format spectra files.

Installation Instructions
Download and unzip the [|PHP files]. (latest version May 10, 2009). Change line 24 of intXY.php to reflect the URL of the spectra files on your server: Upload the JSpecView files, PHP files, and (XY format) spectra to your web server.
 * $str_file = "http://myserver.com/spectra/" . $str_file;**

Converting to JCAMP-DX XY Format
In order to use the code, you will need to export you spectra to XY format as follows:
 * 1) Export your spectra in JCAMP-DX format using your NMR machine's software.
 * 2) Open these JCAMP-DX files in JSpecView and save as JCAMP-DX XY format.

Displaying Spectra
Open up a web browser and enter something similar to: http://myserver.com/dspec.php?file=spectrum.jdx Where myserver.com is the url of your server and spectrum.jdx is the filename of your XY format spectrum file.

Integrating Peaks
Open up a web browser and enter something similar to: http://myserver.com/intXY.php?file=spectrum.jdx&l=1.0&u=2.0 Where myserver.com is the url of your server, spectrum.jdx is the filename of your spectrum file, and l and u are the upper and lower integration limits respectively (ppm). The code automatically accounts for linear baseline drift. Note: To improve performance on repeated calculations, store integral values in a database for easy recall.