/* ImmunoAssayExampleThree * * An example program illustrating the use of the ImmunoAssay class * This example reads the assay data from a text file, * selects, via a dialogue box, an equation to which the data is fitted * and prints an analysis to a text file. * * Mick Flanagan * 7 February 2011 */ import flanagan.physchem.ImmunoAssay; import flanagan.io.Db; public class ImmunoAssayExampleThree{ public static void main(String[] args){ // Create an instance of ImmunoAssay ImmunoAssay assay = new ImmunoAssay(); // Read the data from a text file using a file chooser window // Select the file named ImmunoAssayData.txt assay.readFromFile(); // Choose equation assay.selectEquation(); // Print an analysis of the fit to a test file named ImmunoAssayThreeOutput.txt assay.print("ImmunoAssayThreeOutput.txt"); // Find concentration for a given response i.e. of a sample of unknown concentration double sampleResponse = Db.readDouble("Sample assay response"); double sampleConcn = assay.getSampleConcn(sampleResponse); double sampleError = assay.getSampleConcnError(); // Display the estimated sample concentration and its estimated error System.out.println("Sample assay response = " + sampleResponse); System.out.println("Estimated sample analyte concentration = " + sampleConcn); System.out.println("Estimated concentration error = " + sampleError); } }