Template:LBGA/GroupTable

Revision as of 04:59, 10 July 2013 by Adm (talk | contribs) (Created page with "{{#replace: {{#lua: local Tp = {} local Ts = {} local S0 = {}; S1 = {}; S2= {}; S3 = {} function printTable(T, title) print('==' .. title .. ' Sugar==\n{& class="wiki...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

{{#lua:

local Tp = {}
local Ts = {}
local S0 = {}; S1 = {}; S2= {}; S3 = {}
function printTable(T, title) 
  print('==' .. title .. ' Sugar==\n{| class="wikitable sortable"\n! ID || Polar group
Gro: glycerol || Sugar group
Glc: Glucose Gul: gulose') for k,v in ipairs(T) do s = "\n|-\n| " .. v .. " || " if (Tp[v] ~= nil) then s = s .. Tp[v] end s = s .. " || " if (Ts[v] ~= nil) then s = s .. Ts[v] end print(s) end print("\n|}") end
for id, group, seq in stdin:gmatch("||([^\n]+)|([%w]+)Group=([^\n]+)") do
  if (string.match(group,"Polar")) then Tp[id] = seq end
  if (string.match(group,"Sugar")) then Ts[id] = seq end
  s = string.sub(id,7,7)
  if (s == "0") then table.insert(S0, id)
  elseif (s == "1") then table.insert(S1, id)
  elseif (s == "2") then table.insert(S2, id)
  else table.insert(S3, id) end
end
printTable(S0, "No")
printTable(S1, "One")
printTable(S2, "Two")
printTable(S3, "Three or more")

| ||LBGACA2G01|SugarGroup=Glcpa1-2Galfb ||LBGACA2G01|PolarGroup=P-N,N,N-trimethyl-aminopentanetetrol ||LBGACA2G02|SugarGroup=Galfb1-6Galfb ||LBGACA2G02|PolarGroup=P-N,N,N-trimethyl-aminopentanetetrol ||LBGACA2G03|SugarGroup=Glcpa1-2Galfb ||LBGACA2G03|PolarGroup=P-N,N-dimethyl-aminopentanetetrol ||LBGACA2G04|SugarGroup=Galfb1-6Galfb ||LBGACA2G04|PolarGroup=P-N,N-dimethyl-aminopentanetetrol ||LBGACE0N01|PolarGroup=P-Etn ||LBGACE2G01|SugarGroup=Glcpb1-6Glcpb ||LBGACE2G01|PolarGroup=P-Etn ||LBGACG0N01|PolarGroup=P-Gro ||LBGACG1G01|SugarGroup=Glcxa ||LBGACG1G01|PolarGroup=P-Gro ||LBGACG1L01|SugarGroup=Gulpb ||LBGACG1L01|PolarGroup=P-Gro ||LBGACG1L02|SugarGroup=Gulpb ||LBGACG2G01|SugarGroup=Galfb1-6Galfb ||LBGACG2G01|PolarGroup=P-Gro ||LBGACG2G02|SugarGroup=Glcpa1-2Galfb ||LBGACG2G02|PolarGroup=P-Gro ||LBGACG2L01|SugarGroup=Manpa1-3Gulpb ||LBGACG2L01|PolarGroup=P-Gro ||LBGACG2L02|SugarGroup=Gulpb ||LBGACG3L01|SugarGroup=Manpa1-3Manpa1-3Gulpb ||LBGACG3L01|PolarGroup=P-Gro ||LBGACG4L01|SugarGroup=Manpa1-3Manpa1-3Manpa1-3Gulpb ||LBGACG4L01|PolarGroup=P-Gro ||LBGACI1N01|PolarGroup=P-Ino ||LBGACI2G01|SugarGroup=Glcpb ||LBGACI2G01|PolarGroup=P-Ino ||LBGACI2G02|SugarGroup=Glcpb ||LBGACI2G02|PolarGroup=P-Ino ||LBGACI2G03|SugarGroup=Galpb ||LBGACI2G03|PolarGroup=P-Ino ||LBGACI3G01|SugarGroup=Glcpb1-3Galpb ||LBGACI3G01|PolarGroup=P-Ino ||LBGACI3G02|SugarGroup=Glcpb1-6Glcpb ||LBGACI3G02|PolarGroup=P-Ino ||LBGACI3G03|SugarGroup=Glcpb1-6Galpb ||LBGACI3G03|PolarGroup=P-Ino ||LBGACI3G04|SugarGroup=Glcpa1-4Galpb ||LBGACI3G04|PolarGroup=P-Ino ||LBGACI3S01|SugarGroup=HSO3-Glcpb1-3Galpb ||LBGACI3S01|PolarGroup=P-Ino ||LBGACI3X01|SugarGroup=acetyldiglycosyl ||LBGACI3X01|PolarGroup=P-Ino ||LBGACI4G01|SugarGroup=Glcpb1-2Glcpb1-2Glcpb ||LBGACI4G01|PolarGroup=P-Ino ||LBGACN1G01|SugarGroup=Glcpb ||LBGACN1G02|SugarGroup=Glcpa ||LBGACN1G03|SugarGroup=Glcpb ||LBGACN1G04|SugarGroup=Glcpb ||LBGACN1L01|SugarGroup=Gulpb ||LBGACN1L02|SugarGroup=Gulpb ||LBGACN2G01|SugarGroup=Glcpa1-2(6-Oac)Galfb ||LBGACN2G02|SugarGroup=Glcpb1-2Glcpb ||LBGACN2G03|SugarGroup=Glcpa, Glcpa ||LBGACN2G04|SugarGroup=Glcpb1-3Galpb ||LBGACN2G05|SugarGroup=Glcpb1-6Glcpb ||LBGACN2G06|SugarGroup=Glcpa1-2Galfb ||LBGACN2G07|SugarGroup=Galfb1-6Galfb ||LBGACN2G08|SugarGroup=Glcpb1-6Glcpb ||LBGACN2G09|SugarGroup=Glcpb1-6Galpb ||LBGACN2G10|SugarGroup=Glcpa1-4Galpb ||LBGACN2G11|SugarGroup=Glcpb1-xGalpb ||LBGACN2G12|PolarGroup= ||LBGACN2G12|SugarGroup=Glcpb1-xGalpb ||LBGACN2L01|SugarGroup=Gulpb, Gulpb ||LBGACN2L02|SugarGroup=Gulpb, Glcpa ||LBGACN2L03|SugarGroup=Gulpb, Gulpb ||LBGACN2L04|SugarGroup=Manpa1-3Gulpb ||LBGACN2S01|SugarGroup=HSO3-Glcpb1-3Galpb ||LBGACN3G01|SugarGroup=Glcpa1-2Galfb ||LBGACN3G02|SugarGroup=Glcpb1-2Glcpb1-2Glcpb ||LBGACN3G03|SugarGroup=Glcpb1-6Glcpb1-6Glcpb ||LBGACN3G04|SugarGroup=Glcpb1-6Glcpb1-6Glcpb ||LBGACN3L01|SugarGroup=Manpa1-3Gulpb, Gulpb ||LBGACN3L02|SugarGroup=Manpa1-3Manpa1-3Gulpb ||LBGACN4G01|PolarGroup= ||LBGACN4G01|SugarGroup=Glcpb1-xGalpb ||LBGACN4L01|SugarGroup=Manpa1-3Manpa1-3Manpa1-3Gulpb ||LBGACNXM01|SugarGroup=Manpa1-2Manpa1-4Manpa1-3Manpa1-2Manpa1-4Manpa1-3Manpa1-2Manpa1-4Manpa1-3Manpa1-2Manpa1-4Manpa1-3Manpa1-2Manpa1-4Manpa1-3Manpa1-2Manpa1-4Manpa1-3Manpa1-2Manpa1-4Manpa1-3Manpa1-2Manpa1-4Manpa1-3Glcpa ||LBGACP0N01|PolarGroup=P ||LBGACP1G01|PolarGroup=P ||LBGACP1G01|SugarGroup=Glcpb ||LBGACP2G01|PolarGroup=P ||LBGACP2G01|SugarGroup=Glcpb1-6Glcpb ||LBGACS0N01|PolarGroup=P-Ser ||LBGACS2G01|SugarGroup=Glcpb1-6Glcpb ||LBGACS2G01|PolarGroup=P-Ser

}}