Template:Index/mass

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
Line 12: Line 12:
 
{{#repeat:IndexTable|1|
 
{{#repeat:IndexTable|1|
 
{{#lua:
 
{{#lua:
   local id, ms, msd, min, max;
+
   local id, ms, msd;
 +
  local min = {{{1|0}}};
 +
  local max = {{{2|2000}}};
 
   local hash = {};
 
   local hash = {};
 
   local idx = {};
 
   local idx = {};
  local first = true;
 
 
   for id, ms in stdin:gmatch("&&(%w+)&&([%d\.]+)") do
 
   for id, ms in stdin:gmatch("&&(%w+)&&([%d\.]+)") do
     if (first) then ---:はじめの値は質量の最小値と最大値
+
     msd = tonumber(ms); ---質量の最小と最大の間に入る部分のみ考慮
      min = tonumber(id);
+
    if ((msd >= min) and (msd <= max)) then
      max = tonumber(ms);
+
      if (hash[msd] == null)
      first = false;
+
        then hash[msd] = id;
    else
+
          table.insert(idx, msd);
      msd = tonumber(ms); ---質量の最小と最大の間に入る部分のみ考慮
+
        else hash[msd] = hash[msd].."&&"..id;
      if ((msd >= min) and (msd <= max)) then
+
        if (hash[msd] == null)
+
          then hash[msd] = id;
+
            table.insert(idx, msd);
+
          else hash[msd] = hash[msd].."&&"..id;
+
        end
+
 
       end
 
       end
 
     end
 
     end
Line 38: Line 33:
 
   end
 
   end
 
   print(output);
 
   print(output);
|&&{{{1|0}}}&&{{{2|10000}}} {{#if:{{{4|}}}| {{#extmass:{{{3|FL1C99}}}}}| {{#avemass:{{{3|FL1C99}}}}} }}
+
|{{#if:{{{4|}}}| {{#extmass:{{{3|FL1C99}}}}}| {{#avemass:{{{3|FL1C99}}}}} }}
 
}}
 
}}
 
}}
 
}}
 
|}
 
|}

Revision as of 10:53, 2 May 2008

質量のインデクス: {{{1}}} 最小値(デフォルト0) {{{2}}} 最大値(デフォルト1万) {{{3}}} 検索ページタイトル {{{4}}} true/nil EXTMASS と AVGMASSの選択 Last updated: 20080502105306

[[Index:{{{3}}}|Back to Index]]

Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox