count_features_per_protein: Count the number of features (rows) per protein

View source: R/count_features_per_protein.R

count_features_per_proteinR Documentation

Count the number of features (rows) per protein

Description

For differential testing with https://www.bioconductor.org/packages/release/bioc/html/DEqMS.htmlDEqMS, one needs to identify the number of features, e.g PSMs or peptides per protein. This function returns the number of features per protein per sample.

Usage

count_features_per_protein(obj, master_prot_col = "Master.Protein.Accessions")

Arguments

obj

MSnSet. Contains PSMs or peptides.

master_prot_col

character Column name for master protein ID

Value

tibble with feature counts per sample per protein.

Examples

# Use a small example TMT dataset included with the camprotR package
df <- psm_tmt_total

# Make an MSnSet
df_exprs <- as.matrix(df[, grep("Abundance", colnames(df))])
colnames(df_exprs) <- gsub("Abundance\\.", "", colnames(df_exprs))

df_fData <- df[, grep("Abundance", colnames(df), invert = TRUE)]

psm <- MSnbase::MSnSet(exprs = df_exprs, fData = df_fData)

# Count the number of PSMs per protein
count_features_per_protein(psm, master_prot_col = "Master.Protein.Accessions")


CambridgeCentreForProteomics/camprotR documentation built on July 7, 2024, 2:13 a.m.