Sandbox
From Metabolomics.JP
(Difference between revisions)
Line 63: | Line 63: | ||
{| class="wikitable" style="margin: 1em auto; border-width:0px 0px 0px 0px;" | {| class="wikitable" style="margin: 1em auto; border-width:0px 0px 0px 0px;" | ||
|- style="background:#ccf" | |- style="background:#ccf" | ||
− | ! Index by Exact Mass | + | !colspan="2"| Index by Exact Mass |
{{#repeat:IndexTable|1| | {{#repeat:IndexTable|1| | ||
{{#lua: | {{#lua: | ||
− | local id, ms, msd; | + | local id, ms, msd, min, max; |
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 ---:はじめの値は質量の最小値と最大値 | |
− | if (hash[msd] == null) | + | min = tonumber(id); |
− | + | max = tonumber(ms); | |
− | + | first = false; | |
+ | else | ||
+ | msd = tonumber(ms); | ||
+ | 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 | end | ||
Line 82: | Line 92: | ||
end | end | ||
print(output); | print(output); | ||
− | |{{#extmass:FL1AAC}}}} | + | |&&300&&500 {{#extmass:FL1AAC}}}} |
}} | }} | ||
|} | |} |
Revision as of 14:15, 26 April 2008
this is sandbox page.
このページでは、変数を使用しています。
{{#graph:
pie(円グラフ)もしくはpie3(3D円グラフ)(後で、折れ線グラフ、棒グラフをサポートする予定)
横サイズx縦サイズ(ex. 300x400)
データ(,区切り)
ラベル(,区切り)
タイトル
}}
FL1 FL4
FL1
FL2
FL3
FL4
{{#extmass:FL1AAC}}
Index by Exact Mass |
---|