MSnSet2protdata: MSnSet to protein data

View source: R/MSnSet2protdata.R

MSnSet2protdataR Documentation

MSnSet to protein data

Description

Converts an MSnSet object to a a protdata object, which can be used for further analysis.

Usage

MSnSet2protdata(MSnSet, accession = NULL, annotations = NULL,
  quant_name = "quant_value", printProgress = FALSE, shiny = FALSE,
  message = NULL)

Arguments

MSnSet

An MSnSet object that needs to be converted to a protdata object.

accession

A character string or numeric index indicating the column in the fData slot of object MSnSet that contains the identifiers by which the data should be grouped in the resulting protdata object (typically the protein identifier).

annotations

A vector of character strings or numeric indices indicating the columns in the fData slot of object MSnSet that contain additional information on the accessions (typically protein names, gene names, gene ontologies,...) that should be retained. In case multiple values of the same annotation column would exist for a unique accession, these values are pasted together. Defaults to NULL, in which case no annotations will be added.

quant_name

A character string indicating the name to be given to the column that will contain the quantitative values of interest (mostly peptide intensities or peptide areas under the curve). Defaults to "quant_value".

printProgress

A logical indicating whether the R should print a message before converting each accession. Defaults to FALSE.

shiny

A logical indicating whether this function is being used by a Shiny app. Setting this to TRUE only works when using this function in a Shiny app and allows for dynamic progress bars. Defaults to FALSE.

message

Only used when printProgress=TRUE and shiny=TRUE. A single-element character vector: the message to be displayed to the user, or NULL to hide the current message (if any).

Value

A protdata object.

Examples

#This example will convert MSnSet object peptides into a protdata object proteins.
library(MSnbase)
colInt <- grepEcols(system.file("extdata/CPTAC", "peptides.txt", package = "MSqRob"), pattern="Intensity.", split = "\t")
#Import the data as an MSnSet object
peptides <- readMSnSet2(system.file("extdata/CPTAC", "peptides.txt", package = "MSqRob"), ecol = colInt, sep = "\t")
fData(peptides) <- fData(peptides)[,c("Proteins","Sequence","PEP")]
#Do this only for the first 50 peptide to save execution time
proteins <- MSnSet2protdata(peptides[1:50], "Proteins")

statOmics/MSqRob documentation built on Dec. 8, 2022, 6 a.m.