-
Notifications
You must be signed in to change notification settings - Fork 50
fix(dataProcessPlots, groupComparisonPlots): Migrate away from deprecated functions for ggplot #175
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a9aa89f
fix data process plots ggplot
tonywu1999 40caa18
fix aes for group comparison plots
tonywu1999 d6b1c3f
migrate aes string to aes
tonywu1999 97e7e18
fix size to linewidth for geom_line
tonywu1999 3bf94cc
address comments from chatbot
tonywu1999 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,14 +56,14 @@ | |
| type_color = "PEPTIDE" | ||
| } | ||
|
|
||
| profile_plot = ggplot(input, aes_string(x = "RUN", y = "newABUNDANCE", | ||
| color = type_color, linetype = "FEATURE")) + | ||
| profile_plot = ggplot(data = input, aes(x = .data$RUN, y = .data$newABUNDANCE, | ||
| color = .data[[type_color]], linetype = .data$FEATURE)) + | ||
| facet_grid(~LABEL) + | ||
| geom_line(size = 0.5) | ||
| geom_line(linewidth = 0.5) | ||
|
|
||
| if (is_censored) { | ||
| profile_plot = profile_plot + | ||
| geom_point(aes_string(x = "RUN", y = "newABUNDANCE", color = type_color, shape = "censored"), | ||
| geom_point(aes(x = .data$RUN, y = .data$newABUNDANCE, color = .data[[type_color]], shape = .data$censored), | ||
| data = input, | ||
| size = dot.size.profile) + | ||
| scale_shape_manual(values = c(16, 1), | ||
|
|
@@ -97,7 +97,7 @@ | |
| scale_y_continuous(yaxis.name, limits = c(y.limdown, y.limup)) + | ||
| geom_vline(xintercept = lineNameAxis + 0.5, colour = "grey", linetype = "longdash") + | ||
| labs(title = unique(input$PROTEIN)) + | ||
| geom_text(data = groupNametemp, aes(x = RUN, y = ABUNDANCE, label = Name), | ||
| geom_text(data = groupNametemp, aes(x = .data$RUN, y = .data$ABUNDANCE, label = .data$Name), | ||
| size = text.size, | ||
| angle = text.angle, | ||
| color = "black") + | ||
|
|
@@ -156,22 +156,22 @@ | |
|
|
||
| num_features = data.table::uniqueN(input$FEATURE) | ||
| profile_plot = ggplot(data = input, | ||
| aes_string(x = "RUN", y = "newABUNDANCE", | ||
| color = "analysis", linetype = "FEATURE", | ||
| size = "analysis")) + | ||
| aes(x = .data$RUN, y = .data$newABUNDANCE, | ||
| color = .data$analysis, linetype = .data$FEATURE, | ||
| size = .data$analysis)) + | ||
| facet_grid(~LABEL) + | ||
| geom_line(size = 0.5) | ||
| geom_line(linewidth = 0.5) | ||
|
|
||
| if (is_censored) { # splitting into two layers to keep red above grey | ||
| profile_plot = profile_plot + | ||
| geom_point(data = input[input$PEPTIDE != "Run summary"], | ||
| aes_string(x = "RUN", y = "newABUNDANCE", | ||
| color = "analysis", size = "analysis", | ||
| shape = "censored")) + | ||
| aes(x = .data$RUN, y = .data$newABUNDANCE, | ||
| color = .data$analysis, size = .data$analysis, | ||
| shape = .data$censored)) + | ||
| geom_point(data = input[input$PEPTIDE == "Run summary"], | ||
| aes_string(x = "RUN", y = "newABUNDANCE", | ||
| color = "analysis", size = "analysis", | ||
| shape = "censored")) + | ||
| aes(x = .data$RUN, y = .data$newABUNDANCE, | ||
| color = .data$analysis, size = .data$analysis, | ||
| shape = .data$censored)) + | ||
| scale_shape_manual(values = c(16, 1), | ||
|
Comment on lines
+168
to
175
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same shape/aesthetic mismatch here. Map to Apply: - geom_point(data = input[input$PEPTIDE != "Run summary"],
- aes(x = .data$RUN, y = .data$newABUNDANCE,
- color = .data$analysis, size = .data$analysis,
- shape = .data$censored)) +
+ geom_point(data = input[input$PEPTIDE != "Run summary"],
+ aes(x = .data$RUN, y = .data$newABUNDANCE,
+ color = .data$analysis, size = .data$analysis,
+ shape = .data$is_censored)) +
geom_point(data = input[input$PEPTIDE == "Run summary"],
- aes(x = .data$RUN, y = .data$newABUNDANCE,
- color = .data$analysis, size = .data$analysis,
- shape = .data$censored)) +
+ aes(x = .data$RUN, y = .data$newABUNDANCE,
+ color = .data$analysis, size = .data$analysis,
+ shape = .data$is_censored)) +🤖 Prompt for AI Agents |
||
| labels = c("Detected data", | ||
| "Censored missing data")) | ||
|
|
@@ -191,7 +191,7 @@ | |
| geom_vline(xintercept = lineNameAxis + 0.5, | ||
| colour = "grey", linetype = "longdash") + | ||
| labs(title = unique(input$PROTEIN)) + | ||
| geom_text(data = groupNametemp, aes(x = RUN, y = ABUNDANCE, label = Name), | ||
| geom_text(data = groupNametemp, aes(x = .data$RUN, y = .data$ABUNDANCE, label = .data$Name), | ||
| size = text.size, | ||
| angle = text.angle, | ||
| color = "black") + | ||
|
|
@@ -209,8 +209,8 @@ | |
| } else { | ||
| profile_plot = profile_plot + | ||
| guides(color = color_guide) + | ||
| geom_point(aes_string(x = "RUN", y = "newABUNDANCE", size = "analysis", | ||
| color = "analysis"), data = input) | ||
| geom_point(aes(x = .data$RUN, y = .data$newABUNDANCE, size = .data$analysis, | ||
| color = .data$analysis), data = input) | ||
| } | ||
| profile_plot | ||
| } | ||
|
|
@@ -234,17 +234,17 @@ | |
| plot_title = unique(input$PROTEIN) | ||
| } | ||
|
|
||
| ggplot(input, aes_string(x = "RUN", y = "ABUNDANCE")) + | ||
| ggplot(input, aes(x = .data$RUN, y = .data$ABUNDANCE)) + | ||
| facet_grid(~LABEL) + | ||
| geom_boxplot(aes_string(fill = "LABEL"), outlier.shape = 1, | ||
| geom_boxplot(aes(fill = .data$LABEL), outlier.shape = 1, | ||
| outlier.size = 1.5) + | ||
| scale_fill_manual(values = label.color, guide = "none") + | ||
| scale_x_discrete("MS runs", breaks = cumGroupAxis) + | ||
| scale_y_continuous(yaxis.name, limits = c(y.limdown, y.limup)) + | ||
| geom_vline(xintercept = lineNameAxis + 0.5, colour = "grey", | ||
| linetype = "longdash") + | ||
| labs(title = plot_title) + | ||
| geom_text(data = groupName, aes(x = RUN, y = ABUNDANCE, label = Name), | ||
| geom_text(data = groupName, aes(x = .data$RUN, y = .data$ABUNDANCE, label = .data$Name), | ||
| size = text.size, angle = text.angle, color = "black") + | ||
| theme_msstats("QCPLOT", x.axis.size, y.axis.size, | ||
| legend_size = NULL) | ||
|
|
@@ -268,8 +268,8 @@ | |
| input$Label = as.numeric(gsub("\\D", "", unique(input$Label))) | ||
| } | ||
|
|
||
| plot = ggplot(aes_string(x = "Label", y = "Mean"), data = input) + | ||
| geom_errorbar(aes(ymax = Mean + ciw, ymin = Mean - ciw), | ||
| plot = ggplot(aes(x = .data$Label, y = .data$Mean), data = input) + | ||
| geom_errorbar(aes(ymax = .data$Mean + .data$ciw, ymin = .data$Mean - .data$ciw), | ||
| data = input, width = 0.1, colour = "red") + | ||
| geom_point(size = dot.size.condition, colour = "darkred") | ||
|
|
||
|
|
@@ -283,9 +283,9 @@ | |
| plot = plot + | ||
| scale_y_continuous(yaxis.name, limits = c(y.limdown, y.limup)) + | ||
| geom_hline(yintercept = 0, linetype = "twodash", | ||
| colour = "darkgrey", size = 0.6) + | ||
| colour = "darkgrey", linewidth = 0.6) + | ||
| labs(title = unique(single_protein$PROTEIN)) + | ||
| theme_msstats("CONDITIONPLOT", x.axis.size, y.axis.size, | ||
| text_angle = text.angle) | ||
| plot | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: shape mapped to nonexistent column (
censored) — useis_censoredto match data prep.You factorize
input$is_censoredabove but mapshape = .data$censored. Align the aesthetic to avoid empty shapes.Apply:
📝 Committable suggestion
🤖 Prompt for AI Agents