Fourier-transform infrared spectrometry (FT-IR) and a high performance liquid chromatography (HPLC) where used to assess the purity of acetaminophen samples from two distributors and determine if they are contaminated or overly concentrated. Two locations reported that the tablets should have 110 mg of acetaminophen with no contaminants.
using DataFrames
Ref = readtable("Tylenol_Ref.csv", separator = ',',
header = true, skipstart = 1,
names = [Symbol("cm1"), Symbol("A")])
Ref[:base] = Ref[:A] .- minimum(Ref[:A])
Ref[:rel] = Ref[:base] ./ maximum(Ref[:base])
SampA = readtable("Samp_30A_Ave.csv", separator = ',',
header = true, skipstart = 1,
names = [Symbol("cm1"), Symbol("A")])
SampA[:base] = SampA[:A] .- minimum(SampA[:A])
SampA[:rel] = SampA[:base] ./ maximum(SampA[:base])
SampB = readtable("Samp_32B_Ave.csv", separator = '\t',
header = true, skipstart = 1,
names = [Symbol("cm1"), Symbol("A")])
SampB[:base] = SampB[:A] .- minimum(SampB[:A])
SampB[:rel] = SampB[:base] ./ maximum(SampB[:base])
using PyPlot
plot(Ref[:cm1], Ref[:rel], label = "Tylenol Reference")
plot(SampA[:cm1], SampA[:rel], label = "Sample 20190207E_30A")
plot(SampB[:cm1], SampB[:rel], label = "Sample 20190207A_32B")
legend()
xlabel("Wavenumber (cm-1)")
ylabel("Relative Absorbance")
ax = gca()
ax[:set_xlim]([600,4000])
ax[:set_ylim]([0,1]);
using DataFrames
Ref = readtable("Tylenol_Ref.csv", separator = ',',
header = true, skipstart = 1,
names = [Symbol("cm1"), Symbol("A")])
Ref[:base] = Ref[:A] .- minimum(Ref[:A])
Ref[:rel] = Ref[:base] ./ maximum(Ref[:base])
SampA = readtable("Samp_30A_Ave.csv", separator = ',',
header = true, skipstart = 1,
names = [Symbol("cm1"), Symbol("A")])
SampA[:base] = SampA[:A] .- minimum(SampA[:A])
SampA[:rel] = SampA[:base] ./ maximum(SampA[:base])
SampB = readtable("Samp_32B_Ave.csv", separator = '\t',
header = true, skipstart = 1,
names = [Symbol("cm1"), Symbol("A")])
SampB[:base] = SampB[:A] .- minimum(SampB[:A])
SampB[:rel] = SampB[:base] ./ maximum(SampB[:base])
using PyPlot
plot(Ref[:cm1], Ref[:rel], label = "Tylenol Reference")
plot(SampA[:cm1], SampA[:rel], label = "Sample 20190207E_30A-1")
plot(SampB[:cm1], SampB[:rel], label = "Sample 20190207A_32B-1")
legend()
xlabel("Wavenumber (cm-1)")
ylabel("Relative Absorbance")
ax = gca()
ax[:set_xlim]([600,4000])
ax[:set_ylim]([0,1]);
using DataFrames
std1 = readtable("std05ppm1.csv", separator = ',',
header = true,
names = [Symbol("time"), Symbol("int")])
std2 = readtable("std05ppm2.csv", separator = ',',
header = true,
names = [Symbol("time"), Symbol("int")])
week1 = readtable("week1_ave.csv", separator = ',',
header = true,
names = [Symbol("time"), Symbol("int")])
week2 = readtable("week2_ave.csv", separator = ',',
header = true,
names = [Symbol("time"), Symbol("int")])
hplc_cal1 = readtable("hplc_cal1.csv", separator = ',',
header = true,
names = [Symbol("conc"), Symbol("peak_area")])
hplc_cal2 = readtable("hplc_cal2.csv", separator = ',',
header = true,
names = [Symbol("conc"), Symbol("peak_area")])
using PyPlot
plot(std1[:time], std1[:int], label = "0.5 ppm Calibration Standard
Peak Area = 1110.1")
plot(week1[:time], week1[:int], label = "Sample 20190207A_30A-1
Peak Area = 225.6")
legend()
xlabel("Time (min)")
ylabel("Intensity")
ax = gca()
ax[:set_xlim]([0,10])
ax[:set_ylim]([0,83]);
#WEEK 1 HPLC
plot(std2[:time], std2[:int], label = "0.5 ppm Calibration Standard
Peak Area = 1105.0")
plot(week2[:time], week2[:int], label = "Sample 20190207E_30A-1
Peak Area = 380.8")
legend()
xlabel("Time (min)")
ylabel("Intensity")
ax = gca()
ax[:set_xlim]([0,10])
ax[:set_ylim]([0,80]);
using GLM
hplc_curve1 = lm(@formula(peak_area ~ conc), hplc_cal1)
x = collect(0:0.5:35)
b = round(coef(hplc_curve1)[1], digits = 4);
m = round(coef(hplc_curve1)[2], digits = 4);
rsq = round(r2(hplc_curve1), digits = 4);
using PyPlot
scatter(hplc_cal1[:conc], hplc_cal1[:peak_area], label = "Acetaminophen Calibration Standards")
plot(x, x .* m .+ b, "--",
label = string("A = ", m, "C + ", abs(b), "; R2 = ", rsq)
)
legend()
xlabel("Concentration (ppm)")
ylabel("Peak Area")
ax = gca()
ax[:set_xlim]([0,30])
ax[:set_ylim]([0,50000]);
# WEEK 1 CAL CURVE
using GLM
hplc_curve2 = lm(@formula(peak_area ~ conc), hplc_cal2)
x = collect(0:0.5:35)
b = round(coef(hplc_curve2)[1], digits = 4);
m = round(coef(hplc_curve2)[2], digits = 4);
rsq = round(r2(hplc_curve2), digits = 4);
using PyPlot
scatter(hplc_cal2[:conc], hplc_cal2[:peak_area], label = "Acetaminophen Calibration Standards")
plot(x, x .* m .+ b, "--",
label = string("A = ", m, "C + ", abs(b), "; R2 = ", rsq)
)
legend()
xlabel("Concentration (ppm)")
ylabel("Peak Area")
ax = gca()
ax[:set_xlim]([0,30])
ax[:set_ylim]([0,50000]);
# WEEK 2 CAL CURVE
using DataFrames
Ref = readtable("Tylenol_Ref.csv", separator = ',',
header = true, skipstart = 1,
names = [Symbol("cm1"), Symbol("A")])
Ref[:base] = Ref[:A] .- minimum(Ref[:A])
Ref[:rel] = Ref[:base] ./ maximum(Ref[:base])
SampA = readtable("Samp_30A_Ave.csv", separator = ',',
header = true, skipstart = 1,
names = [Symbol("cm1"), Symbol("A")])
SampA[:base] = SampA[:A] .- minimum(SampA[:A])
SampA[:rel] = SampA[:base] ./ maximum(SampA[:base])
SampB = readtable("Samp_32B_Ave.csv", separator = '\t',
header = true, skipstart = 1,
names = [Symbol("cm1"), Symbol("A")])
SampB[:base] = SampB[:A] .- minimum(SampB[:A])
SampB[:rel] = SampB[:base] ./ maximum(SampB[:base])
using PyPlot
plot(Ref[:cm1], Ref[:rel], label = "Tylenol Reference")
plot(SampA[:cm1], SampA[:rel], label = "Sample 20190207E_30A")
plot(SampB[:cm1], SampB[:rel], label = "Sample 20190207A_32B")
legend()
xlabel("Wavenumber (cm-1)")
ylabel("Relative Absorbance")
ax = gca()
ax[:set_xlim]([600,4000])
ax[:set_ylim]([0,1]);
using GLM
hplc_curve = lm(@formula(peak_area ~ conc), hplc_cal)
x = collect(0:0.5:35)
b = round(coef(hplc_curve)[1], digits = 4);
m = round(coef(hplc_curve)[2], digits = 4);
rsq = round(r2(hplc_curve), digits = 4);
using PyPlot
scatter(hplc_cal[:conc], hplc_cal[:peak_area], label = "Acetaminophen Calibration Standards")
plot(x, x .* m .+ b, "--",
label = string("A = ", m, "C + ", abs(b), "; R2 = ", rsq)
)
legend()
xlabel("Concentration (ppm)")
ylabel("Peak Area")
ax = gca()
ax[:set_xlim]([0,30])
ax[:set_ylim]([0,50000]);
# AVERAGE CAL CURVE