isobar-import {isobar} | R Documentation

## Loading data into IBSpectra objects using readIBSpectra

### Description

Read ibspectra-csv files and peaklist files as an IBSpectra object of type 'type' (see `IBSpectra`, e.g. iTRAQ4plexSpectra or TMT6plexSpectra). If peaklist.file is missing, it is assumed that id.file contains intensity and m/z columns for the reporter tags.

### Usage

    ## S4 method for signature 'character,character'
    readIBSpectra(type,id.file)

    # reads id file
    ## S4 method for signature 'character,character,character'
    readIBSpectra(
                     type, id.file, peaklist.file, sep = "\t", mapping.file
                     = NULL, mapping = c(quantification.spectrum = "hcd",
                     identification.spectrum = "cid"), id.file.domap =
                     NULL, identifications.format = NULL, decode.titles =
                     FALSE, ...)

    # reads peaklist file
    ## S4 method for signature 'character,data.frame,character'
    readIBSpectra(
                     type, id.file, peaklist.file, annotate.spectra.f =
                     NULL, peaklist.format = NULL, scan.lines = 0,
                     fragment.precision = NULL, fragment.outlier.prob =
                     NULL, ...)

### Arguments

`type` | Name of class of new IBSpectra object: `iTRAQ4plexSpectra`, `iTRAQ8plexSpectra`, `TMT2plexSpectra`, `TMT6plexSpectra`, or `TMT10plexSpectra`
`id.file` | Database search results file in `ibspectra.csv` or `mzIdentML` format. See `identifications.format`. See the vignette for information on converting Mascot dat and Phenyx pidres files into ibspectra format.
`peaklist.file` | Peaklist file, typically in MGF format, see `peaklist.format`. MGF must be centroid!

`mapping.file` | If defined, spectum titles from the peaklist file are linked to the identifications via this file. This can be used when running HCD runs for quantification and CID runs for identification. See Koecher et al., 2009 for details.
`mapping` | Named character vector defining the names of columns in mapping.file. The names must be 'peaklist' and 'id', and the values must correspond to colnames of the mapping files.

`id.file.domap` | When using HCD-CID or a method akin and every spectrum is used for identification, the ID result files of the HCD run can be specfied in `id.file.domap`. Then, the results are merged after mapping the identification results.
`annotate.spectra.f` | Function which changes or annotates the spectra feature data before it is written to IBpectra object. This can be used to calculate and threshold additional scores, for example localization scores of post- translational modifications such as Delta Score (filterSpectraDeltaScore) or PhosphoRS site localization probabilities (annotateSpectraPhosphoRS).
`peaklist.format` | "mgf" (Mascot Generic format) or "mcn" (iTracker Machine Readable output). When NULL, it detects the format on file name extension.
`identifications.format` | "ibspectra.csv" or "mzid" (PSI MzIdentML format). When NULL, file format is guessed based on extension.
`fragment.precision` | Fragment precision for extraction of reporter tags: for each tag and spectrum the m/z-intensity pair with it's mass closest to the known reporter tag mass is extracted within the window true_mass +/- fragment.precision/2.
`fragment.outlier.prob` | Fragment outlier probability filter: After all m/z-intensity pairs have been extracted, those pairs with the fragment.outlier.prob/2 most unprecise m/z values are filtered out.
`decode.titles` | Boolean. Decode spectrum titles in identification file using `URLdecode`. When extracting the DAT file from Mascot web interface, the spectrum titles are encoded - %20 instead of space, etc. Set decode.titles to TRUE to map these titles to the unescaped MGF titles.
`scan.lines` | Read files sequentially scan.lines lines at a time. Can help in case of memory issues, set to 10000 or higher, for example.
`sep` | sep argument of read.table
`...` | Further arguments handed down to `initialize`.

### Author(s)

Florian P. Breitwieser, Jacques Colinge

### See Also

ProteinGroup, IBSpectra, isobar-preprocessing, isobar-analysis, isobar-plots

### Examples

    data(ibspiked_set1)

    # get identifier for Ceruplasmin proteins
    ceru.acs <- protein.g(proteinGroup(ibspiked_set1),"CERU")
    # create a smaller ibspectra w/ only Ceruplasmins
    ib.ceru <- subsetIBSpectra(ibspiked_set1,protein=ceru.acs,direction="include")

    # write it to a file
    tf <- tempfile("isobar")
    write.table(as.data.frame(ib.ceru),sep="\t",file=tf,quote=FALSE)

    # read it again into an IBSpectra object
    ib.ceru2 <- readIBSpectra("iTRAQ4plexSpectra",tf,identifications.format="ibspectra")
    ib.ceru2

    unlink(tf)

[Package isobar version 1.32.0 Index]