# Quality Report Generation for MaxQuant and mzTab Results

## Documentation for package ‘PTXQC’ version 1.1.6

- DESCRIPTION file
- User guides, package vignettes and other documentation
- Package NEWS
- Package README

## Help Pages

A B C D F G I L M P Q R S T W Y misc

PTXQC-package | PTXQC: A package for computing Quality Control (QC) metrics for Proteomics (PTX)

## -- A --

alignmentCheck | Verify an alignment by checking the retention time differences of identical peptides across Raw files
appendEnv | Add the value of a variable to an environment (fast append)
assembleMZQC | Collects all 'mzQC' members from each entry in lst_qcMetrics and stores them in an overall mzQC object, which can be written to disk (see writeMZQC()) or augmented otherwise
assignBlocks | Assign set numbers to a vector of values.

## -- B --

boxplotCompare | Boxplots - one for each condition (=column) in a data frame.
brewer.pal.Safe | Return color brew palettes, but fail hard if number of requested colors is larger than the palette is holding.
byX | Calls FUN on a subset of data in blocks of size 'subset_size' of unique indices.
byXflex | Same as 'byX', but with more flexible group size, to avoid that the last group has only a few entries (<50% of desired size).

## -- C --

checkEnglishLocale | When MaxQuant is run with a wrong locale (i.e. the decimal separator is not a '.', but a ','), then MaxQuant results are plainly wrong and broken. The can be detected by, e.g. checking for negative charge annotation
computeMatchRTFractions | Combine several data structs into a final picture for segmentation incurred by 'Match-between-runs'.
correctSetSize | Re-estimate a new set size to split a number of items into equally sized sets.
createReport | Create a quality control report (in PDF format).
createYaml | Creates a yaml file storing the parameters that are used for creating the PTXQC report and returns these parameters as well as a list of available qc-Metrics objects.
CV | Coefficient of variation (CV)

## -- D --

darken | Make a color (given as name or in RGB) darker by factor x = [0 = black, 1=unchanged]
del0 | Replace 0 with NA in a vector
delLCP | Removes the longest common prefix (LCP) from a vector of strings.
delLCS | Removes the longest common suffix (LCS) from a vector of strings.

## -- F --

FilenameMapper | Make sure to call $readMappingFile(some_file) if you want to support a user-defined file mapping. Otherwise, calls to $getShortNames() will create/augment the mapping for filenames.
FilenameMapper-class | Make sure to call $readMappingFile(some_file) if you want to support a user-defined file mapping. Otherwise, calls to $getShortNames() will create/augment the mapping for filenames.
findAlignReference | Return list of raw file names which were reported by MaxQuant as reference point for alignment.
fixCalibration | Detect (and fix) MaxQuant mass recalibration columns, since they sometimes report wrong values.
flattenList | Flatten lists of lists with irregular depths to just a list of items, i.e. a list of the leaves (if you consider the input as a tree).

## -- G --

getAbundanceClass | Assign a relative abundance class to a set of (log10) abundance values
getECDF | Estimate the empirical density and return it
getFileEncoding | Determine if a file is 'UTF-8' or 'UTF-8-BOM' (as of MQ2.4) or 'UTF-16BE' or 'UTF-16LE'
getFragmentErrors | Extract fragment mass deviation errors from a data.frame from msms.txt
getHTMLTable | Create an HTML table with an extra header row
getMaxima | Find the local maxima in a vector of numbers.
getMetaData | Extract meta information (orderNr, metric name, category) from a list of Qc metric objects
getMetaFilenames | Parses the given mqpar.xml file (or, if not found, tries the 'txt_folder' + '/../../' folder (i.e. where the raw data should be)) to extract the full filepaths for all Raw files
getMetricsObjects | Get all currently available metrics
getMQPARValue | Retrieve a parameter value from a mqpar.xml file
getPCA | Create a principal component analysis (PCA) plot for the first two dimensions.
getPeptideCounts | Extract the number of peptides observed per Raw file from an evidence table.
getProteinCounts | Extract the number of protein groups observed per Raw file from an evidence table.
getQCHeatMap | Generate a Heatmap from a list of QC measurements.
getReportFilenames | Assembles a list of output file names, which will be created during reporting.
getRunQualityTemplate | Get an mzQC runQuality without actual metrics, but with full metadata
ggAxisLabels | Function to thin out the number of labels shown on an axis in GGplot
ggText | Plot a text as graphic using ggplot2.
grepv | Grep with values returned instead of indices.

## -- I --

idTransferCheck | Check how close transferred ID's after alignment are to their genuine IDs within one Raw file.
inMatchWindow | For grouped peaks: separate them into in-width vs. out-width class.

## -- L --

lcpCount | Count the number of chars of the longest common prefix
LCS | Compute longest common substring of two strings.
lcsCount | Count the number of chars of the longest common suffix
LCSn | Find longest common substring from 'n' strings.
longestCommonPrefix | Get the longest common prefix from a set of strings.
longestCommonSuffix | Like longestCommonPrefix(), but on the suffix.

## -- M --

modsToTable | Convert list of (mixed)modifications to a frequency table
modsToTableByRaw | Convert list of (mixed)modifications to a frequency table
mosaicize | Prepare a Mosaic plot of two columns in long format.
MQDataReader | S5-RefClass to read MaxQuant .txt files
MQDataReader-class | S5-RefClass to read MaxQuant .txt files
MzTabReader | Class to read an mzTab file and store the tables internally.
MzTabReader-class | Class to read an mzTab file and store the tables internally.

## -- P --

pasten | paste with newline as separator
pastet | paste with tab as separator
peakSegmentation | Determine fraction of evidence which causes segmentation, i.e. sibling peaks at different RTs confirmed either by genuine or transferred MS/MS.
peakWidthOverTime | Discretize RT peak widths by averaging values per time bin.
plotTable | Plot a table with row names and title
plotTableRaw | Colored table plot.
plot_CalibratedMSErr | Plot bargraph of uncalibrated mass errors for each Raw file.
plot_Charge | The plots shows the charge distribution per Raw file. The output of 'mosaicize()' can be used directly.
plot_ContEVD | Plot contaminants from evidence.txt, broken down into top5-proteins.
plot_ContsPG | Plot contaminants from proteinGroups.txt
plot_ContUser | Plot user-defined contaminants from evidence.txt
plot_ContUserScore | Plot Andromeda score distribution of contaminant peptide vs. matrix peptides.
plot_CountData | Plot Protein groups per Raw file
plot_DataOverRT | Plot some count data over time for each Raw file.
plot_IDRate | Plot percent of identified MS/MS for each Raw file.
plot_IDsOverRT | Plot IDs over time for each Raw file.
plot_IonInjectionTimeOverRT | Plot line graph of TopN over Retention time.
plot_MBRAlign | Plot MaxQuant Match-between-runs alignment performance.
plot_MBRgain | Plot MaxQuant Match-between-runs id transfer performance as a scatterplot.
plot_MBRIDtransfer | Plot MaxQuant Match-between-runs id transfer performance.
plot_MissedCleavages | Plot bargraph of missed cleavages.
plot_MS2Decal | Plot bargraph of oversampled 3D-peaks.
plot_MS2Oversampling | Plot bargraph of oversampled 3D-peaks.
plot_peptideMods | Plot peptide modification frequencies
plot_RatiosPG | Plot ratios of labeled data (e.g. SILAC) from proteinGroups.txt
plot_RTPeakWidth | Plot RT peak width over time
plot_ScanIDRate | Plot line graph of TopN over Retention time.
plot_TIC | Plot Total Ion Count over time
plot_TopN | Plot line graph of TopN over Retention time.
plot_TopNoverRT | Plot line graph of TopN over Retention time.
plot_UncalibratedMSErr | A boxplot of uncalibrated mass errors for each Raw file.
pointsPutX | Distribute a set of points with fixed y-values on a stretch of the x-axis.
print.PTXQC_table | helper S3 class, enabling print(some-plot_Table-object)
printWithFooter | Augment a ggplot with footer text
PTXQC | Quality control for proteomics data

## -- Q --

QCMetaFilenames | Define a Singleton class which holds the full raw filenames (+path) and their PSI-MS CV terms for usage in the mzQC metadata
qcMetric | Class which can compute plots and generate mzQC output (usually for a single metric).
qcMetric-class | Class which can compute plots and generate mzQC output (usually for a single metric).
qcMetric_MSMSScans_TopNoverRT | Metric for msmsscans.txt, showing TopN over RT.
qcMetric_MSMSScans_TopNoverRT-class | Metric for msmsscans.txt, showing TopN over RT.
qualBestKS | From a list of vectors, compute all vs. all Kolmogorov-Smirnoff distance statistics (D)
qualCentered | Quality metric for 'centeredness' of a distribution around zero.
qualCenteredRef | Quality metric for 'centeredness' of a distribution around zero with a user-supplied range threshold.
qualGaussDev | Compute probability of Gaussian (mu=m, sd=s) at a position 0, with reference to the max obtainable probability of that Gaussian at its center.
qualHighest | Score an empirical density distribution of values, where the best possible distribution is right-skewed.
qualLinThresh | Quality metric with linear response to input, reaching the maximum score at the given threshold.
qualMedianDist | Quality metric which measures the absolute distance from median.
qualUniform | Compute deviation from uniform distribution

## -- R --

read.MQ | Convenience wrapper for MQDataReader when only a single MQ file should be read and file mapping need not be stored.
renameFile | Given a vector of (short/long) filenames, translate to the (long/short) version
repEach | Repeat each element x_i in X, n_i times.
RSD | Relative standard deviation (RSD)
RTalignmentTree | Return a tree plot with a possible alignment tree.

## -- S --

scale01linear | Scales a vector of values linearly to [0, 1] If all input values are equal, returned values are all 0
scale_x_discrete_reverse | Inverse the order of items on the x-axis (for discrete scales)
scale_y_discrete_reverse | Inverse the order of items on the y-axis (for discrete scales)
ScoreInAlignWindow | Compute the fraction of features per Raw file which have an acceptable RT difference after alignment
shortenStrings | Shorten a string to a maximum length and indicate shorting by appending '..'
simplifyNames | Removes common substrings (infixes) in a set of strings.
supCount | Compute shortest prefix length which makes all strings in a vector uniquely identifyable.

## -- T --

theme_blank | A blank theme (similar to the deprecated theme_blank())
thinOut | Thin out a data.frame by removing rows with similar numerical values in a certain column.
thinOutBatch | Apply 'thinOut' on all subsets of a data.frame, split by a batch column

## -- W --

wait_for_writable | Check if a file is writable and blocks an interactive session, waiting for user input.

## -- Y --

YAMLClass | Query a YAML object for a certain parameter.
YAMLClass-class | Query a YAML object for a certain parameter.

## -- misc --

%+% | A string concatenation function, more readable than 'paste()'.