BnpC icon indicating copy to clipboard operation
BnpC copied to clipboard

how can I map my cells to an previously generated cluster?

Open jeffchen2000 opened this issue 1 year ago • 3 comments

Hi there is a publication that has their generated cluster by BnpC, and each cluster associates with a function, now how can I map my data to such an existing cluster? (I don't want to use my data to generate any new cluster because I want to map my data to their functions).

this is equivalent to the situation below: I have 11 samples, and I want to use 10 of them to generate a cluster, and use the 11th sample to map to the pre-generated cluster from the 10 samples.

if current version of BnpC does not support such a request, could you let me know which part of your code needs to be changed?

jeffchen2000 avatar May 13 '23 17:05 jeffchen2000

Hey,

Currently, there is only the argument --fixed_assignment <ASSIGNMENT FILE> implemented, which does not update cluster assignments, but that is not what you want, is it?

As I understand (I did not get your example fully), you want to have the assignment flexible/learned but the clusters fixed? You could do the same as for the assignment, init the clusters from a given file, and then just update the assignments and skip the rest of the update steps (https://github.com/cbg-ethz/BnpC/blob/b4dfefc1962b4802ab685604d321548035456e6e/libs/MCMC.py#LL321C27-L321C27).

Unfortunately, I don't have the time atm to implement it myself, but let me know if you get stuck somewhere.

Cheers

NBMueller avatar May 22 '23 08:05 NBMueller

Great, thank you so much! I will try and let you know. Again, thanks a lot.

Xianfeng Chen

From: Nico B. @.> Sent: Monday, May 22, 2023 1:51 AM To: cbg-ethz/BnpC @.> Cc: Chen, Xianfeng, Ph.D. @.>; Author @.> Subject: [EXTERNAL] Re: [cbg-ethz/BnpC] how can I map my cells to an previously generated cluster? (Issue #27)

Hey,

Currently, there is only the argument --fixed_assignment <ASSIGNMENT FILE> implemented, which does not update cluster assignments, but that is not what you want, is it?

As I understand (I did not get your example fully), you want to have the assignment flexible/learned but the clusters fixed? You could do the same as for the assignment, init the clusters from a given file, and then just update the assignments and skip the rest of the update steps (https://github.com/cbg-ethz/BnpC/blob/b4dfefc1962b4802ab685604d321548035456e6e/libs/MCMC.py#LL321C27-L321C27).

Unfortunately, I don't have the time atm to implement it myself, but let me know if you get stuck somewhere.

Cheers

Reply to this email directly, view it on GitHubhttps://github.com/cbg-ethz/BnpC/issues/27#issuecomment-1556809504, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJLCGDO2BY5PAGLMPTEVBADXHMSILANCNFSM6AAAAAAYATPDKA. You are receiving this because you authored the thread.Message ID: @.@.>>

jeffchen2000 avatar May 23 '23 15:05 jeffchen2000

hi Bnpc team

seems --fixed_assignment <ASSIGNMENT FILE> implemented is not what I want.

I want the cluster and mutation to be fixed like below (this can be from another study, and they detected 5 clusters), now, I want to map my sample cells to the fixed clusters

mutation_ID cluster1 cluster2 cluster3 cluster4 cluster5 13_32893245_.A_G,C 0 0 0 0 0 13_32906729.A_C,T 1 0 1 1 1 13_32907171.G_T,A 0 0 0 0 0 13_32907303.GGCC_AGCC,* 0 0 0 0 0 13_32907305.C_A,T 0 0 0 0 0 13_32907306.C_A,T 0 0 0 0 0 13_32907420.GA_G,AA 0 0 0 0 0 13_32911073.CA_C,TA 0 0 0 0 0 13_32911873.T_A,C 0 0 0 0 0 13_32912175.A_G,C 0 0 0 0 0 13_32912345.GA_G,AA 0 0 0 0 0 13_32912472.C_T,A 0 0 0 0 0 13_32912674.A_G,T 0 0 0 0 0 13_32913558._CA_C,TA 0 0 0 0 0

And after mapping, I expect to get "genotypes_posterior_mean.tsv" as below (where each column is each of my cells, each of my cell is assigned to the cluster of the (cluster1-5 above)

cluster1 Cluster2 Cluster3 cluster1 cluster1 cluster1 cluster1 13_32893245_.A_G,C 0 0 0 0 0 0 0 13_32906729.A_C,T 1 0 1 1 1 1 0 13_32907171.G_T,A 0 0 0 0 0 0 0 13_32907303.GGCC_AGCC,* 0 0 0 0 0 0 0 13_32907305.C_A,T 0 0 0 0 0 0 0 13_32907306.C_A,T 0 0 0 0 0 0 0 13_32907420.GA_G,AA 0 0 0 0 0 0 0 13_32911073.CA_C,TA 0 0 0 0 0 0 0 13_32911873.T_A,C 0 0 0 0 0 0 0 13_32912175.A_G,C 0 0 0 0 0 0 0 13_32912345.GA_G,AA 0 0 0 0 0 0 0 13_32912472.C_T,A 0 0 0 0 0 0 0 13_32912674.A_G,T 0 0 0 0 0 0 0 13_32913558._CA_C,TA 0 0 0 0 0 0 0

Basically I want to compare my cells to other studies

Thanks a lot for comments

From: Nico B. @.> Sent: Monday, May 22, 2023 1:51 AM To: cbg-ethz/BnpC @.> Cc: Chen, Xianfeng, Ph.D. @.>; Author @.> Subject: [EXTERNAL] Re: [cbg-ethz/BnpC] how can I map my cells to an previously generated cluster? (Issue #27)

Hey,

Currently, there is only the argument --fixed_assignment <ASSIGNMENT FILE> implemented, which does not update cluster assignments, but that is not what you want, is it?

As I understand (I did not get your example fully), you want to have the assignment flexible/learned but the clusters fixed? You could do the same as for the assignment, init the clusters from a given file, and then just update the assignments and skip the rest of the update steps (https://github.com/cbg-ethz/BnpC/blob/b4dfefc1962b4802ab685604d321548035456e6e/libs/MCMC.py#LL321C27-L321C27).

Unfortunately, I don't have the time atm to implement it myself, but let me know if you get stuck somewhere.

Cheers

Reply to this email directly, view it on GitHubhttps://github.com/cbg-ethz/BnpC/issues/27#issuecomment-1556809504, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJLCGDO2BY5PAGLMPTEVBADXHMSILANCNFSM6AAAAAAYATPDKA. You are receiving this because you authored the thread.Message ID: @.@.>>

jeffchen2000 avatar May 23 '23 16:05 jeffchen2000