Converts the protein-level output of MSstats::dataProcess() (label-free) or
MSstatsTMT::proteinSummarization() (TMT) into a DEprot object. Contrary to
import.external, which parses the reports written on disk by the search engines, this
function takes an R object that has already been summarized, normalized and log-transformed by
MSstats. The object is then built by load.counts2.
import.msstats(
object,
metadata = NULL,
type = "auto",
protein.id = "auto",
sample.id = "auto",
sample.sep = "_",
log.base = 2,
annotation.columns = "auto",
column.id = "column.id",
data.type = "auto",
clean.sample.names = TRUE,
subset.to.metadata = TRUE,
verbose = TRUE
)The list returned by dataProcess() / proteinSummarization(), the
ProteinLevelData (or legacy RunlevelData) data.frame alone, or the path to an
.rds file containing either of them.
A data.frame (or path to a table) containing at least the column indicated by
column.id. If NULL (default) the metadata are reconstructed from the annotation
columns carried by the MSstats object itself (conditions, replicates, mixtures, channels).
String indicating the flavour of the input: "auto" (default), "lfq"
(MSstats) or "tmt" (MSstatsTMT).
String indicating the column to use as protein identifier. Default "auto".
Character vector indicating the column(s) whose combination identifies a sample.
Default "auto" uses originalRUN for label-free data and Run + Channel
for TMT, which is the only combination guaranteed to be unique across mixtures and technical
replicates.
String used to paste multiple sample.id columns. Default "_".
Number indicating the base of the logarithm of the summarized abundances.
Default 2. Set it to 10 if dataProcess() was run with logTrans = 10.
Character vector of the columns to carry into the automatically
generated metadata. Default "auto" keeps the MSstats annotation columns that are constant
within each sample.
String indicating the metadata column matching the sample names.
Default "column.id".
String, one among "auto" (default), "raw", "normalized",
"randomized", "imputed". See 'Details' for how "auto" decides.
Logical, whether to strip paths and raw-file extensions from the run
names. Default TRUE.
Logical, whether to keep only the samples listed in the metadata.
Default TRUE.
Logical, whether to print progress messages. Default TRUE.
A DEprot object (S4 vector).
No package is required to read these objects: they are ordinary data.frames, so neither
MSstats nor MSstatsTMT needs to be installed for the import itself.
MSstats abundances are already log-transformed, therefore the zero-to-NA conversion applied
to linear intensities is skipped here: a summarized abundance of 0 is a legitimate value.
With data.type = "auto" the label-free data are loaded as "imputed" when the column
NumImputedFeature is present and contains non-zero values, since that column only appears
when dataProcess() was run with MBimpute = TRUE; otherwise they are loaded as
"normalized". TMT data are always loaded as "normalized", because
proteinSummarization() applies global_norm and reference_norm by default and
its protein-level table carries no indicator of the accelerated-failure-time imputation. Set
data.type = "imputed" explicitly if MBimpute = TRUE was used.
DEprot is designed for label-free quantitation. TMT data can be loaded and analysed, but
several assumptions of the package do not hold: the missingness is structured by mixture rather
than by sample, the fold changes are compressed by co-isolation, and the data have already been
normalized within and between plexes by MSstatsTMT. Re-normalizing with normalize.counts
or re-imputing with impute.counts is therefore discouraged. The mixture effect can instead
be handled with harmonize.batches, using the Mixture column of the generated metadata
as batch variable.
if (FALSE) { # \dontrun{
# label-free (MSstats)
summarized <- MSstats::dataProcess(raw)
dpo <- import.msstats(object = summarized)
# TMT (MSstatsTMT)
summarized.tmt <- MSstatsTMT::proteinSummarization(input.pd)
dpo <- import.msstats(object = summarized.tmt,
type = "tmt",
data.type = "imputed")
# correcting the mixture (plex) effect of a TMT experiment
dpo <- harmonize.batches(DEprot.object = dpo, batch.column = "Mixture")
} # }