gene_importances: Calculate the importance of a feature

Description Usage Arguments Value Examples

View source: R/gene_importances.R

Description

Calculates the feature importance of each column in x in trying to predict the time ordering.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
gene_importances(
  x,
  time,
  num_permutations = 0,
  ntree = 10000,
  ntree_perm = ntree/10,
  mtry = ncol(x) * 0.01,
  num_threads = 1,
  ...
)

Arguments

x

A numeric matrix or a data frame with M rows (one per sample) and P columns (one per feature).

time

A numeric vector containing the inferred time points of each sample along a trajectory as returned by infer_trajectory.

num_permutations

The number of permutations to test against for calculating the p-values (default: 0).

ntree

The number of trees to grow (default: 10000).

ntree_perm

The number of trees to grow for each of the permutations (default: ntree / 10).

mtry

The number of variables randomly samples at each split (default: 1% of features).

num_threads

Number of threads. Default is 1.

...

Extra parameters passed to ranger.

Value

a data frame containing the importance of each feature for the given time line

Examples

1
2
3
4
5
6
7
dataset <- generate_dataset(num_genes=500, num_samples=300, num_groups=4)
expression <- dataset$expression
group_name <- dataset$sample_info$group_name
space <- reduce_dimensionality(expression, ndim=2)
traj <- infer_trajectory(space)
# set ntree to at least 1000!
gene_importances(expression, traj$time, num_permutations = 0, ntree = 1000)

Example output

Warning message:
In file(con, "r") : cannot open file '/proc/stat': Permission denied
# A tibble: 500 x 3
   gene    importance pvalue
   <chr>        <dbl> <lgl> 
 1 Gene90       0.159 NA    
 2 Gene183      0.148 NA    
 3 Gene428      0.146 NA    
 4 Gene23       0.144 NA    
 5 Gene54       0.137 NA    
 6 Gene288      0.130 NA    
 7 Gene147      0.124 NA    
 8 Gene360      0.123 NA    
 9 Gene481      0.123 NA    
10 Gene269      0.119 NA    
# … with 490 more rows

SCORPIUS documentation built on June 9, 2021, 5:07 p.m.