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

Add UI for user to toggle median line, y: raw values/ log2 values #41

Merged
merged 5 commits into from
Jun 15, 2023

Conversation

Nguyen379
Copy link
Collaborator

Some added features so that users can better customize their graphs

Copy link
Contributor

@chrisamiller chrisamiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work overall - you've got a workable solution, just a few suggestions to perhaps clean up the code in the review here.

One more note - right now, I believe the "Show Median Line" box appears even on the Multiplot, which doesn't support showing a median line. Would be nice to have that only appear on plot types that support it.

server.R Outdated Show resolved Hide resolved
server.R Outdated Show resolved Hide resolved
server.R Outdated
# Render log2/raw graph based on user input
if (show.raw()){
g <- ggplot(clinical,aes(fill=Gene,
y=2^Expression,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make the code simpler to scale the values before the plotting code. So instead of two plotting chunks, you would do something like:

if(show.log2){
   clinical$Expression = log2(clinical$Expression)
} 

then just one complicated ggplot block below.
Is there a downside? (I think you're already keeping track of the state of the data with the show.raw/show.log2 param so you'll know when and which way to toggle, right?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line actually modifies the original data in the plot. St like this maybe better:
"""
if (show.log2) g <- ggplot(y=Expression)
else : g <- ggplot(y=2^expression)

g + big_data_stuff
"""

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure - that's eminently reasonable

@Nguyen379
Copy link
Collaborator Author

I just pushed my update, can you have a look at it? @chrisamiller

server.R Outdated
y_label <- "Log2 Expression"
} else {
y_aes <- aes(y = 2^Expression)
y_label <- "Raw Expression"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more minor change - instead of "Raw Expression", just use "Expression". (there are several steps before it gets to this plotting point that alter the values, normalize them, etc)

Copy link
Contributor

@chrisamiller chrisamiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one very minor change to the axis label. Otherwise, looks great!

Copy link
Contributor

@chrisamiller chrisamiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@chrisamiller chrisamiller merged commit d489f12 into leylabdotorg:main Jun 15, 2023
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

Successfully merging this pull request may close these issues.

2 participants