HectorRDB / condiments

Trajectory inference across multiple conditions with condiments: differential topology, progression, differentiation, and expression
https://hectorrdb.github.io/condiments/
Other
16 stars 1 forks source link

Questions about the lineage curves: colors & extracting #15

Closed SimoniMD closed 1 year ago

SimoniMD commented 2 years ago

Hi! thanks for the package. i got my lineage curves to work, but they are kinda hard to see due to the colors:

for (condition in c("IFN", "Control")) {
  sds2_cond <- sdss2[[condition]]
  for (i in 1:2) {
    p4 <- p4 + 
      geom_path(data = slingCurves(sds2_cond)[[i]]$s[slingCurves(sds2_cond)[[i]]$ord, ] %>%
                  as.data.frame() %>%
                  mutate(condition = condition),
                size = 1.5)
  }
}

image

image

If i change the colors in the geom_path, it creates the same color for the same lineage, instead of the same condition:

  sds2_cond <- sdss2[[condition]]
  for (i in 1:2) {
    p4 <- p4 + 
      geom_path(data = slingCurves(sds2_cond)[[i]]$s[slingCurves(sds2_cond)[[i]]$ord, ] %>%
                  as.data.frame() %>%
                  mutate(condition = condition),
                size = 1.5,
                colour = colorsequence2[i])
  }
}

image

I'm trying to get the condition to be the same color, not the lineage. Would also like them to be a different color than the points. Thoughts?

On a related, but similar note...i tried to work around by extracting the curve to put it onto another UMAP, but I couldn't figure this out. Any way you can think of to do that?

HectorRDB commented 2 years ago

Hi @SimoniMD Thanks for using condiments. If you want to change the colors, you should add

scale_color_manual(values = c("Control" = color1, "IFN" = color2))

As for the other question, I don't think I understand. Trajectory inference is dependent on a specific dimensionality reduction, the curves only exist in that space.

SimoniMD commented 2 years ago

Thank you for the help! i meant literally taking off the layer and putting it over something not as colorful. i actually was able to do it with ggedit and the color help you provided: testPicture1

HectorRDB commented 2 years ago

Thanks @SimoniMD . Do you mind sharing that code below so that others can benefit?

HectorRDB commented 1 year ago

Closed due to inactivity.