Skip to content

Commit

Permalink
extending abundances to evopruning and refining elongated core2 def
Browse files Browse the repository at this point in the history
  • Loading branch information
Bribak committed Jun 14, 2024
1 parent 8107a64 commit 965fe6f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build/lib/glycowork/glycan_data/glycan_motifs.csv
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ M3X,Xyl(b1-2)[Man(a1-3)][Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc,"['flexible', 'fl
Arabinogalactan_type1,Araf(a1-5)Araf(a1-3)Gal(b1-4)[Araf(a1-3)]Gal,"['flexible', 'flexible', 'flexible', 'flexible', 'flexible']"
Galactomannan,Gal(a1-6)Man(b1-4)[Gal(a1-6)]Man,"['flexible', 'flexible', 'flexible', 'flexible']"
Tetraantennary_Nglycan,GlcNAc(b1-2)[GlcNAc(b1-4)]Man(a1-3)[GlcNAc(b1-2)[GlcNAc(b1-6)]Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc,"['flexible', 'flexible', 'flexible', 'flexible', 'flexible', 'flexible', 'flexible', 'flexible', 'terminal']"
Mucin_elongated_core2,Gal(b1-4)GlcNAc(b1-6)[Gal(b1-3)]GalNAc,"['flexible', 'flexible', 'flexible', 'flexible']"
Mucin_elongated_core2,Gal(b1-?)GlcNAc(b1-6)[Gal(b1-3)]GalNAc,"['flexible', 'flexible', 'flexible', 'flexible']"
Fucoidan,Fuc4S(a1-2)Fuc4S,"['flexible', 'flexible']"
Alginate,L-GulA(a1-4)ManA(b1-4)ManA,"['flexible', 'flexible', 'flexible']"
FG,Fuc(a1-2)Gal(b1-2)Xyl(a1-6)Glc(b1-4)Glc,"['flexible', 'flexible', 'flexible', 'flexible', 'flexible']"
Expand Down
2 changes: 1 addition & 1 deletion glycowork/glycan_data/glycan_motifs.csv
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ M3X,Xyl(b1-2)[Man(a1-3)][Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc,"['flexible', 'fl
Arabinogalactan_type1,Araf(a1-5)Araf(a1-3)Gal(b1-4)[Araf(a1-3)]Gal,"['flexible', 'flexible', 'flexible', 'flexible', 'flexible']"
Galactomannan,Gal(a1-6)Man(b1-4)[Gal(a1-6)]Man,"['flexible', 'flexible', 'flexible', 'flexible']"
Tetraantennary_Nglycan,GlcNAc(b1-2)[GlcNAc(b1-4)]Man(a1-3)[GlcNAc(b1-2)[GlcNAc(b1-6)]Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc,"['flexible', 'flexible', 'flexible', 'flexible', 'flexible', 'flexible', 'flexible', 'flexible', 'terminal']"
Mucin_elongated_core2,Gal(b1-4)GlcNAc(b1-6)[Gal(b1-3)]GalNAc,"['flexible', 'flexible', 'flexible', 'flexible']"
Mucin_elongated_core2,Gal(b1-?)GlcNAc(b1-6)[Gal(b1-3)]GalNAc,"['flexible', 'flexible', 'flexible', 'flexible']"
Fucoidan,Fuc4S(a1-2)Fuc4S,"['flexible', 'flexible']"
Alginate,L-GulA(a1-4)ManA(b1-4)ManA,"['flexible', 'flexible', 'flexible']"
FG,Fuc(a1-2)Gal(b1-2)Xyl(a1-6)Glc(b1-4)Glc,"['flexible', 'flexible', 'flexible', 'flexible', 'flexible']"
Expand Down
11 changes: 6 additions & 5 deletions glycowork/network/biosynthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1114,8 +1114,8 @@ def prune_network(network, node_attr = 'abundance', threshold = 0.):
return network_out


def evoprune_network(network, network_dic = None, species_list = None,
node_attr = 'abundance', threshold = 0.01, nb_intermediates = 2):
def evoprune_network(network, network_dic = None, species_list = None, node_attr = 'abundance',
threshold = 0.01, nb_intermediates = 2, mode = 'presence'):
"""given a biosynthetic network, this function uses evolutionary relationships to prune impossible paths\n
| Arguments:
| :-
Expand All @@ -1124,7 +1124,8 @@ def evoprune_network(network, network_dic = None, species_list = None,
| species_list (list): list of species to compare network to; default:species from pre-computed milk networks
| node_attr (string): which (numerical) node attribute to use for pruning; default:'abundance'
| threshold (float): everything below or equal to that threshold will be cut; default:0.01
| nb_intermediates (int): number of intermediate nodes expected in a network motif to extract; has to be a multiple of 2 (2: diamond, 4: hexagon,...)\n
| nb_intermediates (int): number of intermediate nodes expected in a network motif to extract; has to be a multiple of 2 (2: diamond, 4: hexagon,...)
| mode (string): whether to analyze for "presence" or "abundance" of intermediates; default:"presence"\n
| Returns:
| :-
| Returns pruned network (with virtual node probability as a new node attribute)
Expand All @@ -1134,8 +1135,8 @@ def evoprune_network(network, network_dic = None, species_list = None,
if species_list is None:
species_list = list(network_dic.keys())
# Calculate path probabilities of diamonds
df_out = trace_diamonds(network, species_list, network_dic,
threshold = threshold, nb_intermediates = nb_intermediates)
df_out = trace_diamonds(network, species_list, network_dic, threshold = threshold,
nb_intermediates = nb_intermediates, mode = mode)
# Scale virtual node size by path probability
network_out = highlight_network(network, highlight = 'abundance', abundance_df = df_out,
intensity_col = 'probability')
Expand Down

0 comments on commit 965fe6f

Please sign in to comment.