Sandbox4

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
m
 
(10 intermediate revisions by one user not shown)
Line 1: Line 1:
{{#def:stat|
+
==メイン(旧)ネームスペース==
{{#lua:
+
  local T = {}
+
  total = 0
+
  for genus in stdin:gmatch("&&([%a]+) [-%a%. ]+&&[%a%d]+") do
+
    total = total + 1
+
    if (T[genus] == null) then T[genus] = 1 else T[genus] = T[genus] + 1 end
+
  end
+
  print(total)
+
  for k,v in pairs(T) do
+
    print(k.." "..v)
+
  end
+
|{{#SearchLine:FL63|Reference}} }}
+
}}
+
  
{|
+
{{#def:list|{{#SearchTitle:_*LC-MS|}}}}
|-
+
Total {{#count:{{#var:list}}}} pages.
|
+
{{#repeat:LinkItem|1|{{#var:list}}}}
{{#graph:pie|size=400x200;margin=0,0,0,0;title=Top 5 Families;legend=0.65x0.45;label=;
+
{{#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)-4,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}} }}
+
}}
+
}}
+
| For detailed metabolite-species statistics, visit [[Volatile:MetaboliteDistribution|FL63|this page]].
+
|}
+
  
==Family Distribution==
 
{{#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)
 
  print('{{{#bar:}} class="wikitable"')
 
  print('{{#bar:}}-')
 
  print('! #metabolite {{#bar:}}{{#bar:}} Total '..total..' metabolites in '..tfam..' families')
 
  for i=table.getn(I), 1, -1 do
 
  print('{{#bar:}}-')
 
    T = S[I[i]]
 
    print("{{#bar:}}"..I[i].." ("..string.format("%.2f",100*I[i]/total).."%){{#bar:}}{{#bar:}}")
 
    for j,w in pairs(T) do
 
      print("[[:Category:"..w.."{{#bar:}}"..w.."]]; ")
 
    end
 
  end
 
  print("{{#bar:}}}")
 
| {{#repeat:Stats/Family/GetFamilyName|1|{{#var:stat}} }}
 
}}
 
  
==Order Distribution==
+
==新しい(LCMS)ネームスペース==
{{#lua:
+
  T = {}
+
  total = 0
+
  tord = 0
+
  for order, num in stdin:gmatch("([%a]+) ([%d]+)") do
+
    total = total + num
+
    if (T[order] == null) then T[order] = tonumber(num) tord = tord + 1 else T[order] = T[order] + 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)
+
  print('{{{#bar:}} class="wikitable"')
+
  print('{{#bar:}}-')
+
  print('! #metabolite {{#bar:}}{{#bar:}} Total '..total..' metabolites in '..tord..' orders')
+
  for i=table.getn(I), 1, -1 do
+
  print('{{#bar:}}-')
+
    T = S[I[i]]
+
    print("{{#bar:}}"..I[i].." ("..string.format("%.2f",100*I[i]/total).."%){{#bar:}}{{#bar:}}")
+
    print(table.concat(T, "; "))
+
  end
+
  print("{{#bar:}}}")
+
| {{#repeat:Stats/Family/GetOrderName|1|{{#var:stat}} }}
+
}}
+
  
==Details==
+
{{#def:list2|{{#SearchTitle:_*|LCMS}}}}
{{#repeat:Stats/Family/GetFamilyName2|1|
+
Total {{#count:{{#var:list2}}}} pages.
{{#lua:
+
{{#repeat:LinkItem|1|{{#var:list2}}}}
  local T = {}
+
  total = 0
+
  for genus, id in stdin:gmatch("&&([%a]+) [-%a%. ]+&&([%a%d]+)") do
+
    total = total + 1
+
    if (T[genus] == null) then T[genus] = {"[["..id.."]]"} else table.insert(T[genus], "[["..id.."]]") end
+
  end
+
  for k,v in pairs(T) do
+
    print(k.." "..table.concat(T[k], "; "))
+
  end
+
|{{#SearchLine:FL63|Reference}} }}
+
}}
+

Latest revision as of 14:02, 10 February 2011

[edit] メイン(旧)ネームスペース

Total 118 pages.


[edit] 新しい(LCMS)ネームスペース

Total 118 pages.

Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox