Sugar
{{#lua:
desulfurococcales ={{},{},{}}
sulfolobales ={{},{},{}}
thermoproteales ={{},{},{}}
thermococcales ={{},{},{}}
thermoplasmatales ={{},{},{}}
halobacteriales ={{},{},{}}
methanobacteriales ={{},{},{}}
methanococcales ={{},{},{}}
methanomicrobiales ={{},{},{}}
methanopyrales ={{},{},{}}
methanosarcinales ={{},{},{}}
function printRow(name, T, reg) print("\n|-\n|"..reg.."|"..name.." || ") for k,v in pairs(T[1]) do print(k.."("..v..") ") end print(" || ") for k,v in pairs(T[2]) do print(k.."("..v..") ") end print(" || ") for k,v in pairs(T[3]) do print(k.."("..v..") ") end end
function register(T, id) local s = string.sub(id,4,4) if (T[1][s] == nil) then T[1][s]=1 else T[1][s]= T[1][s] + 1 end s = string.sub(id,5,5) if (T[2][s] == nil) then T[2][s]=1 else T[2][s]= T[2][s] + 1 end s = string.sub(id,6,6) if (T[3][s] == nil) then T[3][s]=1 else T[3][s]= T[3][s] + 1 end end
for ref, sp, id in stdin:gmatch("|?|?([%w\. ]+)||([%w\., ]+)||([^\n]+)") do
if (string.match(sp,"Aeropyrum") or string.match(sp,"Desulfurococcus") or string.match(sp,"Pyrolobus"))
then register(desulfurococcales, id)
elseif (string.match(sp,"Acidianus") or string.match(sp,"Sulfolobus") or string.match(sp,"Desulfurolobus"))
then register(sulfolobales, id)
elseif (string.match(sp,"Pyrobaculum") or string.match(sp,"Thermoproteus"))
then register(thermoproteales, id)
elseif (string.match(sp,"Pyrococcus") or string.match(sp,"Thermococcus"))
then register(thermococcales, id)
elseif (string.match(sp,"Thermoplasma"))
then register(thermoplasmatales, id)
elseif (string.match(sp,"Haloarcula") or string.match(sp,"Halobacterium") or string.match(sp,"Halococcus") or string.match(sp,"Haloferax") or string.match(sp,"Halorubrum") or string.match(sp,"Natrialba") or string.match(sp,"Natronobacterium") or string.match(sp,"Natronococcus"))
then register(halobacteriales, id)
elseif (string.match(sp,"Methanobacterium") or string.match(sp,"Methanobrevibacter") or string.match(sp,"Methanosphaera") or string.match(sp,"Methanothermobacter"))
then register(methanobacteriales, id)
elseif (string.match(sp,"Methanothermococcus") or string.match(sp,"Methanococcus") or string.match(sp,"Methanocaldococcus"))
then register(methanococcales, id)
elseif (string.match(sp,"Methanomicrobium") or string.match(sp,"Methanospirillum"))
then register(methanomicrobiales, id)
elseif (string.match(sp,"Methanopyrus"))
then register(methanopyrales, id)
elseif (string.match(sp,"Methanococcoides") or string.match(sp,"Methanohalophilus") or string.match(sp,"Methanolobus") or string.match(sp,"Methanosarcina"))
then register(methanosarcinales, id)
end
end
printRow("desulfurococcales", desulfurococcales, "Aeropyrum~Desulfurococcus~Pyrolobus")
printRow("sulfolobales",sulfolobales, "Acidianus~Sulfolobus~Desulfurolobus")
printRow("thermoproteales",thermoproteales, "Pyrobaculum~Thermoproteus")
printRow("thermococcales",thermococcales, "Pyrococcus~Thermococcus")
printRow("thermoplasmatales",thermoplasmatales, "Thermoplasma")
printRow("halobacteriales",halobacteriales, "Haloarcula~Halobacterium~Halococcus~Haloferax~Halorubrum~Natrialba~Natronobacterium~Natronococcus")
printRow("methanobacteriales",methanobacteriales, "Methanobacterium~Methanobrevibacter~Methanosphaera~Methanothermobacter")
printRow("methanococcales",methanococcales, "Methanothermococcus~Methanococcus~Methanocaldococcus")
printRow("methanomicrobiales",methanomicrobiales, "Methanomicrobium~Methanospirillum")
printRow("methanopyrales",methanopyrales, "Methanopyrus")
printRow("mehtanosarcinales",methanosarcinales, "Methanococcoides~Methanohalophilus~Methanolobus~Methanosarcina")
|