Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

L2 Norm Method - Query #10

Open
Kurious-HG opened this issue Jan 29, 2023 · 3 comments
Open

L2 Norm Method - Query #10

Kurious-HG opened this issue Jan 29, 2023 · 3 comments

Comments

@Kurious-HG
Copy link

Kurious-HG commented Jan 29, 2023

Hello, Thank you for making this code available for use.
I am new to this kind of work and had 2 queries:

1. I was exploring the code to make sense of the deconvolution results, and saw that the calculation in sub_loss function under L2 Norm method is different at 'ENIGMA/blob/main/ENIGMA_analysis/ENIGMA_Script/ENIGMA.R' (which I ran) compared to the 'ENIGMA/blob/main/R/ENIGMA_L2_norm.R'

The algorithm details in the publication seem to match with ENIGMA_L2_norm.R

Please let me know if I am missing something, Thanks.

ENIGMA_L2_norm.R
image

ENIGMA.R
image

2. You have mentioned in the publication "We multiplied β with the expectation of θi, which means that if the average proportion of this cell type is low in bulk samples, the rank constraint will be relatively loose"
Can you please guide me as to where in the code this multiplication is done for the L2 Norm Method.

@Kurious-HG Kurious-HG changed the title L2 Norm Calculation L2 Norm Calculation (Resolved) Jan 29, 2023
@Kurious-HG Kurious-HG changed the title L2 Norm Calculation (Resolved) L2 Norm Method - Query Jan 29, 2023
@Kurious-HG Kurious-HG reopened this Jan 29, 2023
@WWXkenmo
Copy link
Owner

Hey,

Thanks for your kind notice. Here is my point by point response to your questions

  1. ENIGMA stop condition is based on the distance between (k+1)th CSE and (k)th CSE. So the loss would not influence the convergence but only for inspection optimisation process.
    Meanwhile our code have done some optimisation in our revised manuscript but haven't update in GitHub and our biorxiv preprint. I have uploaded the newest code in ENIGMA.R file (bottom, start from line:1093), and you could compare the difference between newest code with our raw version code. Basically we have 1) renormalised the bulk transcriptome and reference so that they have similar scale 2) Use matrix condition matrix as the stop condition for ENIGMA_trace. I would update the newest, revised preprint soon.

  2. L2 norm don't need to perform multiplication of average cell type proportion. Because it's not regularise the rank of the inferred CSE. We have discussed about the rationality of loss design. And would upload soon on biorxiv.

if you have any further question, contact with me with no hesitation.
Best Regards,
Ken

@Kurious-HG
Copy link
Author

Thanks for the quick response Ken,

For 1) I understand, and I'll re-run the newer version. Thank you.

For 2) Ah, ok... Based on the HNSCC and Melanoma results (Gene level correlation between Single cell and Deconvoluted Pseudo Bulk) I saw cells with low proportion having much more discordance even with the L2 Norm, hence thought this might be the reasoning.
I'll rerun the newer version and may contact you again.

Thanks again to you and your Team.
HG

@WWXkenmo
Copy link
Owner

Cool, please post any questions, there are a lot of stuffs in our analysis code, it's super mess but I try to streamline these, definitely would be helpful if someone could review those.

Best
Ken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants