Find features order, for a heatmap
find_features_order.Rd
We have feature expression levels for each cell along pseudotime. Giving a dataframe containing feature expression level along pseudotime, the function computes feature order, to represent feature expression on a heatmap, where cells are ordered by pseudotime. For each feature, the function smoothens the feature expression along pseudotime, with the loess function (TIME CONSUMING). Then, with the find_èxtrema_curve function, it computes different metrics from the feature expression curve. There are four patterns of feature expression : a) –+ : feature reaches a maximum in the end b) +– : feature reaches a maximum at the beginning c) -+- : feature peaks in the middle d) +-+ : feature is down-regulated in the middle Features are ordered thank to the pseudotime corresponding to the maximum of expression. For pattern d), feature will be positioned at the beginning or at the end. To precise the position of each feature, feature with a similar pseudotime at maximum are ordered according to the pseudotime value corresponding to the local minimum just before the peak of expression. Then, features are ordered according to the amplitude of the peak : a pattern -++ will be before a pattern –+.
Arguments
- df_features
DATAFRAME : a dataframe with cells in rows and features in columns. It must have a column called "pseudotime" corresponding to the pseudotime value of each cell (no default)
- fast
LOGICAL : EXPERIMENTAL whether to fast the running time by subsetting cells (default to FALSE)
- verbose
LOGICAL : whether to print message or not (default to FALSE)