Package: glycowork
glycoworkGlycans are fundamental biological sequences that are as crucial as DNA,
RNA, and proteins. As complex carbohydrates forming branched structures,
glycans are ubiquitous yet often overlooked in biological research.Why Glycans are ImportantUbiquitous in biologyIntegral to protein and lipid functionRelevant to human diseasesChallenges in Glycan AnalysisAnalyzing glycans is complicated due to their non-linear structures and
enormous diversity. But that’s whereglycoworkcomes in.Introducing glycowork: Your Solution for Glycan-Focused Data ScienceGlycowork is a Python package specifically designed to simplify glycan
sequence processing and analysis. It offers:Functions for glycan analysisDatasets for model trainingFull support for IUPAC-condensed string representation. Broad support
for IUPAC-extended, LinearCode, Oxford, GlycoCT, and WURCS.Powerful graph-based architecture for in-depth analysisDocumentation:https://bojarlab.github.io/glycowork/Contribute:Interested in contributing? Read ourContribution
GuidelinesCitation:Ifglycoworkadds value to your project, please citeThomes et al.,
2021Installvia pip:pip install glycoworkimport glycoworkalternative:pip install git+https://github.com/BojarLab/glycowork.gitimport glycoworkNote that we have optional extra installs for specialized use (even
further instructions can be found in theExamplestab), such as:deep learningpip install glycowork[ml]drawing glycan
images with GlycoDraw (see install instructions in theExamplestab)pip install glycowork[draw]analyzing atomic/chemical
properties of glycanspip install glycowork[chem]everythingpip install glycowork[all]Data & ModelsGlycoworkcurrently contains the following main datasets that are
freely available to everyone:df_glycancontains ~50,000 unique glycan sequences, including labels such as
~37,500 species associations, ~16,500 tissue associations, and
~1,000 disease associationsglycan_bindingcontains >550,000 protein-glycan binding interactions, from 1,392
unique glycan-binding proteinsAdditionally, we store these trained deep learning models for easy
usage, which can be retrieved with theprep_modelfunction:LectinOraclecan be used to predict glycan-binding specificity of a protein,
given its ESM-1b representation; fromLundstrom et al.,
2021LectinOracle_flexoperates the same as LectinOracle but can directly use the raw
protein sequence as input (no ESM-1b representation required)SweetNeta graph convolutional neural network trained to predict species from
glycan, can be used to generate learned glycan representations; fromBurkholz et al., 2021NSequonPredgiven the ESM-1b representation of an N-sequon (+/- 20 AA), this
model can predict whether the sequon will be glycosylatedHow to useGlycoworkcurrently contains four main modules:glycan_datastores several glycan datasets and contains helper functionsmlhere are all the functions for training and using machine learning
models, including train-test-split, getting glycan representations,
etc.motifcontains functions for processing & drawing glycan sequences,
identifying motifs and features, and analyzing themnetworkcontains functions for constructing and analyzing glycan networks
(e.g., biosynthetic networks)Below are some examples of what you can do withglycowork; be sure to
check out the otherexamplesin the full documentation for everything
that’s there. A non-exhaustive list includes:using trained AI models for predictiontraining your own AI modelsmotif enrichment analysesdifferential glycomics expression analysisannotating motifs in glycansdrawing publication-quality glycan figuresfinding out whether & where glycans are describing the same sequencem/z to composition to structure to motif mappingsmass calculationvisualizing motif distribution / glycan similarities / sequence
propertiesconstructing and analyzing biosynthetic networks#drawing publication-quality glycan figuresfromglycowork.motif.drawimportGlycoDrawGlycoDraw("Neu5Ac(a2-3)Gal(b1-4)[Fuc(a1-3)]GlcNAc(b1-2)Man(a1-3)[Neu5Gc(a2-6)Gal(b1-4)GlcNAc(b1-2)Man(a1-6)][GlcNAc(b1-4)]Man(b1-4)GlcNAc(b1-4)[Fuc(a1-6)]GlcNAc",highlight_motif="Neu5Ac(a2-3)Gal(b1-4)[Fuc(a1-3)]GlcNAc")#get motifs, graph features, and sequence features of a set of glycan sequences to train models or analyze glycan propertiesglycans=["Neu5Ac(a2-3)Gal(b1-4)[Fuc(a1-3)]GlcNAc(b1-2)Man(a1-3)[Gal(b1-3)[Fuc(a1-4)]GlcNAc(b1-2)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)[Fuc(a1-6)]GlcNAc","Ma3(Ma6)Mb4GNb4GN;N","α-D-Manp-(1→3)[α-D-Manp-(1→6)]-β-D-Manp-(1→4)-β-D-GlcpNAc-(1→4)-β-D-GlcpNAc-(1→","F(3)XA2","WURCS=2.0/5,11,10/[a2122h-1b_1-5_2*NCC/3=O][a1122h-1b_1-5][a1122h-1a_1-5][a2112h-1b_1-5][a1221m-1a_1-5]/1-1-2-3-1-4-3-1-4-5-5/a4-b1_a6-k1_b4-c1_c3-d1_c6-g1_d2-e1_e4-f1_g2-h1_h4-i1_i2-j1","""RES1b:b-dglc-HEX-1:52s:n-acetyl3b:b-dglc-HEX-1:54s:n-acetyl5b:b-dman-HEX-1:56b:a-dman-HEX-1:57b:b-dglc-HEX-1:58s:n-acetyl9b:b-dgal-HEX-1:510s:sulfate11s:n-acetyl12b:a-dman-HEX-1:513b:b-dglc-HEX-1:514s:n-acetyl15b:b-dgal-HEX-1:516s:n-acetylLIN1:1d(2+1)2n2:1o(4+1)3d3:3d(2+1)4n4:3o(4+1)5d5:5o(3+1)6d6:6o(2+1)7d7:7d(2+1)8n8:7o(4+1)9d9:9o(-1+1)10n10:9d(2+1)11n11:5o(6+1)12d12:12o(2+1)13d13:13d(2+1)14n14:13o(4+1)15d15:15d(2+1)16n"""]fromglycowork.motif.annotateimportannotate_datasetout=annotate_dataset(glycans,feature_set=['known','terminal','exhaustive'])Terminal_LewisXInternal_LewisXLewisYSialylLewisXSulfoSialylLewisXTerminal_LewisAInternal_LewisALewisBSialylLewisASulfoLewisAH_type2H_type1A_antigenB_antigenGalili_antigenGloboHGb5Gb4Gb33SGb38DSGb33SGb48DSGb46DSGb43SGb58DSGb56DSGb56DSGb5_26SGb38DSGb3_26SGb48DSGb4_26SGb58DSGb5_266DSGb5Forssman_antigeniGb3I_antigeni_antigenPI_antigenChitobioseTrimannosylcoreInternal_LacNAc_type1Terminal_LacNAc_type1Internal_LacNAc_type2Terminal_LacNAc_type2Internal_LacdiNAc_type1Terminal_LacdiNAc_type1Internal_LacdiNAc_type2Terminal_LacdiNAc_type2bisectingGlcNAcVIMPolyLacNAcGanglio_SeriesLacto_Series(LewisC)NeoLacto_SeriesbetaGlucanKeratanSulfateHyluronanMollu_seriesArthro_seriesCellulose_likeChondroitin_4SGPI_anchorIsoglobo_seriesLewisDGlobo_seriesSdaSDAMuco_seriesHeparinPeptidoglycanDermatansulfateCADLactosylceramideLactotriaosylceramideLexLexGM3H_type3GM2GM1cisGM1VIM2GD3GD1aGD2GD1bSDLexNglycolyl_GM2Fuc_LN3GT1bGD1GD1a_2LcGg4GT3Disialyl_T_antigenGT1aGT2GT1c2Fuc_GM1GQ1cO_linked_mannoseGT1aaGQ1bHNK1GQ1baO_mannose_Lex2Fuc_GD1bSialopentaosylceramideSulfogangliotetraosylceramideB-GM1GQ1aabisSulfo-Lewis xpara-Forssmancore_fucosecore_fucose(a1-3)GP1cB-GD1bGP1caIsoglobotetraosylceramidepolySiahigh_mannoseGala_seriesLPS_coreNglycan_complexNglycan_complex2Oglycan_core1Oglycan_core2Oglycan_core3Oglycan_core4Oglycan_core5Oglycan_core6Oglycan_core7XylogalacturonanSialosylparaglobosideLDNFOFucArabinogalactan_type2EGF_repeatNglycan_hybridArabinanXyloglucanAcharan_SulfateM3FXM3X1-6betaGalactanArabinogalactan_type1GalactomannanTetraantennary_NglycanMucin_elongated_core2FucoidanAlginateFGXXDifucosylated_coreGalFuc_coreFucGalGalNAcGalNAcOSGlcNAcManNeu5AcXylNeu5Ac(a2-3)GalGal(b1-4)GlcNAcFuc(a1-3)GlcNAcGlcNAc(b1-2)ManMan(a1-3)ManGal(b1-3)GlcNAcFuc(a1-4)GlcNAcMan(a1-6)ManMan(b1-4)GlcNAcGlcNAc(b1-4)GlcNAcFuc(a1-6)GlcNAcXyl(b1-2)ManFuc(a1-2)GalGalNAcOS(b1-4)GlcNAcGalNAc(b1-4)GlcNAcGal(b1-?)GlcNAcFuc(a1-?)GlcNAcGlcNAc(b1-?)ManMan(a1-?)ManFuc(a1-6)Gal(b1-3)Man(a1-6)Gal(b1-4)GalNAc(b1-4)Fuc(a1-4)GalNAcOS(b1-4)Neu5Ac(a2-3)Fuc(a1-2)Xyl(b1-2)Fuc(a1-3)Man(a1-3)Fuc(a1-?)Man(a1-?)Gal(b1-?)GlcNAc(b1-?)Neu5Ac(a2-3)Gal(b1-4)[Fuc(a1-3)]GlcNAc(b1-2)Man(a1-3)[Gal(b1-3)[Fuc(a1-4)]GlcNAc(b1-2)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)[Fuc(a1-6)]GlcNAc0101010000000000000000000000000000000000110110000000000000000000000000000000000000000000000000000000000000000000001000000000100000000000000000000000000000003200431011121111111000023221100010100103010Man(a1-3)[Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc0000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000230000001001110000000020010000000010200Man(a1-3)[Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc0000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000230000001001110000000020010000000010200GlcNAc(b1-?)Man(a1-3)[GlcNAc(b1-?)Man(a1-6)][Xyl(b1-2)]Man(b1-4)GlcNAc(b1-4)[Fuc(a1-3)]GlcNAc0000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000100000000110000000000000000010000000000001000430100101001110100001220000000001101002Fuc(a1-2)Gal(b1-4)GlcNAc(b1-2)Man(a1-6)[Gal(b1-4)GlcNAc(b1-2)Man(a1-3)]Man(b1-4)GlcNAc(b1-4)[Fuc(a1-6)]GlcNAc0000000000100000000000000000000000000000110011000000000000000000000000000000000000000000000000000000000000000000001000000000100000000000000000000000000000002200430002021001111010021221001000010002010GalNAcOS(b1-4)GlcNAc(b1-2)Man(a1-3)[GalNAc(b1-4)GlcNAc(b1-2)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc0000000000000000000000000000000000000000110000000100000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000011430000021001110001100220000101000000000#using graphs, you can easily check whether a glycan contains a specific motif; how about internal Lewis A/X motifs?fromglycowork.motif.graphimportsubgraph_isomorphismprint(subgraph_isomorphism('Neu5Ac(a2-3)Gal(b1-4)[Fuc(a1-3)]GlcNAc(b1-6)[Gal(b1-3)]GalNAc','Fuc(a1-?)[Gal(b1-?)]GlcNAc',termini_list=['terminal','internal','flexible']))print(subgraph_isomorphism('Neu5Ac(a2-3)Gal(b1-3)[Fuc(a1-4)]GlcNAc(b1-6)[Gal(b1-3)]GalNAc','Fuc(a1-?)[Gal(b1-?)]GlcNAc',termini_list=['t','i','f']))print(subgraph_isomorphism('Gal(b1-3)[Fuc(a1-4)]GlcNAc(b1-6)[Gal(b1-3)]GalNAc','Fuc(a1-?)[Gal(b1-?)]GlcNAc',termini_list=['t','i','f']))#or you could find the terminal epitopes of a glycanfromglycowork.motif.annotateimportget_terminal_structuresprint("\nTerminal structures:")print(get_terminal_structures('Man(a1-3)[Man(a1-6)]Man(b1-4)GlcNAc(b1-4)[Fuc(a1-6)]GlcNAc'))True
True
False

Terminal structures:
['Man(a1-3)', 'Man(a1-6)', 'Fuc(a1-6)']#given a composition, find matching glycan structures in SugarBase; specific for glycan classes and taxonomyfromglycowork.motif.tokenizationimportcompositions_to_structuresprint(compositions_to_structures([{'Hex':3,'HexNAc':4}],glycan_class='N'))#or we could calculate the mass of this compositionfromglycowork.motif.tokenizationimportcomposition_to_massprint("\nMass of the composition Hex3HexNAc4")print(composition_to_mass({'Hex':3,'HexNAc':4}))print(composition_to_mass("H3N4"))print(composition_to_mass("Hex3HexNAc4"))0 compositions could not be matched. Run with verbose = True to see which compositions.
                                               glycan  abundance
0   GlcNAc(b1-2)Man(a1-3)[GlcNAc(b1-2)Man(a1-6)]Ma...          0
1   GalNAc(b1-4)GlcNAc(b1-2)Man(a1-3)[Man(a1-6)]Ma...          0
2   GlcNAc(b1-2)Man(a1-6)[Man(a1-3)][GlcNAc(b1-4)]...          0
3   Man(a1-3)[GlcNAc(b1-4)][GlcNAc(b1-2)Man(a1-6)]...          0
4   GlcNAc(b1-2)Man(a1-3)[GlcNAc(b1-4)][Man(a1-6)]...          0
5   GlcNAc(?1-?)Man(a1-3)[GlcNAc(b1-?)Man(a1-6)]Ma...          0
6   GlcNAc(b1-2)[GlcNAc(b1-4)]Man(a1-3)[Man(a1-6)]...          0
7   GlcNAc(b1-2)Man(a1-3)[GlcNAc(b1-6)Man(a1-6)]Ma...          0
8   GlcNAc(b1-4)Man(a1-3)[GlcNAc(b1-6)Man(a1-6)]Ma...          0
9   GlcNAc(b1-2)Man(a1-3)[GlcNAc(b1-2)Man(a1-6)][G...          0
10  GlcNAc(b1-2)Man(a1-3)[GlcNAc(b1-2)[GlcNAc(b1-4...          0
11  GlcNAc(b1-2)[GlcNAc(b1-4)]Man(a1-3)[GlcNAc(b1-...          0
12  GlcNAc(b1-4)Man(a1-3)[GlcNAc(b1-2)Man(a1-6)]Ma...          0
13  Man(a1-3)[GlcNAc(b1-2)[GlcNAc(b1-6)]Man(a1-6)]...          0
14  GalNAc(b1-4)GlcNAc(b1-2)Man(a1-6)[Man(a1-3)]Ma...          0

Mass of the composition Hex3HexNAc4
1316.4865545999999
1316.4865545999999
1316.4865545999999