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

adjustment not applied when metadata used as var in dittoSeq and friends #156

Open
j-andrews7 opened this issue Sep 23, 2024 · 3 comments
Open

Comments

@j-andrews7
Copy link
Collaborator

This is in the dev version, so Bioc 3.20:

example(importDittoBulk, echo = FALSE)
myRNA

# Basic dittoplot, with jitter behind a vlnplot (looks better with more cells)
dittoPlot(object = myRNA, var = "score2", group.by = "timepoint", adjustment = NULL)

image

Looks identical with z-score adjustment (or relative.to.max).

dittoPlot(object = myRNA, var = "score2", group.by = "timepoint", adjustment = "z-score")

image

Works fine for genes though:

dittoPlot(object = myRNA, var = "gene1", group.by = "timepoint", adjustment = NULL)

image

dittoPlot(object = myRNA, var = "gene1", group.by = "timepoint", adjustment = "z-score")

image

Note that it is still applied to genes when both metadata variable and genes are provided, e.g.:

multi_dittoPlot(myRNA,
                vars = c("score1", "score2", "gene3", "gene4"),
                group.by = "clustering", adjustment = "z-score")

image

Probably won't have any time to chase this one myself for at least a few weeks.

@dtm2451
Copy link
Owner

dtm2451 commented Sep 24, 2024

Not a deep one... it's just how it has always been. The docs for adjustment in ?dittoPlot:

When plotting gene expression / feature counts, should that data be used directly (default) or should it be adjusted to be
  - "z-score": scaled with the scale() function to produce a relative-to-mean z-score representation
  - "relative.to.max": divided by the maximum expression value to give percent of max values between [0,1]

@j-andrews7
Copy link
Collaborator Author

j-andrews7 commented Sep 24, 2024 via email

@dtm2451
Copy link
Owner

dtm2451 commented Sep 24, 2024

Easy enough to update.

Most of the machinery was put in place a while ago, but I stopped short of the final connection from an uncertainty of whether to make the change + my tendency to not change default behaviors without adding a level of control to recreate old behavior.

Just gotta think a bit on if an extra control should be added and if that control should default to 'on' or 'off'.

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