Template:LBS/FormatSugar: Difference between revisions

mNo edit summary
(Replaced content with "{{#invoke:LBS|FormatSugar||{{{1|GlcNAca/b1-3Xyla-4Galb1-3GalNAca1-4(NeuAc?1-2NeuGc4Mea1-3)GalNAcb1-4(EtnP-6)GlcNAcb1-3Manb1-4Glcb1-1Cer}}}}}")
Tag: Replaced
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#lua:
{{#invoke:LBS|FormatSugar||{{{1|GlcNAca/b1-3Xyla-4Galb1-3GalNAca1-4(NeuAc?1-2NeuGc4Mea1-3)GalNAcb1-4(EtnP-6)GlcNAcb1-3Manb1-4Glcb1-1Cer}}}}}
  local seq = stdin:match("[%S()%[%], ]+");
  local ret = "";
  seq = string.gsub(seq, "a([1-9?]%-[1-9/?]*)", "<sub>&alpha;%1</sub>");
  seq = string.gsub(seq, "b([1-9?]%-[1-9/?]*)", "<sub>&beta;%1</sub>");
  seq = string.gsub(seq, "?([1-9?]%-[1-9/?]*)", "<sub>?%1</sub>");
  seq = string.gsub(seq, "Cer$", "<b>Cer</b>");
  seq = string.gsub(seq, "(Gal[NAcH234Me]*)", '<span style="color:Gold"><b>%1</b></span>');
  seq = string.gsub(seq, "(Glc[NAcH2]*)", '<span style="color:Blue"><b>%1</b></span>');
  seq = string.gsub(seq, "(Man[A]*)", '<span style="color:Green"><b>%1</b></span>');
  seq = string.gsub(seq, "(Rha)", '<span style="color:Green"><b>%1</b></span>');
  seq = string.gsub(seq, "(Fuc[A]*)", '<span style="color:Red"><b>%1</b></span>');
  seq = string.gsub(seq, "(NeuAc[Me489]*)", '<span style="color:Purple"><b>%1</b></span>');
  seq = string.gsub(seq, "(NeuGc[Me489]*)", '<span style="color:Gray"><b>%1</b></span>');
  seq = string.gsub(seq, "(Xyl)", '<span style="color:DarkOrange"><b>%1</b></span>');
  seq = string.gsub(seq, "(Ara)", '<span style="color:DarkOrange"><b>%1</b></span>');
  seq = string.gsub(seq, "(KDN)", '<span style="color:Green"><b>%1</b></span>');
  print(seq);
|{{{1|GlcNAcb1-3Xyla1-4Galb1-3GalNAca1-4(NeuAc?1-2NeuGc4Mea1-3)GalNAcb1-4(EtnP-6)GlcNAcb1-3Manb1-4Glcb1-1Cer}}}}}

Latest revision as of 07:28, 1 February 2023

GlcNAcα/β1-3Xylα-4Galβ1-3GalNAcα1-4(NeuAc?1-2NeuGc4Meα1-3)GalNAcβ1-4(EtnP-6)GlcNAcβ1-3Manβ1-4Glcβ1-1Cer