Template:Pathway/Metabolic

From Metabolomics.JP
< Template:Pathway(Difference between revisions)
Jump to: navigation, search
Line 10: Line 10:
 
       --- First line
 
       --- First line
 
       for k, v in string.gmatch(line, "(%d%d?) (%d%d?) %d?%d? ?;") do
 
       for k, v in string.gmatch(line, "(%d%d?) (%d%d?) %d?%d? ?;") do
         table.insert(list,v);
+
         list[k] = v;
 
       end
 
       end
 
     else
 
     else
Line 24: Line 24:
 
       end
 
       end
 
       --- Leave only positions that can be mapped
 
       --- Leave only positions that can be mapped
 +
      local list2 = {};
 
       for k, v in pairs(list) do
 
       for k, v in pairs(list) do
         if (map[v] == nil) then
+
         if (map[k] ~= nil) then list2[map[k]] = map[k]; end
          table.remove(list,k);
+
        else
+
          list[k] = map[v];
+
        end
+
 
       end
 
       end
 +
      list = list2;
 
     else
 
     else
 
       --- Create standard mapping
 
       --- Create standard mapping
Line 39: Line 37:
 
       end
 
       end
 
       --- Leave only positions that can be mapped
 
       --- Leave only positions that can be mapped
 +
      local list2 = {};
 
       for k, v in pairs(list) do
 
       for k, v in pairs(list) do
         if (map[v] == nil) then
+
         if (map[k] ~= nil) then list2[map[k]] = map[k]; end
          table.remove(list,k);
+
        else
+
          list[k] = map[v];
+
        end
+
 
       end
 
       end
 +
      list = list2;
 
     end
 
     end
 
     end
 
     end

Revision as of 06:58, 16 March 2009



Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox