Template:MassBank/Matrix
From Metabolomics.JP
(Difference between revisions)
m |
m |
||
Line 68: | Line 68: | ||
end | end | ||
x = nil; | x = nil; | ||
+ | y = {}; | ||
for formula in string.gmatch(ruler, "([%S]+)") do | for formula in string.gmatch(ruler, "([%S]+)") do | ||
if (x ~= nil and mass(formula) > mass(x)) then | if (x ~= nil and mass(formula) > mass(x)) then | ||
− | print("<big>Illegal ion order (check mass!): "..x.." < "..formula.."</big><br/>") | + | print("<big>Illegal ion order (check mass!): "..x.." < "..formula.."</big><br/>") |
end | end | ||
x = formula; | x = formula; | ||
+ | table.insert(y,formula); | ||
+ | end | ||
+ | ---Check Fragments--- | ||
+ | for i,v in pairs(fragments) do | ||
+ | if (y[i] == nil) then print("<big>Fragment "..i.." does not exist.</big>") end | ||
+ | for j,w in pairs(v) do | ||
+ | if (y[j] == nil) then print("<big>Fragment "..i.." does not exist.</big>") end | ||
+ | end | ||
end | end | ||
---Write Matrix--- | ---Write Matrix--- | ||
Line 118: | Line 127: | ||
{{#repeat:MassBank/SearchFgmt|1| | {{#repeat:MassBank/SearchFgmt|1| | ||
{{#lua: | {{#lua: | ||
− | + | ---find and print Ruler--- | |
for line in stdin:gmatch("[%S ,]+") do | for line in stdin:gmatch("[%S ,]+") do | ||
if (string.find(line, "^&&[&%a%d]+&&$") ~= nil) then | if (string.find(line, "^&&[&%a%d]+&&$") ~= nil) then | ||
− | print( | + | print(line) return |
end | end | ||
end | end | ||
Line 128: | Line 137: | ||
{{#lua: | {{#lua: | ||
− | + | ---find and print comments--- | |
− | + | ||
for line in stdin:gmatch("[%S ,]+") do | for line in stdin:gmatch("[%S ,]+") do | ||
− | + | head, tail = string.match(line, "^(["..FORMULA_CHAR.."]+) *: *(["..FORMULA_CHAR.." ]+)$"); | |
− | + | if (head ~= nil and tail ~= nil) then | |
+ | |||
end | end | ||
end | end | ||
|{{{data|CHClNOPS}}} | |{{{data|CHClNOPS}}} | ||
}} | }} |
Revision as of 00:09, 14 May 2009
No 'ION INFO' line in the form &&(formula)&&(formula)&&...&&
MassBank/Matrix | 64 CHClONSP |
64 CHClONSP |
|
./lua: /tmp/mw_ex_lua_P1gIc7:3: attempt to concatenate global 'FORMULA_CHAR' (a nil value)