| sortGeneTrajectories {LineagePulse} | R Documentation |
Sorts inferred gene trajectories by peak time in continuous covariate. Optional: Can create a heatmap of the gene trajectories sorted according to peak time. The heatmap is based on z-scores.
sortGeneTrajectories(vecIDs, lsMuModel, dirHeatmap = NULL)
vecIDs |
(vector of strings) Names of genes to cluster. |
lsMuModel |
(list) Object containing description of gene-wise mean parameter models. |
dirHeatmap |
(str directory) [Default NULL] Directory to which heatmap is saved to. Return heatmap object if NULL. |
list (length 3) If dirHeatmap is not NULL, only vecSortedGenes is returned and the two heatmaps are printed to pdfs in the directory dirHeatmap. vecSortedGenes: (string vector number of IDs) hmGeneSorted: genes sorted by peak time in continuous covariate hmGeneClusters: genes sorted by clustering
David Sebastian Fischer
Called by user.
lsSimulatedData <- simulateContinuousDataSet(
scaNCells = 100,
scaNConst = 10,
scaNLin = 10,
scaNImp = 10,
scaMumax = 100,
scaSDMuAmplitude = 3,
vecNormConstExternal=NULL,
vecDispExternal=rep(20, 30),
vecGeneWiseDropoutRates = rep(0.1, 30))
matDropoutPredictors <- as.matrix(data.frame(
log_means = log(rowMeans(lsSimulatedData$counts)+1) ))
objLP <- runLineagePulse(
counts = lsSimulatedData$counts,
dfAnnotation = lsSimulatedData$annot,
strMuModel = "splines", scaDFSplinesMu = 6,
strDropModel="logistic",
matPiConstPredictors = matDropoutPredictors)
lsHeatmaps <- sortGeneTrajectories(
vecIDs = objLP$dfResults[which(objLP$dfResults$padj < 0.01),]$gene,
lsMuModel = lsMuModelH1(objLP),
dirHeatmap = NULL)
#print(lsHeatmaps$hmGeneSorted)