Template:MassBank/Matrix
From Metabolomics.JP
(Difference between revisions)
m |
m |
||
Line 57: | Line 57: | ||
function diff(str1, str2) | function diff(str1, str2) | ||
---computes str1 - str2. If negative, returns nil.--- | ---computes str1 - str2. If negative, returns nil.--- | ||
− | local t1 = {string.match(str1,FORMULA_PAT)} | + | local t1 = toFormula({string.match(str1,FORMULA_PAT)}) |
− | local t2 = {string.match(str2,FORMULA_PAT)} | + | local t2 = toFormula({string.match(str2,FORMULA_PAT)}) |
for i,_ in pairs(t1) do | for i,_ in pairs(t1) do | ||
if (t1[i] < t2[i]) then return nil else t1[i] = t1[i]-t2[i] end | if (t1[i] < t2[i]) then return nil else t1[i] = t1[i]-t2[i] end |
Revision as of 23:39, 13 May 2009
No ion information in the form &&(formula)&&(formula)&&...&&
MassBank/Matrix | 64 CHClONSP |
64 CHClONSP |
|