Data.frame to QFeatures object conversion using an experimental design
make_pe.Rd
make_pe
creates a QFeatures object
based on two data.frames: the peptide table and experimental design.
Arguments
- Peptide
Data.frame, Peptide table with its belonging proteingroup.
- columns
A numeric indicating the indices of the columns to be used as expression values. Can also be a character indicating the names of the columns.
- expdesign
A data.frame. Experimental design with 'label', 'condition' and 'replicate' information.
- fnames
An optional character(1) or numeric(1) indicating the column identifier.
- assay_name
An character(1) to name assay in the QFeatures object.
- log2transform
Logical(1), whether log2 transform the assay, default TRUE.
Examples
# Load a peptides
data(Silicosis_peptide)
# Exctract Intensity columns
(ecols <- grep("Intensity.", colnames(Silicosis_peptide), value = TRUE))
#> [1] "Intensity.PBS_1" "Intensity.PBS_2" "Intensity.PBS_3" "Intensity.PBS_4"
#> [5] "Intensity.W10_2" "Intensity.W10_4" "Intensity.W2_1" "Intensity.W2_3"
#> [9] "Intensity.W2_4" "Intensity.W2_5" "Intensity.W4_2" "Intensity.W4_3"
#> [13] "Intensity.W4_4" "Intensity.W4_5" "Intensity.W6_2" "Intensity.W6_3"
#> [17] "Intensity.W6_4" "Intensity.W6_6" "Intensity.W9_2" "Intensity.W9_4"
# Load experiement design
data(Silicosis_ExpDesign)
(expDesign = Silicosis_ExpDesign)
#> label ID condition replicate
#> PBS_1 PBS_1 PBS_1 PBS 1
#> PBS_2 PBS_2 PBS_2 PBS 2
#> PBS_3 PBS_3 PBS_3 PBS 3
#> PBS_4 PBS_4 PBS_4 PBS 4
#> W10_2 W10_2 W10_2 W10 2
#> W10_4 W10_4 W10_4 W10 4
#> W2_1 W2_1 W2_1 W2 1
#> W2_3 W2_3 W2_3 W2 3
#> W2_4 W2_4 W2_4 W2 4
#> W2_5 W2_5 W2_5 W2 5
#> W4_2 W4_2 W4_2 W4 2
#> W4_3 W4_3 W4_3 W4 3
#> W4_4 W4_4 W4_4 W4 4
#> W4_5 W4_5 W4_5 W4 5
#> W6_2 W6_2 W6_2 W6 2
#> W6_3 W6_3 W6_3 W6 3
#> W6_4 W6_4 W6_4 W6 4
#> W6_6 W6_6 W6_6 W6 6
#> W9_2 W9_2 W9_2 W9 2
#> W9_4 W9_4 W9_4 W9 4
# Construct a QFeatures object, with a 'peptideRaw' assay
pe_peptides <- make_pe(Silicosis_peptide, columns = ecols, # columns is the abundance columns
expdesign = expDesign) # log2transform
pe_peptides # a QFeatures object, with a peptideRaw assay
#> An instance of class QFeatures containing 1 assays:
#> [1] peptideRaw: SummarizedExperiment with 143528 rows and 20 columns