% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/clean_DIANN.R
\name{.cleanRawDIANN}
\alias{.cleanRawDIANN}
\title{Clean raw Diann files}
\usage{
.cleanRawDIANN(
  msstats_object,
  MBR = TRUE,
  quantificationColumn = "FragmentQuantCorrected",
  global_qvalue_cutoff = 0.01,
  qvalue_cutoff = 0.01,
  pg_qvalue_cutoff = 0.01,
  calculateAnomalyScores = FALSE,
  anomalyModelFeatures = c(),
  labeledAminoAcids = NULL
)
}
\arguments{
\item{msstats_object}{an object of class \code{MSstatsDIANNFiles}.}

\item{MBR}{True if analysis was done with match between runs}

\item{quantificationColumn}{Use 'FragmentQuantCorrected'(default) column for quantified intensities for DIANN 1.8.x.
Use 'FragmentQuantRaw' for quantified intensities for DIANN 1.9.x.
Use 'auto' for quantified intensities for DIANN 2.x where each fragment intensity is a separate column, e.g. Fr0Quantity.}

\item{global_qvalue_cutoff}{The qvalue cutoff for the Q.Value column, i.e.
the run-specific precursor q-value. Default is 0.01.}

\item{qvalue_cutoff}{If MBR is false, the qvalue cutoff for the Global.Q.Value
column, i.e. global precursor q-value.  If MBR is true, the qvalue cutoff for the
Lib.Q.Value column, i.e. the q-value for the library created after the first MBR pass.
Default is 0.01.}

\item{pg_qvalue_cutoff}{If MBR is false, the qvalue cutoff for the Global.PG.Q.Value
column, i.e. the global q-value for the protein group.  If MBR is true, the
qvalue cutoff for the Lib.PG.Q.Value column, i.e. the protein group q-value for
the library created after the first MBR pass. Default is 0.01.}

\item{calculateAnomalyScores}{Default is FALSE. If TRUE, will run anomaly detection model and calculate anomaly scores for each feature. Used downstream to weigh measurements in differential analysis.}

\item{anomalyModelFeatures}{character vector of quality metric column names to be used as features in the anomaly detection model. List must not be empty if calculateAnomalyScores=TRUE.}

\item{labeledAminoAcids}{Character vector of single-letter amino acid codes
that carry the SILAC label in protein turnover experiments, e.g.
\code{c("K")} or \code{c("K", "R")}.  Supplying this vector opts in to
protein-turnover mode; the exact amino acids determine behaviour only in the
\code{ModifiedSequence}-parsing path described below.

\strong{Channel-based path} (DIA-NN 2.x exports that include a
\code{Channel} column): when \code{labeledAminoAcids} is non-\code{NULL}
\emph{and} the input contains a \code{Channel} column, \code{Channel} values
are mapped directly to \code{IsotopeLabelType} (\code{"H"} → \code{"H"},
\code{"L"} → \code{"L"}, anything else → \code{NA}).  The amino acid codes
in \code{labeledAminoAcids} are \strong{not} used to validate or filter
\code{ModifiedSequence} in this path.

\strong{ModifiedSequence-parsing path} (DIA-NN 1.x exports without a
\code{Channel} column): when \code{labeledAminoAcids} is non-\code{NULL}
and no \code{Channel} column is present, each \code{ModifiedSequence} is
scanned for isotope-labeled amino acids, which appear in parentheses
immediately after the labeled residue,
in the form \code{(<label>-<aminoAcid>-H)} for
the heavy label or \code{(<label>-<aminoAcid>-L)} for the light label.
For example, \code{K(label-K-H)} marks a heavy-labeled lysine (\code{K}).
Here \code{<aminoAcid>} is one of the single-letter codes in
\code{labeledAminoAcids}, and \code{<label>} is the label name (e.g.
\code{SILAC} or \code{label}). Sequences with no such parenthetical
tags are assigned \code{IsotopeLabelType = NA}. Once classified, the
parenthetical annotation is stripped out of \code{PeptideSequence},
leaving the plain amino acid sequence.

When \code{NULL} (default), protein-turnover mode is disabled and all
peptides receive \code{IsotopeLabelType = "Light"}.}
}
\value{
data.table
}
\description{
Clean raw Diann files
}
\keyword{internal}
