YMa-lab / CARD

GNU General Public License v3.0
80 stars 20 forks source link

CARD.visualize.prop gives spots that are too large - cannot make smaller? #46

Closed corecontingency closed 11 months ago

corecontingency commented 1 year ago

For our dataset, graphing the results of (the below commands were pulled from the tutorial):

ct.visualize = c("Tumor cells","Immune cells","Mesenchymal cells","Endothelial cells","Schwann cells","Liver cells")
p2 <- CARD.visualize.prop(
  proportion = CARD_obj@Proportion_CARD,
  spatial_location = CARD_obj@spatial_location,
  ct.visualize = ct.visualize,
  NumCols = 4)

using this command:

png("CARD_proportion.png", width=9, height=9, units="in", res=300)
print(p2)
dev.off()

has the following output image:

CARD_proportion

As you can see, all the spots are overlapping. It is unclear how to reduce the size of the generated spots. Checking the man page of the function (with ?CARD.visualize.prop) shows no command to change the size of spots.

I also tried the below command:

png("CARD_proportion.png", width=9, height=9, units="in", res=300)
print(p2) + geom_point(size=0.10)
dev.off()

However, this just produces a new set of black spots (that do respect the geom_point setting) on top of the old data, without altering the size of the spots I actually want to change! See below:

CARD_proportion_geom_point_alteration

How do I change the size of the spots?

YingMa0107 commented 1 year ago

Hi @corecontingency,

Thank you for your interest in our package and for posting this issue.

I just updated the function CARD.visualize.prop() with an option to provide the user to change the point size. You can either directly source the ./R/visualization.R code, or re-install CARD package. Then you can add one argument pointSize in the CARD.visualize.prop() function to change the point size. For example,

p2 <- CARD.visualize.prop(
  proportion = CARD_obj@Proportion_CARD,
  spatial_location = CARD_obj@spatial_location,
  ct.visualize = ct.visualize,
  NumCols = 4,
  pointSize = 2)

Let me know if it does not work. Thank you!

Best, Ying