Skip to contents

This function creates a column for the protein dataset after aggregation by using the previous peptide dataset.

Usage

BuildColumnToProteinDataset(peptideData, matAdj, columnName, proteinNames)

Arguments

peptideData

A data.frame of meta data of peptides. It is the rowData of the SummarizedExperiment object.

matAdj

The adjacency matrix used to agregate the peptides data.

columnName

The name(s) of the column in Biobase::rowData(peptides_MSnset) that the user wants to keep in the new protein data.frame.

proteinNames

The names of the protein in the new dataset (i.e. rownames)

Value

A vector

Author

Samuel Wieczorek

Examples

library(QFeatures)
#> Loading required package: MultiAssayExperiment
#> Loading required package: SummarizedExperiment
#> Loading required package: MatrixGenerics
#> Loading required package: matrixStats
#> 
#> Attaching package: ‘MatrixGenerics’
#> The following objects are masked from ‘package:matrixStats’:
#> 
#>     colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
#>     colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
#>     colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
#>     colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
#>     colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
#>     colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
#>     colWeightedMeans, colWeightedMedians, colWeightedSds,
#>     colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
#>     rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
#>     rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
#>     rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
#>     rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
#>     rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
#>     rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
#>     rowWeightedSds, rowWeightedVars
#> Loading required package: GenomicRanges
#> Loading required package: stats4
#> Loading required package: BiocGenerics
#> Loading required package: generics
#> 
#> Attaching package: ‘generics’
#> The following objects are masked from ‘package:base’:
#> 
#>     as.difftime, as.factor, as.ordered, intersect, is.element, setdiff,
#>     setequal, union
#> 
#> Attaching package: ‘BiocGenerics’
#> The following objects are masked from ‘package:stats’:
#> 
#>     IQR, mad, sd, var, xtabs
#> The following objects are masked from ‘package:base’:
#> 
#>     Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append,
#>     as.data.frame, basename, cbind, colnames, dirname, do.call,
#>     duplicated, eval, evalq, get, grep, grepl, is.unsorted, lapply,
#>     mapply, match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
#>     rank, rbind, rownames, sapply, saveRDS, table, tapply, unique,
#>     unsplit, which.max, which.min
#> Loading required package: S4Vectors
#> 
#> Attaching package: ‘S4Vectors’
#> The following object is masked from ‘package:utils’:
#> 
#>     findMatches
#> The following objects are masked from ‘package:base’:
#> 
#>     I, expand.grid, unname
#> Loading required package: IRanges
#> Loading required package: GenomeInfoDb
#> Loading required package: Biobase
#> Welcome to Bioconductor
#> 
#>     Vignettes contain introductory material; view with
#>     'browseVignettes()'. To cite Bioconductor, see
#>     'citation("Biobase")', and for packages 'citation("pkgname")'.
#> 
#> Attaching package: ‘Biobase’
#> The following object is masked from ‘package:MatrixGenerics’:
#> 
#>     rowMedians
#> The following objects are masked from ‘package:matrixStats’:
#> 
#>     anyMissing, rowMedians
#> 
#> Attaching package: ‘QFeatures’
#> The following object is masked from ‘package:base’:
#> 
#>     sweep

data(Exp1_R25_pept, package="DaparToolshedData")
obj <- Exp1_R25_pept[1:10]
protID <- parentProtId(obj[[2]])
X <- QFeatures::adjacencyMatrix(obj[[2]])

X.split <- DaparToolshed::splitAdjacencyMat(X)
X.shared <- X.split$Xshared
X.unique <- X.split$Xspec


#adjacencyMatrix(obj[[2]]) <- X.unique
#rowdata.pep <- rowData(obj[[2]])


# obj <- aggregateFeatures4Prostar(
#   object = obj,
#   i = length(obj),
#   name = 'aggregated',
#   fcol = 'adjacencyMatrix',
#   fun = 'colSumsMat')
# 
# 
# .names <- "Sequence"
# 
# proteinNames <- rownames(obj[[length(obj)]])
# data <- rowData(obj[[length(obj)-1]])
# 
# new.col <- BuildColumnToProteinDataset(
#   peptideData = rowData(obj[[length(obj)-1]]), 
#   matAdj = adjacencyMatrix(obj[[2]]), 
#   columnName = "Sequence",
#   proteinNames = rownames(obj[[length(obj)]]))