SCA-IRCM / SingleCellSignalR_v1

R package
26 stars 17 forks source link

visualize to plot just one cluster interactions with all others #9

Open djt011 opened 4 years ago

djt011 commented 4 years ago

Hi, thanks for the great data analysis tool! I'm wondering if there is a way to use "visualize" to plot just the interactions of one cluster with all of the other clusters (i.e. cluster 1 with clusters 2, 3 and 4), but not plot the interactions between the other clusters (2, 3 and 4)? Apologies if this is obvious. Thanks!

SCA-IRCM commented 4 years ago

Hi, You can create a sub list of the signal list (result of the cell_signaling function) that will include only the cluster of interest. Note that the elements of signal are named as follows "cluster X-cluster Y" for interactions from cluster X to cluster Y, so you can easily select the ones you want using grepl for example. (good <- grepl("^cluster X", names(signal)) for the interactions coming from cluster X) You can then feed the visualize function with the new sub list. Let me know if it doesn't work.

Thanks for using SingleCellSignalR!

SCA

moeedakbar commented 4 years ago

HI

I have a similar issue, if I want to plot one interaction I can use the the following visualize_interactions(signal = signal, show.in=c(1) ) but if i want to plot the first two interaction in signal I though I could do the below, but all it plots is the second interaction visualize_interactions(signal = signal, show.in=c(1,2) )

can you help please?

SCA-IRCM commented 4 years ago

Hi, You just need to go back on the plot panel of Rstudio.

SCA

djt011 commented 4 years ago

Hi,

Thanks for the info and thanks for the great package.

I tried to grepl cluster 1 as you suggest then use “show.in” with visualise

Like this:

good <- grepl("^cluster 1", names(signal)) good [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE [13] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [37] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [49] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [61] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [73] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [85] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [97] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [109] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE [121] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE [133] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE [145] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE [157] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE [169] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE [181] TRUE TRUE visualize(inter = signal, show.in=good) Error in inter[[n]] : attempt to select less than one element in integerOneIndex

There is one error, but it does output all of the circle interaction figures for cluster 1. Only problem is that are still all plotted separately (with one LR pair on each figure) instead of all together. Am I doing this correctly? What I’m trying to do is put all LR interactions for cluster 1 (with all of the other clusters) together on the same figure.

Best regards, Damon

From: SCA-IRCM notifications@github.com Reply to: SCA-IRCM/SingleCellSignalR_v1 reply@reply.github.com Date: Monday, 25 May 2020 at 5:33 pm To: SCA-IRCM/SingleCellSignalR_v1 SingleCellSignalR_v1@noreply.github.com Cc: Damon Tumes Damon.Tumes@unisa.edu.au, Author author@noreply.github.com Subject: Re: [SCA-IRCM/SingleCellSignalR_v1] visualize to plot just one cluster interactions with all others (#9)

Hi, You can create a sub list of the signal list (result of the cell_signaling function) that will include only the cluster of interest. Note that the elements of signal are named as follows "cluster X-cluster Y" for interactions from cluster X to cluster Y, so you can easily select the ones you want using grepl for example. (good <- grepl("^cluster X", names(signal)) for the interactions coming from cluster X) You can then feed the visualize function with the new sub list. Let me know if it doesn't work.

Thanks for using SingleCellSignalR!

SCA

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/SCA-IRCM/SingleCellSignalR_v1/issues/9#issuecomment-633438297, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APBISMRTIFT5GRVAWBCXIELRTIQ3XANCNFSM4NIZVKUQ.

SCA-IRCM commented 4 years ago

Hi, Actually show.in expects a vector of the indexes of signal to be shown, so you can do it this way: visualize(inter = signal, show.in=c(1:length(signal))[good]) or this one: visualize(inter = signal[good], show.in=c(1:sum(good))) I think it should work now.

Thanks for using SingleCellSignalR!

SCA