#' Permute peptides and recompute logFC
#'
#' @docType methods
#' @name permPeptides
#' @rdname permPeptides
#'
#' @param normcount Normalized count matrix.
#' @param ctrl Round1 control index.
#' @param treat Round3 control index.
#' @param kmer An integer.
#' @param nperm An integer, specifying the permutation time.
#'
#' @return LogFC matrix for each permutation.
#'
#' @author Wubing Zhang
#' @importFrom permute shuffleSet
#' @export
permPeptides <- function(ctrl_count, kmer = 5, nperm = 1000){
permIndex <- permute::shuffleSet(length(ctrl_count), nperm)
tmpcount = t(matrix(ctrl_count[permIndex], nperm))
rownames(tmpcount) = names(ctrl_count)
colnames(tmpcount) = paste0("Perm", 1:nperm)
background <- kmerScan(tmpcount, kmer = kmer)
return(background)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.