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

Fix legends #111

Merged
merged 4 commits into from
Oct 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Versions uploaded to CRAN are marked with [CRAN].

[?] v1.00.12 -- develop
- [FIX] Documentation and cosmetic fixes (pr #109)

- [FIX/DOC] improved legends and better links in Html reports (pr #111)

[CRAN] v1.00.11 -- 2021/09/28
- [FEATURE] initial support for mzQC Quality Control output (pr #105)
Expand Down
3 changes: 2 additions & 1 deletion R/createReport.R
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ createReport = function(txt_folder = NULL, mztab_file = NULL, yaml_obj = list(),
}
cat(paste0("HTML TEMPLATE: ", html_template, "\n"))
out_dir = dirname(rprt_fns$report_file_HTML)
file.copy(html_template, out_dir, overwrite = TRUE)
file.copy(html_template, out_dir, overwrite = FALSE)
out_template = file.path(out_dir, basename(html_template))
## Rmarkdown: convert to Markdown, and then to HTML (or PDF) ...
## Intermediates_dir is required if inputdir!=outputdir, since Shiny server might not allow write-access to input file directory
Expand Down Expand Up @@ -721,6 +721,7 @@ createReport = function(txt_folder = NULL, mztab_file = NULL, yaml_obj = list(),
print(gg_obj)
}
}
cat("\nCreating PDF ...\n")
grDevices::pdf(report_file_PDF)
printWithPage(hm[["plot"]], "p. 1") # summary heatmap
printWithPage(pl_nameMapping$plots, "p. 2") # short file mapping
Expand Down
10 changes: 8 additions & 2 deletions R/fcn_plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -875,9 +875,12 @@ plot_UncalibratedMSErr = function(data, MQBug_raw_files, stats, y_lim, extra_lim
## use augmented name
data$fc.raw.file_ext = stats$fcr_new_lvl[ match(data$fc.raw.file, stats$fc.raw.file) ]

cols_sub = c("default"="black", "MQ bug"="red", "out-of-search-tol"="orange")
cols_sub = cols_sub[names(cols_sub) %in% data$col]

p = ggplot(data, col=data$col) +
geom_boxplot(aes_string(x = "fc.raw.file_ext", y = "uncalibrated.mass.error..ppm.", col="col"), varwidth = TRUE, outlier.shape = NA) +
scale_colour_manual("", values = c("default"="black", "MQ bug"="red", "out-of-search-tol"="orange"), guide = showColLegend) +
scale_colour_manual("", values = cols_sub, guide = showColLegend) +
ylab(expression(Delta~"mass [ppm]")) +
xlab("") +
ylim(y_lim) +
Expand Down Expand Up @@ -935,10 +938,13 @@ plot_CalibratedMSErr = function(data, MQBug_raw_files, stats, y_lim, extra_limit
## only show legend if special things happen
showColLegend = ifelse(length(setdiff(data$col, "default")) > 0, "legend", "none")

cols_sub = c("default"="black", "MQ bug"="red", "out-of-search-tol"="orange")
cols_sub = cols_sub[names(cols_sub) %in% data$col]

## plot
p = ggplot(data, col = data$col) +
geom_boxplot(aes_string(x = "fc.raw.file", y = "mass.error..ppm.", col="col"), varwidth = TRUE, outlier.shape = NA) +
scale_colour_manual("", values = c("default"="black", "MQ bug"="red", "out-of-search-tol"="orange"), guide = showColLegend) +
scale_colour_manual("", values = cols_sub, guide = showColLegend) +
ylab(expression(Delta~"mass [ppm]")) +
xlab("") +
ylim(y_lim) +
Expand Down
4 changes: 3 additions & 1 deletion R/qcMetric_EVD.R
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,13 @@ during MaxQuant configuration.
The resulting residual RT delta after RT alignment (compared to a reference Raw file), is shown as green/red dots. One dot represents
one peptide (incl. charge). Every dot (peptide) outside an allowed residual delta RT (1min by default) is colored red.
All others are green.
The ratio of 'green' vs. 'green+red' peptides is annotated using 'sc: ' (for 'score') in the plot subtitles. High values are better (green peptides dominate).

If moving 'red' dots to the horizontal zero-line (to make them green) requires large RT shifts, then increasing the alignment
search window might help MaxQuant to find a better alignment.

Heatmap score [EVD: MBR Align]: fraction of 'green' vs. 'green+red' peptides.

Heatmap score [EVD: MBR Align]: ratio of 'green' vs. 'green+red' peptides
",
workerFcn = function(.self, df_evd, tolerance_matching, raw_file_mapping)
{
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ PTXQC

### Latest changes / ChangeLog

- v??? - Nov 2021: Documentation and cosmetic fixes (https://github.com/cbielow/PTXQC/pull/109); improved legends, better links in Html reports (https://github.com/cbielow/PTXQC/pull/111)
- v1.00.11 - Sep 2021: initial support for mzQC Quality Control output (https://github.com/cbielow/PTXQC/pull/105); Missed cleavages can be computed from evidence.txt (https://github.com/cbielow/PTXQC/pull/104); minor fixes
- v1.00.10 - May 2021: detect non UK/US locale (https://github.com/cbielow/PTXQC/pull/99); Revive missing MBR metrics (https://github.com/cbielow/PTXQC/issues/97); restore full Parameter list (showing MaxQuant parameters (https://github.com/cbielow/PTXQC/issues/101); decoy distribution in MS/MS mass error plot restored (https://github.com/cbielow/PTXQC/issues/102)
- v1.00.09 - Jan 2021: output logging to external file (https://github.com/cbielow/PTXQC/issues/94); mzQC support (partial); less warnings;
Expand Down
7 changes: 4 additions & 3 deletions inst/reportTemplate/PTXQC_report_template.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,20 @@ document.getElementById("locale_shorttext").innerHTML = shorttext;
- navigate using the 'Table of Content' above or just scroll down
- collapse sections by just clicking their name
- click on the "↓ Show Help" symbol to see a description for each metric and its scoring
- edit the config `r paste0("file:///", gsub("\\\\", "/", rprt_fns$yaml_file))` to
- edit the YAML config <a href="`r paste0("file:./", basename(rprt_fns$yaml_file))`">`r paste0("file:./", basename(rprt_fns$yaml_file))`</a> to
- set the report format (HTML, plainPDF, or both)
- disable metrics
- customize the order of metrics
- set individual target thresholds
- edit `r paste0("file:///", gsub("\\\\", "/", rprt_fns$filename_sorting))` to customize
- edit `r paste0("file:./", basename(rprt_fns$filename_sorting))` to customize
- the order of Raw files in plots and heatmap
- abbreviations of Raw file names
- edit the Html template `r paste0("file:///", gsub("\\\\", "/", html_template))` to
- edit the Html template `r paste0("file:./", basename(html_template))` to
- alter the look and feel of this report (e.g. colors, font and image sizes, help texts, etc.)
- report bugs and file requests via the [GitHub issue tracker](https://github.com/cbielow/PTXQC/issues)
- full PTXQC manual available [here](https://github.com/cbielow/PTXQC)


## HeatMap
```{r MQparams, echo=FALSE, results="asis"}
hm[["plot"]]
Expand Down