yunguan-wang / Spacia

BSD 3-Clause "New" or "Revised" License
22 stars 2 forks source link

Differential analysis format #51

Open rbutleriii opened 2 months ago

rbutleriii commented 2 months ago

Hello again,

I am interested in creating a differential role analysis as in Figure 6. Perhaps a silly question, but did you just run each condition separately through spacia, and then do custom scripts to test the outputs?

Thanks

wtwt5237 commented 2 months ago

Yes, you are right. We did separate analyses and then compared the results in the downstream.

It would be lovely to have some integrated differential analyses as part of the core model. We would defer to follow up works from people in the community :)

Tao

rbutleriii commented 1 month ago

Hi @wtwt5237, making some progress on this, though I did have a few more questions:

  1. For figure 6d, it looks like spacia was run with -sf SQMST1 and no -rf set. Is that pathway enrichment of a particular module of receiver genes, or the combination of all significant modules?
  2. For figure 6e, did you run spacia separately for each receiver gene? Is there a way to look at a set of receiver genes independently without spacia combining them (as it does when you do -rf geneA|geneB|geneC)
  3. How do you access the list of all betas (is it in geneX_correlated_genes/geneX_correlated_genes_beta.txt)?
wtwt5237 commented 1 month ago

Hello!

Is that pathway enrichment of a particular module of receiver genes, or the combination of all significant modules? – If I understand you correctly, it’s a particular module of receiver genes. The findings in the prior parts of this section led us to narrow down and investigate some specific modules

For figure 6e, did you run spacia separately for each receiver gene? - Yes

Is there a way to look at a set of receiver genes independently without spacia combining them (as it does when you do -rf geneA|geneB|geneC) – Yes. Spacia can do both. If you are not sure how to set this in the input, please contact James for the R interface and Yunguan for the python interface.

How do you access the list of all betas (is it in geneX_correlated_genes/geneX_correlated_genes_beta.txt)? – Sorry. I cannot recall the details. Please contact James for the R interface and Yunguan for the python interface.

Thanks!

Tao

From: Robert Butler @.> Sent: Saturday, October 19, 2024 1:05 PM To: yunguan-wang/Spacia @.> Cc: Tao Wang @.>; Mention @.> Subject: Re: [yunguan-wang/Spacia] Differential analysis format (Issue #51)

EXTERNAL MAIL

Hi @wtwt5237https://urldefense.com/v3/__https:/github.com/wtwt5237__;!!MznTZTSvDXGV0Co!CeOb7BAqrGZoBVxD28JQilJ9EABf7jorQFddULwUIndD4qMgkoJrT33m3LERZHRBmeU9vqXKx_Jz8KZe3E0xIz945KwXmSzD$, making some progress on this, though I did have a few more questions:

  1. For figure 6d, it looks like spacia was run with -sf SQMST1 and no -rf set. Is that pathway enrichment of a particular module of receiver genes, or the combination of all significant modules?
  2. For figure 6e, did you run spacia separately for each receiver gene? Is there a way to look at a set of receiver genes independently without spacia combining them (as it does when you do -rf geneA|geneB|geneC)
  3. How do you access the list of all betas (is it in geneX_correlated_genes/geneX_correlated_genes_beta.txt)?

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/yunguan-wang/Spacia/issues/51*issuecomment-2424111709__;Iw!!MznTZTSvDXGV0Co!CeOb7BAqrGZoBVxD28JQilJ9EABf7jorQFddULwUIndD4qMgkoJrT33m3LERZHRBmeU9vqXKx_Jz8KZe3E0xIz945IlmtBWH$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AAXIKLOVKIAF45SUAE3UP6TZ4KNLDAVCNFSM6AAAAABOBSREAKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRUGEYTCNZQHE__;!!MznTZTSvDXGV0Co!CeOb7BAqrGZoBVxD28JQilJ9EABf7jorQFddULwUIndD4qMgkoJrT33m3LERZHRBmeU9vqXKx_Jz8KZe3E0xIz945KZgPA71$. You are receiving this because you were mentioned.Message ID: @.**@.>> CAUTION: This email originated from outside UTSW. Please be cautious of links or attachments, and validate the sender's email address before replying.


UT Southwestern

Medical Center

The future of medicine, today.

rbutleriii commented 4 weeks ago

Hi @yunguan-wang and @zzhu33, I am making progress with the differential analysis, comparing four groups as in Fig6a using the unfiltered output of Interactions.csv: plot_zoom_png

I am not sure how to get the distances for Figure 6b. Do you know which file in the py output contains those? Is it a flattened dist_sender.json? The average value for each sender cell or all values for each cell?

I can also make a pathway enrichments (Figs 6 c&d) easily enough for modules discovered from clustering. to be continued...

Also as above, to make the plot in Fig 6e, @yunguan-wang do you know is it geneX_correlated_genes/geneX_correlated_genes_beta.txt in the py output that has the distribution of betas?

yunguan-wang commented 3 weeks ago

It is saved in the geneX_correlated_genes_beta.txt file. The beta are organized in order of chains. For example, if there is 3 mcmc chains, each with n =10000, and nthin is 10, then there should be (10000/10*3) + 3 (init values) values for beta.

rbutleriii commented 2 weeks ago

I was plotting Fig6e with my data using the Ntrk2_correlated_genes_beta.txt and I got results that trended towards the Beta values in the Pathway_betas.csv file, but were notably smaller:

      group                 module        Sender_pathway        Beta         pval     pval_adj
     <char>                 <char>                <char>       <num>        <num>        <num>
1:   PS19-V Ntrk2_correlated_genes Bdnf_correlated_genes  0.97840573 5.090559e-22 5.090559e-22
2: PS19-C31 Ntrk2_correlated_genes Bdnf_correlated_genes  0.45000446 2.238242e-04 2.238242e-04
3:     WT-V Ntrk2_correlated_genes Bdnf_correlated_genes  1.14059361 1.324546e-30 1.324546e-30
4:   WT-C31 Ntrk2_correlated_genes Bdnf_correlated_genes -0.07797043 4.375069e-01 4.375069e-01
plot_zoom_png

Are the values calculated for the final Pathway_betas.csv means or adjusted? It noted in the figure data that the values were downsampled to 10000. Do you recommend randomly downsampling prior to differential testing? Excluding outliers? Some individual betas were quite large (>20).

wtwt5237 commented 2 weeks ago

Hello!

Could you please email Noah Chang @.**@.> for your question? He generated Fig. 6e

Thanks!

Tao

From: Robert Butler @.> Sent: Friday, November 8, 2024 6:33 PM To: yunguan-wang/Spacia @.> Cc: Tao Wang @.>; Mention @.> Subject: Re: [yunguan-wang/Spacia] Differential analysis format (Issue #51)

EXTERNAL MAIL

I was plotting Fig6e with my data using the Ntrk2_correlated_genes_beta.txt and I got results that trended towards the Beta values in the Pathway_betas.csv file, but were notably smaller:

  group                 module        Sender_pathway        Beta         pval     pval_adj

 <char>                 <char>                <char>       <num>        <num>        <num>

1: PS19-V Ntrk2_correlated_genes Bdnf_correlated_genes 0.97840573 5.090559e-22 5.090559e-22

2: PS19-C31 Ntrk2_correlated_genes Bdnf_correlated_genes 0.45000446 2.238242e-04 2.238242e-04

3: WT-V Ntrk2_correlated_genes Bdnf_correlated_genes 1.14059361 1.324546e-30 1.324546e-30

4: WT-C31 Ntrk2_correlated_genes Bdnf_correlated_genes -0.07797043 4.375069e-01 4.375069e-01 plot_zoom_png.png (view on web)https://urldefense.com/v3/__https:/github.com/user-attachments/assets/3f4ccfa2-90e8-410c-9b57-81c638cbde1a__;!!MznTZTSvDXGV0Co!EcPV2c7f5Jhaet46KTQdgN6B78TknmhEv-8eBbrtbCX5cJaiUU_GSLQQTN8hvy0zgCzjWidz1Imf2xNxFdBKYy_IImVPKOFI$

Are the values calculated for the final Pathway_betas.csv means or adjusted? It noted in the figure data that the values were downsampled to 10000. Do you recommend randomly downsampling prior to differential testing? Excluding outliers? Some individual betas were quite large (>20).

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/yunguan-wang/Spacia/issues/51*issuecomment-2465940725__;Iw!!MznTZTSvDXGV0Co!EcPV2c7f5Jhaet46KTQdgN6B78TknmhEv-8eBbrtbCX5cJaiUU_GSLQQTN8hvy0zgCzjWidz1Imf2xNxFdBKYy_IIh4WaOmh$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AAXIKLNZ5TMI4HAEQTCUJGDZ7VJ4NAVCNFSM6AAAAABOBSREAKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRVHE2DANZSGU__;!!MznTZTSvDXGV0Co!EcPV2c7f5Jhaet46KTQdgN6B78TknmhEv-8eBbrtbCX5cJaiUU_GSLQQTN8hvy0zgCzjWidz1Imf2xNxFdBKYy_IIu-hD9mu$. You are receiving this because you were mentioned.Message ID: @.**@.>> CAUTION: This email originated from outside UTSW. Please be cautious of links or attachments, and validate the sender's email address before replying.


UT Southwestern

Medical Center

The future of medicine, today.