R/normalise_by_permutation.R
normaliseByPermu.RdNormalise test perturbation scores by permutation
normalise_by_permu(permutedScore, testScore, pAdj_method = "fdr")A list. Output of generate_permuted_scores
A matrix. Output of weight_ss_fc
Method for adjusting p-values for multiple comparisons. See ?p.adjust for methods available. Default to FDR.
A dataframe.
Normalise the test perturbation scores generated by weight_ss_fc through the permuted perturbation scores derived from
the generate_permuted_scores function. The mean absolute deviation(MAD) and median of perturbation scores for each pathway are firstly
derived from the permuted perturbation scores. The test perturbation scores are then converted to robust z-scores using MADs and medians
calculated.
# \donttest{
load(system.file("extdata", "gsTopology.rda", package = "sSNAPPY"))
#> Warning: cannot open compressed file '', probable reason 'No such file or directory'
#> Error in readChar(con, 5L, useBytes = TRUE): cannot open the connection
ssPertScore <- compute_perturbation_score(ls$logFC, gsTopology)
#> Error in lapply(gsTopology, rownames): object 'gsTopology' not found
permutedScore <- generate_permuted_scores(logCPM, numOfTreat = 2,
NB = 5, gsTopology = gsTopology, weight = ls$weight)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'expreMatrix' in selecting a method for function 'generate_permuted_scores': object 'logCPM' not found
normalisedScores <- normalise_by_permu(permutedScore, ssPertScore)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'as.data.frame': object 'permutedScore' not found
# }
# Load the example output
load(system.file("extdata", "normalisedScores.rda", package = "sSNAPPY"))
#> Warning: cannot open compressed file '', probable reason 'No such file or directory'
#> Error in readChar(con, 5L, useBytes = TRUE): cannot open the connection
normalisedScores
#> Error in eval(expr, envir, enclos): object 'normalisedScores' not found