spxuw / DKI

MIT License
32 stars 9 forks source link

How to get Ptrain(steady_state_relative) by absolute abundance? #1

Open linlin0026 opened 1 year ago

linlin0026 commented 1 year ago

Hello, dear associate professor. I learned about your development of CNODE2 through CHINAGut in Beijing last weekend, which I benefited a lot. I would like your advice on generating the Ptrain.csv file when using human stool samples for keystoneness calculation. I have fecal samples' absolute abundance data through qpcr experiments, which I think can be directly regarded as steady_stateabsolute. However, I am confused about how to generate Ptrain(steady_state_relative)_ by removing each species in each sample based on the real data. In the _Simulated_datageneration.R you provided, glv is built twice by setting the abundance of the species j1 to 0 to get Ptrain(steady_state_relative), but how can I get ① the interaction matrix Athe growth rate b for each species in the real data? Could you kindly provide the code for this part, if it's not too much trouble? Thanks again.

Or can you point me toward modifying the code "_x = glv(N = N, A, b = b, y = y0, tstart = 0, tend = 100, tstep = 0.1, perturb = NULL)"? For example, I can use the lasso equation to construct A but don't know how to get b.

尊敬的老师,您好,我通过上周末在北京举办的肠道大会了解到了您开发的CNODE2,这篇文章让我学习到了很多,非常感谢。 我有些不清楚您实际使用人类粪便样本进行keystoneness计算时是如何生成Ptrain.csv文件的?我通过湿实验得到了物种的绝对丰度数据,我认为可以将绝对丰度数据直接作为steady_state_absolute;但我不太清楚后续该如何从真实数据中,利用glv模型将每一个样本的每一个物种进行剔除并生成Ptrain(steady_state_relative)。 在_Simulated_data_generation.R_中,您通过将species j1的丰度设为0再次构建了glv方程,但在真实数据中我该如何得到①相互作用矩阵A②每个物种的growth rate b 呢? 您是否可以将这一部分的代码进行分享呢?非常感谢您的帮助。 或者您是否可以指导我修改“_x = glv(N = N, A, b = b, y = y0, tstart = 0, tend = 100, tstep = 0.1, perturb = NULL)“代码的方向呢?例如我觉得可以使用lasso方程来构建A,但不知道怎么得到b; 再次非常感谢您的阅读和帮助。

spxuw commented 1 year ago

Hi Lin, Would you please let me know your email address to facilitate smoother communication between us? Thanks.

linlin0026 commented 1 year ago

Thanks for your reply. I sent an email to your Gmail address just a few minutes ago.

liaohu1231 commented 10 months ago

Hello, dear associate professor. I have a similar question, how can we obtain the Ptest file through our real relative abundance matrix.

spxuw commented 10 months ago

Hi Hu, you will not have the Ptest for the real relative abundance matrix. Ptest is the true composition after species' removal. Instead, you could have the Ztest.