% 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
inspected for SILAC suffixes of the form \code{(SILAC-<AA>-H)} or
\code{(SILAC-<AA>-L)}, where \code{<AA>} is one of the supplied amino acid
codes.  Matching sequences are classified as \code{"H"} or \code{"L"};
sequences carrying neither suffix receive \code{IsotopeLabelType = NA}.
The SILAC suffix is then stripped from \code{PeptideSequence}.

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}
