Skip to contents

Assembles data in format compliant with BIC requirements. Used internally by run_plexedpiper.

Usage

make_rii_peptide_gl(
  msnid,
  masic_data,
  fractions,
  samples,
  references,
  annotation,
  org_name = "Rattus norvegicus",
  fasta_file
)

make_results_ratio_gl(
  msnid,
  masic_data,
  fractions,
  samples,
  references,
  annotation,
  org_name = "Rattus norvegicus",
  sep = "_",
  fasta_file
)

make_rii_peptide_ph(
  msnid,
  masic_data,
  fractions,
  samples,
  references,
  annotation,
  org_name = "Rattus norvegicus",
  sep = "_",
  fasta_file
)

make_results_ratio_ph(
  msnid,
  masic_data,
  fractions,
  samples,
  references,
  annotation,
  org_name = "Rattus norvegicus",
  sep = "_",
  fasta_file
)

assess_redundant_protein_matches(msnid, collapse = "|")

assess_noninferable_proteins(msnid, collapse = "|")

Arguments

msnid

(MSnID object) final filtered version of MSnID object

masic_data

(object coercible to data.table) final filtered version of MASIC table

fractions

(object coercible to data.table) study design table linking Dataset with PlexID

samples

(object coercible to data.table) study design table linking sample names with TMT channels and PlexID

references

(object coercible to data.table) study design table describing reference value calculation

annotation

(character) format of accessions(msnid). Either "refseq", "uniprot", or "gencode" (case insensitive).

org_name

(character) scientific name of organism (e.g., "Homo sapiens", "Rattus norvegicus", "Mus musculus", etc.). Case sensitive.

fasta_file

(character) Path to FASTA file

sep

(character) used to concatenate protein, SiteID, and peptide.

collapse

(character) used to collapse proteins in assess_redundant_protein_matches

Details

The ratio and rii functions require columns "redundantAccessions", "noninferableProteins" and "percentAACoverage" (created with compute_accession_coverage) to be present in psms(msnid).

  • make_rii_peptide_gl: returns 'RII_peptide.txt' table (global)

  • make_results_ratio_gl: returns 'results_ratio.txt' table (global)

  • make_rii_peptide_ph: returns 'RII_peptide.txt' table (phospho)

  • make_results_ratio_ph: returns 'results_ratio.txt' table (phospho)

  • assess_redundant_protein_matches: appends proteins matched to multiple peptides. Creates the "redundantAccessions" column in psms(msnid).

  • assess_noninferable_proteins: appends proteins with identical peptide sets. Creates the "noninferableProteins" column in psms(msnid).

Examples

if (FALSE) {
# Prepare MS/MS IDs ----
path_to_MSGF_results <- system.file("extdata/global/msgf_output",
                                    package = "PlexedPiperTestData")
msnid <- read_msgf_data(path_to_MSGF_results)
msnid <- MSnID::correct_peak_selection(msnid)
show(msnid)
msnid <- filter_msgf_data_peptide_level(msnid, 0.01)
show(msnid)
path_to_FASTA <- system.file(
  "extdata/Rattus_norvegicus_NCBI_RefSeq_2018-04-10.fasta.gz",
  package = "PlexedPiperTestData"
)
msnid <- compute_num_peptides_per_1000aa(msnid, path_to_FASTA)
msnid <- filter_msgf_data_protein_level(msnid, 0.01)
show(msnid)
msnid <- assess_redundant_protein_matches(msnid)
msnid <- assess_noninferable_proteins(msnid)
fst <- Biostrings::readAAStringSet(path_to_FASTA)
names(fst) <- gsub(" .*", "", names(fst)) # make names match accessions
msnid <- MSnID::compute_accession_coverage(msnid, fst)
head(psms(msnid))

# Prepare table with reporter ion intensities ----
path_to_MASIC_results <- system.file("extdata/global/masic_output",
                                     package = "PlexedPiperTestData")
masic_data <- read_masic_data(path_to_MASIC_results,
                              interference_score = TRUE)
masic_data <- filter_masic_data(masic_data, 0.5, 0)

# Read study design files ----
library(readr)
fractions <- read_tsv(system.file("extdata/study_design/fractions.txt",
                                  package = "PlexedPiperTestData"))
samples <- read_tsv(system.file("extdata/study_design/samples.txt",
                                package = "PlexedPiperTestData"))
references <- read_tsv(system.file("extdata/study_design/references.txt",
                                   package = "PlexedPiperTestData"))

# Create final tables ----
results_ratio <- make_results_ratio_gl(msnid, masic_data,
                                       fractions, samples, references,
                                       annotation = "RefSeq",
                                       org_name = "Rattus norvegicus",
                                       fasta_file = path_to_FASTA)
head(results_ratio, 10)

rii_peptide <- make_rii_peptide_gl(msnid, masic_data,
                                   fractions, samples, references,
                                   annotation = "RefSeq",
                                   org_name = "Rattus norvegicus",
                                   fasta_file = path_to_FASTA)
head(rii_peptide, 10)

# Clean-up cache
unlink(".Rcache", recursive = TRUE)
}