Skip to content

Commit

Permalink
fix: List-of-Metrics as Vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
cbielow committed Feb 7, 2018
1 parent 4aebdd4 commit 02ecb52
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 713 deletions.
584 changes: 0 additions & 584 deletions PTXQC_list-of-metrics.html

This file was deleted.

22 changes: 0 additions & 22 deletions R/fcn_misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -1206,28 +1206,6 @@ peakWidthOverTime = function(data, RT_bin_width = 2)
return(retLStats)
}

#'
#' Create Html file with list of QC metrics
#'
#' @param outdir Target dir where PTXQC_list-of-metrics_template.html is written
#' @param outname Filename (without directory)
#' @return Complete filename of written html file
#'
#' @importFrom rmarkdown render pandoc_available
#'
#' @export
#'
createListOfPTXQCMetrics = function(outdir = getwd(), outname = "PTXQC_list-of-metrics.html")
{
html_template = system.file("./reportTemplate/PTXQC_list-of-metrics_template.Rmd", package="PTXQC")
cat(paste0("HTML TEMPLATE: ", html_template, "\n"))
## Rmarkdown: convert to Markdown, and then to HTML (or PDF) ...
lst_qcMetrics_ord = getMetricsObjects()
filename = file.path(outdir, outname)
render(html_template, output_file = filename)
return (filename)
}

#' Get all currently available metrics
#'
#' @param DEBUG_PTXQC Use qc objects from the package (FALSE) or from environment (TRUE/DEBUG)
Expand Down
5 changes: 2 additions & 3 deletions R/qcMetric_EVD.R
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ qcMetric_EVD_Charge = setRefClass(
"Charge distribution per Raw file. For typtic digests, peptides of charge 2
(one N-terminal and one at tryptic C-terminal R or K residue) should be dominant.
Ionization issues (voltage?), in-source fragmentation, missed cleavages and buffer irregularities can
cause a shift (see [http://onlinelibrary.wiley.com/doi/10.1002/mas.21544/abstract](Bittremieux 2017, DOI: 10.1002/mas.21544) ).
cause a shift (see [Bittremieux 2017, DOI: 10.1002/mas.21544](http://onlinelibrary.wiley.com/doi/10.1002/mas.21544/abstract) ).
The charge distribution should be similar across Raw files.
Consistent charge distribution is paramount for comparable 3D-peak intensities across samples.
Expand Down Expand Up @@ -866,8 +866,7 @@ qcMetric_EVD_IDoverRT = setRefClass(
Ideally, the LC gradient is chosen such that the number of identifications (here, after FDR filtering) is
uniform over time, to ensure consistent instrument duty cycles. Sharp peaks and uneven distribution of
identifications over time indicate potential for LC gradient optimization.
See [http://www.ncbi.nlm.nih.gov/pubmed/24700534](Moruz et al., GradientOptimizer: An open-source graphical environment for calculating optimized gradients in reversed-phase
liquid chromatography, Proteomics, 06/2014; 14) for details.
See [Moruz 2014, DOI: 10.1002/pmic.201400036](http://www.ncbi.nlm.nih.gov/pubmed/24700534) for details.
Heatmap score [EVD: ID rate over RT]: Scored using 'Uniform' scoring function, i.e. constant receives good score, extreme shapes are bad.
",
Expand Down
3 changes: 1 addition & 2 deletions R/qcMetric_MSMSScans.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ qcMetric_MSMSScans_TopNoverRT = setRefClass(
helpTextTemplate =
"TopN over retention time. Similar to ID over RT, this metric reflects the complexity of the sample
at any point in time. Ideally complexity should be made roughly equal (constant) by choosing a proper (non-linear) LC gradient.
See [http://www.ncbi.nlm.nih.gov/pubmed/24700534](Moruz et al., GradientOptimizer: An open-source graphical environment for calculating optimized gradients in reversed-phase
liquid chromatography, Proteomics, 06/2014; 14) for details.
See [Moruz 2014, DOI: 10.1002/pmic.201400036](http://www.ncbi.nlm.nih.gov/pubmed/24700534) for details.
Heatmap score [MS<sup>2</sup> Scans: TopN over RT]: Rewards uniform (function Uniform) TopN events over time.
",
Expand Down
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PTXQC

### Latest changes / Change log

- v0.92.03 - Feb 2018: [List of Metrics][ListOfMetrics] added
- v0.92.03 - Feb 2018: Full List of Metrics added as vignette
- v0.92.02 - Jan 2018: plots and metrics of reporter intensity (iTRAQ, TMT, ...) for labeled MSn experiments
- v0.92.01 - Oct 2017: fix issue #41 (partial data error)
- v0.92.00 - Oct 2017: cleaner R interface; log file for drag'n'drop; fix boxPlots issue (usually for large experiments only);
Expand Down Expand Up @@ -47,18 +47,17 @@ you can browse the vignettes using either of these commands within R:
help(package="PTXQC")
browseVignettes(package = 'PTXQC')

If you do not want to wait that long, have a look at the ['vignettes' subfolder][3].
The top part contains a small table with technical gibberish, but the rest is identical to the
vignettes you would see in R.
If you do not want to wait that long, you can look at the
[latest online vignette at CRAN](https://cran.r-project.org/web/packages/PTXQC/vignettes/)

You will find documentation on
- Full List of Quality Metrics with help text
- Input and Output
- Report customization
- (for MaxQuant users) Usage of Drag'n'drop
- (for R users) code examples in R

For a comprehensive overview on the types of metrics available see [List of Metrics/Plots][ListOfMetrics],
which also contains a full description for each metric (as seen in the Help section of a Html report).
The 'List of Metrics' vignette contains a full description for each metric (as seen in the Help section of a Html report).

### Installation

Expand Down Expand Up @@ -141,10 +140,8 @@ The input data is available in the ['inst/examples' subfolder][2].

We recommend to use the most recent PTXQC for the best user experience.

[ListOfMetrics]: http://htmlpreview.github.io/?https://github.com/cbielow/PTXQC/blob/master/PTXQC_list-of-metrics.html
[1]: https://github.com/cbielow/PTXQC/tree/master/inst/dragNdrop
[2]: https://github.com/cbielow/PTXQC/tree/master/inst/examples
[3]: https://github.com/cbielow/PTXQC/tree/master/vignettes
[issuetracker]: https://github.com/cbielow/PTXQC/issues
[JPR_PTXQC]: https://github.com/cbielow/PTXQC/releases/tag/v0.69.3
[Ref_VignFAQ]: https://github.com/cbielow/PTXQC/blob/master/vignettes/PTXQC-FAQ.Rmd
Expand Down
63 changes: 0 additions & 63 deletions inst/reportTemplate/PTXQC_list-of-metrics_template.Rmd

This file was deleted.

11 changes: 0 additions & 11 deletions man/createListOfFunctions.Rd

This file was deleted.

20 changes: 0 additions & 20 deletions man/createListOfPTXQCMetrics.Rd

This file was deleted.

85 changes: 85 additions & 0 deletions vignettes/PTXQC-ListOfMetrics.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
title: "List of Metrics"
author: "Chris Bielow <chris.bielow@fu-berlin.de>"
date: '`r Sys.Date()`'
output:
html_document:
mathjax: null
number_sections: yes
toc: no
pdf_document:
toc: no
vignette: >
%\VignetteIndexEntry{List of Metrics}
%\VignetteEngine{knitr::rmarkdown}
\usepackage[utf8]{inputenc}
---


<!-- the TOC (table of content) would go here, but we create it manually to use this as a vignette
- - > use 'toc: no' above to disable the TOC
-->

<a id="TOP"/>

<style type="text/css">
p {
padding: 5px 0;
}

.helpText {
clear: left;
}

</style>

```{r setup, include=TRUE, echo=FALSE, results="asis"}
## global options
knitr::opts_chunk$set(echo=FALSE, warning=FALSE, error=FALSE, message=FALSE, fig.width=10)
lst_qcMetrics_ord = PTXQC:::getMetricsObjects()
txt_TOC = "# Table of Contents
- [Overview](#Overview)
- [Metrics](#Metrics)
"
txt_BODY = ""
for (qcm in lst_qcMetrics_ord)
{
newname = gsub("(.*)\\(.*" , "\\1", gsub("[\\*~%]" , " ", gsub("[\\^\">]" , "", qcm$qcName)))
## remove weird symbols (to serve as link)
newname_lnk = gsub("[^a-zA-Z0-9]", "", newname)
txt_TOC = paste0(txt_TOC, paste0(" - [", newname, "](#", newname_lnk, ")\n"))
txt_BODY = paste0(txt_BODY, '\n
## ', newname, ' <a name="', newname_lnk, '"/>
\n
<div class="helpText">', qcm$helpTextTemplate, '</div>
<p style="text-align: right"><a href="#TOP">-- back to top --</a></p>\n\n')
}
## print the TOC
cat(txt_TOC)
```

# Overview <a name="Overview"/>

The following metrics are implemented in PTXQC.<br>

Reasons why metrics might not appear in every report

* applicable only to certain types of data, e.g. SILAC or TMT
* metric was disabled manually using the YAML config file
* missing input data (incomplete tables), e.g. only evidence.txt is present


Some metrics are incompletely named here, since they might contain (hithero unknown) thresholds.

# Metrics <a name="Metrics"/>
```{r metrics, echo=FALSE, results="asis"}
cat(txt_BODY)
```

If the above list is empty, the vignette was not compiled (e.g. when viewing on GitHub).
Please see https://CRAN.R-project.org/package=PTXQC --> Vignettes for a compiled version.

0 comments on commit 02ecb52

Please sign in to comment.