Learn R Programming

msarc (version 1.2.0)

msarc.loadMS: Create msarc Object From Mass Spec Data

Description

Create an msarc object from a mass spectrometry experiment spreadsheet. The spreadsheet must be saved in tab-separated text format.

Usage

msarc.loadMS(file, onlyDiff = T, config=list())

Arguments

file
the name of the file to load.
onlyDiff
If the experiment is a SILAC experiment, and onlyDiff is true, only proteins for which both a heavy and a light version was seen will be loaded. If false, all proteins will be included.
config
If the user needs to override column headings in the input file, a named list may be used to specify the column headings. See below for details.

Value

  • an msarc object corresponding to the file.

Details

The input file will be parsed according to the following rules:
  1. The first line is taken to be column headers.
  2. Lines beginning with white space are skipped. (In the output of the mass spec software this is based on, these lines are the descriptions of the individual peptides identified; we only keep the lines describing the whole proteins.)
  3. Based on the column headers, three columns are retained: the UniProt ID, the gene symbol and the score. The default column heads are "Accession", "Description" and "Score". The "Description" column is scanned for a pattern like "- [XXX_YYYY]"; the "XXX" is interpreted as the gene symbol.
In addition, if the file has a column named "Heavy/Light", it is taken to be a SILAC experiment; rows without a value in this column are discarded unless onlyDiff is FALSE.

Column names may be overridden via the configuration list. The defaults are as above; they may be overridden by setting these names in the config list: "accessionCol", "descriptionCol", "scoreCol", and "heavyCol".

Examples

Run this code
# Load a data set from a mass spec experiment
p <- system.file("extdata",package="msarc")
samp_fn <- file.path(p,"sample_msdata.txt.gz")
sample <- msarc.loadMS(samp_fn)

# Load a data set, with a configuration list
samp_fn <- file.path(p,"sample_colnames.txt.gz")
sample <- msarc.loadMS(samp_fn,config=list("accessionCol"="Uniprot_ID"))

Run the code above in your browser using DataLab