minmax | R Documentation |
Perform a minmax standardisation to scale data into 0 to 1 range
minmax(mat)
mat |
a matrix with rows correspond to phosphosites and columns correspond to condition |
Minmax standardised matrix
data('phospho_L6_ratio_pe')
data('SPSs')
data('PhosphoSitePlus')
ppe <- phospho.L6.ratio.pe
sites = paste(sapply(GeneSymbol(ppe), function(x)x),";",
sapply(Residue(ppe), function(x)x),
sapply(Site(ppe), function(x)x),
";", sep = "")
grps = gsub("_.+", "", colnames(ppe))
design = model.matrix(~ grps - 1)
ctl = which(sites %in% SPSs)
ppe = RUVphospho(ppe, M = design, k = 3, ctl = ctl)
phosphoL6 = SummarizedExperiment::assay(ppe, "normalised")
# filter for up-regulated phosphosites
phosphoL6.mean <- meanAbundance(phosphoL6, grps = grps)
aov <- matANOVA(mat=phosphoL6, grps = grps)
idx <- (aov < 0.05) & (rowSums(phosphoL6.mean > 0.5) > 0)
phosphoL6.reg <- phosphoL6[idx, ,drop = FALSE]
L6.phos.std <- standardise(phosphoL6.reg)
ks.profile.list <- kinaseSubstrateProfile(PhosphoSite.mouse, L6.phos.std)
data(KinaseMotifs)
numMotif = 5
numSub = 1
motif.mouse.list.filtered <-
motif.mouse.list[which(motif.mouse.list$NumInputSeq >= numMotif)]
ks.profile.list.filtered <-
ks.profile.list[which(ks.profile.list$NumSub >= numSub)]
# scoring all phosphosites against all motifs
motifScoreMatrix <-
matrix(NA, nrow=nrow(L6.phos.std),
ncol=length(motif.mouse.list.filtered))
rownames(motifScoreMatrix) <- rownames(L6.phos.std)
colnames(motifScoreMatrix) <- names(motif.mouse.list.filtered)
L6.phos.seq <- Sequence(ppe)[idx]
# extracting flanking sequences
seqWin = mapply(function(x) {
mid <- (nchar(x)+1)/2
substr(x, start=(mid-7), stop=(mid+7))
}, L6.phos.seq)
print('Scoring phosphosites against kinase motifs:')
for(i in seq_len(length(motif.mouse.list.filtered))) {
motifScoreMatrix[,i] <-
frequencyScoring(seqWin, motif.mouse.list.filtered[[i]])
cat(paste(i, '.', sep=''))
}
motifScoreMatrix <- minmax(motifScoreMatrix)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.