Template:MassBank/Matrix

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
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:
   local ruler
+
   ---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(ruler) return
+
       print(line) return
 
     end
 
     end
 
   end
 
   end
Line 128: Line 137:
  
 
{{#lua:
 
{{#lua:
   local fgmt = ""
+
   ---find and print comments---
  local ruler = nil
+
 
   for line in stdin:gmatch("[%S ,]+") do
 
   for line in stdin:gmatch("[%S ,]+") do
     if (string.find(line, "^&&[&%a%d]+&&$") == nil) then
+
     head, tail = string.match(line, "^(["..FORMULA_CHAR.."]+) *: *(["..FORMULA_CHAR.." ]+)$");
       print(line)
+
    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_jpNwuT:3: attempt to concatenate global 'FORMULA_CHAR' (a nil value)

Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox