Volatile:Pathway/Metabolic

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
m
 
(65 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This is {{{other}}} parameters.
+
{{#ifeq:{{#substring:{{FULLPAGENAME}}|0|8}}|Volatile|{{Huge|{{{4}}}}}}}<br/>
{{#lua:
+
Total {{#count:{{{list|}}}}} steps.
  if ({{{1}}} == 2) then print("red"); else print({{{1}}}); end
+
{|
|}}
+
|-
 
+
{| class="collapsible"
{{#lua: print({{{1}}} + 10); |}}
+
! style="text-align:left"|{{Metabolite/GetSysName|{{{1|}}}}}
[[Volatile:Sandbox|2|button2]]
+
|-
[[Volatile:Sandbox|3|button3]]
+
| style="text-align:left"|[[Image:{{{1|}}}.png|thumb|left|{{#var:PIC_SCALE}}px]]{{Pathway/GetPathwayList|{{{1|}}}}}
[[Volatile:Sandbox|4|button4]]
+
|}
 +
{{#repeatnum:Pathway/MetabolicTable|4|<!----
 +
4行の出力内訳。4行毎にPathway/MetabolicTableを用いて処理。
 +
1 ... mapping pagetitle
 +
2 ... mapping direction
 +
3 ... mapped position
 +
4 ... target molecular ID
 +
--->{{#lua:
 +
  local list = {};
 +
  local origPos = {};
 +
  local count = 0;
 +
  for line in stdin:gmatch("([^\n]+)") do
 +
    count = count+1;
 +
    if (count % 3 ~= 2) then
 +
      --- do nothing for AtomMaps and metabolite IDs ---
 +
      print(line);
 +
    else
 +
      if (count==2) then
 +
      --- First mapping line ---
 +
        local str = "";
 +
        for k, v in string.gmatch(line, "(%d%d?) (%d%d?) %d?%d? ?;") do
 +
          list[k] = v;
 +
          origPos[v] = k;
 +
          if (k == tostring({{{3|?}}})) then
 +
            str = str .. '<span style=color:red><b>' ..k.. '&rarr;' ..v..'</b></span>; ';
 +
          else
 +
            str = str ..k.. '&rarr;' ..v..'; ';
 +
          end
 +
        end
 +
        print(str);
 +
      else
 +
      --- Second and later lines ---
 +
        local map = {};
 +
        if (string.sub(line,1,1) == 'R') then
 +
          line = string.sub(line,2);
 +
          --- Create reverse mapping
 +
          for k, v in string.gmatch(line, "(%d%d?) (%d%d?) %d?%d? ?;") do
 +
            map[v] = k;
 +
          end
 +
        else
 +
          --- Create standard mapping
 +
          for k, v in string.gmatch(line, "(%d%d?) (%d%d?) %d?%d? ?;") do
 +
            map[k] = v;
 +
          end
 +
        end
 +
        --- Leave only positions that can be mapped
 +
        local list2 = {};
 +
        local origPos2 = {};
 +
        local str = "";
 +
        for k, v in pairs(list) do
 +
          if (map[k] ~= nil)
 +
          then
 +
            list2[map[k]] = map[k];
 +
            origPos2[map[k]] = origPos[k];
 +
            if (origPos[k] == tostring({{{3|?}}})) then
 +
              str = str .. '<span style=color:red><b>' ..k.. '&rarr;' ..map[k]..'</b></span>; ';
 +
            else
 +
              str = str .. k .. '&rarr;' .. map[k]..'; ';
 +
            end
 +
          end
 +
        end
 +
        print(str);  -- output 3rd line
 +
        list = list2;
 +
        origPos = origPos2;
 +
      end
 +
      local str = "";
 +
      for k, v in pairs(list) do
 +
        str = str .. '[[Volatile:Pathway/Metabolic|{{{1}}}|{{{2}}}|' ..k.. '|{{#replace:{{{4}}}|&#160;|_}}|Trace ' ..k.. ']] ';
 +
      end
 +
      print(str); -- output 4th line
 +
    end
 +
  end
 +
|{{#repeat:Pathway/Mapping|1|{{#cdr:{{{2}}}|__}}|__}} }}
 +
}}
 +
|}

Latest revision as of 08:18, 22 July 2009


Total 0 steps.

#ifeq:
Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox