zhengrongbin / MEBOCOST

A python-based package and software to predict metabolite mediated cell-cell communications by single-cell RNA-seq data
BSD 3-Clause "New" or "Revised" License
66 stars 10 forks source link

how to manually add new metabolites-sensor pair #17

Closed KarryGoCarry closed 1 year ago

KarryGoCarry commented 1 year ago

Hi, Thanks for developing this great tool. I am wondering can I manually add new metabolites-sensor pair in mouse_met_sen_October-25-2022_14-52-47.tsv file? I tried to add a new one myself, but the result do not contain the result I want. (I already removed the expression filter before run mebocost, and the metabolite related enzyme is in metabolite_associated_gene_reaction_HMDB_summary_mouse.tsv)

zhengrongbin commented 1 year ago

Hi - Can you please first check your metabolite-sensor pair mebo_obj.original_result to make sure that new pair was filtered out due to low expression and other reasons? If the new pair was not even in the original result, that means the MEBCOOST didn’t recognize your editing in the table. In that case, we should discuss how to successfully add a new pair. Thanks!

Best, Rongbin

On Oct 31, 2023, at 4:14 PM, KarryGoCarry @.***> wrote:

Hi, Thanks for developing this great tool. I am wondering can I manually add new metabolites-sensor pair in mouse_met_sen_October-25-2022_14-52-47.tsv file? I tried to add a new one myself, but the result do not contain the result I want. (I already removed the expression filter before run mebocost, and the metabolite related enzyme is in metabolite_associated_gene_reaction_HMDB_summary_mouse.tsv)

— Reply to this email directly, view it on GitHub https://github.com/zhengrongbin/MEBOCOST/issues/17, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD76SHPYKCU4EZ6HKPYM34LYCFL3VAVCNFSM6AAAAAA6YI5RB6VHI2DSMVQWIX3LMV43ASLTON2WKOZRHE3TCMRSHE2DGOI. You are receiving this because you are subscribed to this thread.

KarryGoCarry commented 1 year ago

Thank you for the quick reply!!! I think I already turned off all the filters by the below step you provided:

initiate the mebocost object

mebo_obj = mebocost.create_obj( adata = adata, group_col = ['celltype'], # change to the group you want to split met_est = 'mebocost', config_path = './mebocost.conf', exp_mat=None, cell_ann=None, species='mouse', # or human met_pred=None, met_enzyme=None, met_sensor=None, met_ann=None, scFEA_ann=None, compass_met_ann=None, compass_rxn_ann=None, gene_network=None, gmt_path=None, cutoff_exp=0, ## automated cutoff to exclude lowly ranked 25% sensors across all cells cutoff_met=0, ## automated cutoff to exclude lowly ranked 25% metabolites across all cells cutoff_prop=0, ## at lease 25% of cells should be expressed the sensor or present the metabolite in the cell group (specified by group_col) sensor_type=['Receptor', 'Transporter', 'Nuclear Receptor'], thread=8 )

In order to add a new pair (Taurine -> Slc6a6), I manually input a new row in the "mouse_met_sen_October-25-2022_14-52-47.tsv", right after your last row.

445  HMDB0000251     Taurine   Taurine   Slc6a6     Sodium- and chloride-dependent taurine transporter    New       Transporter

I also checked the expression of the Taurine-related enzyme and Slc6a6 sensor expression in my data, and the looks just fine.

zhengrongbin commented 1 year ago

It is strange. That should work. Let me test and get back to you later. Thank you!

Best, Rongbin

On Oct 31, 2023, at 4:31 PM, KarryGoCarry @.***> wrote:

Thank you for the quick reply!!! I think I already turned off all the filters by the below step you provided:

initiate the mebocost object

mebo_obj = mebocost.create_obj( adata = adata, group_col = ['celltype'], # change to the group you want to split met_est = 'mebocost', config_path = './mebocost.conf', exp_mat=None, cell_ann=None, species='mouse', # or human met_pred=None, met_enzyme=None, met_sensor=None, met_ann=None, scFEA_ann=None, compass_met_ann=None, compass_rxn_ann=None, gene_network=None, gmt_path=None, cutoff_exp=0, ## automated cutoff to exclude lowly ranked 25% sensors across all cells cutoff_met=0, ## automated cutoff to exclude lowly ranked 25% metabolites across all cells cutoff_prop=0, ## at lease 25% of cells should be expressed the sensor or present the metabolite in the cell group (specified by group_col) sensor_type=['Receptor', 'Transporter', 'Nuclear Receptor'], thread=8 )

In order to add a new pair (Taurine -> Slc6a6), I manually input a new row in the "mouse_met_sen_October-25-2022_14-52-47.tsv", right after your last row.

445 HMDB0000251 Taurine Taurine Slc6a6 Sodium- and chloride-dependent taurine transporter New Transporter

I also checked the expression of the Taurine-related enzyme and Slc6a6 sensor expression in my data, and the looks just fine.

— Reply to this email directly, view it on GitHub https://github.com/zhengrongbin/MEBOCOST/issues/17#issuecomment-1787987237, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD76SHMSYUJ4BG5LHP6AK53YCFNZVAVCNFSM6AAAAAA6YI5RB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBXHE4DOMRTG4. You are receiving this because you commented.

zhengrongbin commented 1 year ago

Hi - did you by any chance solve the problem? I tested and it works very well on my laptop. If you still have the problem, I would like to suggest checking the following things, to make sure that the edited metabolite-sensor table has been successfully updated in the MEBOCOST object. (1). check the mebo_obj.met_sensor to see if the Taurine-Slc6a6 in the table, (2). check the mebo_obj.met_mat_index to see if the HMDB0000251 in the index ('HMDB0000251' in mebo_obj.met_mat_index.tolist()) (3). check the log file to see if MEBOCOST calculated the communication score for Taurine-Slc6a6. If so, you can find an entry containing Slc6a6 ~ HMDB0000251.

Please email me if you still have the problem after checking everything, we can probably have a ZOOM meeting to figure out the problem on your side together. Thanks!

KarryGoCarry commented 1 year ago

With Dr. Zheng's help, I solved my problem. The error was caused by the expression data that Mebocost uses is the "scaled.data" in my scRNAseq which only contains 2000 top-varied genes. Since Mebocost requires h5ad file, so I when you create Mebocost input file from a pre-processed Seurat object remember to use the following code to remove "scaled.data" slot. The h5ad file will default use the slot "scaled.data", to get the full analysis you should use the full genes table instead:

Seurat.obj = DietSeurat(object = Seurat.obj, counts = T, data = T, scale.data = F, assays = "RNA", dimreducs =c('pca','tsne','umap','harmony'))

SaveH5Seurat(Seurat.obj, filename = "Data/seurat.h5Seurat")
Convert("Data/seurat.h5Seurat", dest = "h5ad")