Template:MassBank/NeutralLoss
From Metabolomics.JP
(Difference between revisions)
m (New page: {{#lua: FORMULA_PAT = "(C?[1-9]?[0-9]?)(H?[1-9]?[0-9]?)(C?l?[2-9]?)(F?[2-9]?)(I?[2-9]?)(N?[1-9]?[0-9]?)(O?[1-9]?[0-9]?)(P?[2-9]?)(S?[2-9]?)" FORMULA_CHAR = "CHFINOPSl0-9" ATOM = {"C"...) |
|||
| Line 47: | Line 47: | ||
local x, y; | local x, y; | ||
---Read Data--- | ---Read Data--- | ||
| − | for line in stdin:gmatch("[%S ,]+") do | + | for line in stdin:gmatch("&&[%w]+(&&[%S ,]+)") do |
if (string.find(line, "^&&[&%a%d]+&&$") ~= nil) | if (string.find(line, "^&&[&%a%d]+&&$") ~= nil) | ||
then ruler = string.gsub(line, "&&", " ") | then ruler = string.gsub(line, "&&", " ") | ||
| Line 75: | Line 75: | ||
countOrange=0 | countOrange=0 | ||
countGray=0 | countGray=0 | ||
| − | for i=1, table.getn(axis) do | + | for i=1, table.getn(axis) do ---Row i |
for j=1, i-1 do | for j=1, i-1 do | ||
s = diff(axis[j],axis[i]); | s = diff(axis[j],axis[i]); | ||
| Line 89: | Line 89: | ||
end | end | ||
end | end | ||
| − | print( | + | print("#-") |
| − | + | print("##".. countBlack .."##"..countOrange .."##".. countGray) | |
| − | print(countGray) | + | |
| | | | ||
| − | {{ | + | {{#SearchLine:^&&|MassBank|{{{1}}}}} |
}} | }} | ||
Revision as of 17:05, 8 June 2009
./lua: /tmp/mw_ex_lua_B2OlmT:67: bad argument #1 to 'gmatch' (string expected, got nil)