Sandbox4
From Metabolomics.JP
(Difference between revisions)
Line 12: | Line 12: | ||
end | end | ||
|{{#SearchLine:FL63|Reference}} }} | |{{#SearchLine:FL63|Reference}} }} | ||
+ | }} | ||
+ | |||
+ | {{#graph:pie|size=500x200;title=Registered Families;legend=0x0; | ||
+ | {{#lua: | ||
+ | T = {} | ||
+ | total = 0 | ||
+ | tfam = 0 | ||
+ | for family, num in stdin:gmatch("([%a]+) ([%d]+)") do | ||
+ | total = total + num | ||
+ | if (T[family] == null) then T[family] = tonumber(num) tfam = tfam + 1 else T[family] = T[family] + num end | ||
+ | end | ||
+ | S = {} | ||
+ | I = {} | ||
+ | for k,v in pairs(T) do | ||
+ | if (S[v] == null) then S[v] = { k } table.insert(I,v) else table.insert(S[v], k) end | ||
+ | end | ||
+ | table.sort(I) | ||
+ | for i=table.getn(I), math.max(table.getn(I)-5,1),-1 do | ||
+ | T = S[I[i]] | ||
+ | print(table.concat(T," ").."="..I[i]..";") | ||
+ | total=total-I[i] | ||
+ | end | ||
+ | print("others="..total) | ||
+ | | {{#repeat:Stats/Family/GetFamilyName|1|{{#var:stat}} }} | ||
+ | }} | ||
}} | }} | ||
Revision as of 03:52, 11 December 2009