franciscozorrilla / metaGEM

:gem: An easy-to-use workflow for generating context specific genome-scale metabolic models and predicting metabolic interactions within microbial communities directly from metagenomic data
https://franciscozorrilla.github.io/metaGEM/
MIT License
189 stars 41 forks source link

How could I get full name of compound in SMETANA result? #109

Closed HongxiangXu closed 2 years ago

HongxiangXu commented 2 years ago

image I saw compounds in result of SMETANA in tutorial was like above, but in data visualization it changes into full name. How could I get this? image

franciscozorrilla commented 2 years ago

You may use the metabolites file found in the bigg database. Also have a look at the SymbNET repo, in particular this notebook, where I use the metabolite classes file instead.

More specifically, I use the left_join() tidyverse function to join the SMETANA and metabolite names as shown in this code snippet:

# Load in some metabolite metadata
smetana_met <- read.delim("../data/bigg_classes.txt")
smet_all <- left_join(smet_all,smetana_met,by="compound")%>%
     mutate(name=as.factor(name))%>%
     mutate(super_class=as.factor(super_class))%>%
     mutate(class=as.factor(class))%>%
     mutate(sub_class=as.factor(sub_class))%>%
     drop_na()%>%
     unique()
HongxiangXu commented 2 years ago

I solved this problem through your method. Thank you very much!