This function generates an average similarity (correlation/inverse distance) coefficient for every sliding window, for each sample in the expression matrix. That is done by comparing the distribution of genes in each window across samples.

calculate_expression_similarity_counts(
  expression.matrix,
  similarity.measure = "correlation_pearson",
  n.elements.per.window = NULL,
  n.step = NULL,
  n.step.fraction = 0.05,
  ...
)

Arguments

expression.matrix

the expression matrix, can be normalized or not

similarity.measure

one of the correlation or distance metrics to be used, defaults to pearson correlation; list of all methods in get_methods_correlation_distance

n.elements.per.window

number of elements to have in a window, default 10% of the number of rows

n.step

step size to slide across, default 1% of n.elements.per.window

n.step.fraction

an alternative way to specify the step size, as a fraction of the window length; default is 5%

...

arguments passed on to other methods

Value

A list with three elements: the first element is the expression matrix, as supplied; the other two are the expression levels matrix and expression levels similarity matrix; they have the same # of columns as the expression matrix, and n.elements.per.window * n.step rows.

See also

Examples

calculate_expression_similarity_counts( expression.matrix = matrix(1:100, ncol = 5), similarity.measure = "correlation_pearson", n.elements.per.window = 3)
#> The input matrix has 20 rows and 5 cols
#> number of genes: 20
#> number of samples: 5
#> the number of elements per window is 3
#> the step size is 1
#> the selected similarity metric is correlation_pearson
#> Working with sample 1
#> Working with sample 2
#> Working with sample 3
#> Working with sample 4
#> Working with sample 5
#> $expression.matrix #> [,1] [,2] [,3] [,4] [,5] #> [1,] 1 21 41 61 81 #> [2,] 2 22 42 62 82 #> [3,] 3 23 43 63 83 #> [4,] 4 24 44 64 84 #> [5,] 5 25 45 65 85 #> [6,] 6 26 46 66 86 #> [7,] 7 27 47 67 87 #> [8,] 8 28 48 68 88 #> [9,] 9 29 49 69 89 #> [10,] 10 30 50 70 90 #> [11,] 11 31 51 71 91 #> [12,] 12 32 52 72 92 #> [13,] 13 33 53 73 93 #> [14,] 14 34 54 74 94 #> [15,] 15 35 55 75 95 #> [16,] 16 36 56 76 96 #> [17,] 17 37 57 77 97 #> [18,] 18 38 58 78 98 #> [19,] 19 39 59 79 99 #> [20,] 20 40 60 80 100 #> #> $expression.levels #> [,1] [,2] [,3] [,4] [,5] #> [1,] 2 22 42 62 82 #> [2,] 3 23 43 63 83 #> [3,] 4 24 44 64 84 #> [4,] 5 25 45 65 85 #> [5,] 6 26 46 66 86 #> [6,] 7 27 47 67 87 #> [7,] 8 28 48 68 88 #> [8,] 9 29 49 69 89 #> [9,] 10 30 50 70 90 #> [10,] 11 31 51 71 91 #> [11,] 12 32 52 72 92 #> [12,] 13 33 53 73 93 #> [13,] 14 34 54 74 94 #> [14,] 15 35 55 75 95 #> [15,] 16 36 56 76 96 #> [16,] 17 37 57 77 97 #> [17,] 18 38 58 78 98 #> [18,] 19 39 59 79 99 #> #> $expression.levels.similarity #> [,1] [,2] [,3] [,4] [,5] #> [1,] 1 1 1 1 1 #> [2,] 1 1 1 1 1 #> [3,] 1 1 1 1 1 #> [4,] 1 1 1 1 1 #> [5,] 1 1 1 1 1 #> [6,] 1 1 1 1 1 #> [7,] 1 1 1 1 1 #> [8,] 1 1 1 1 1 #> [9,] 1 1 1 1 1 #> [10,] 1 1 1 1 1 #> [11,] 1 1 1 1 1 #> [12,] 1 1 1 1 1 #> [13,] 1 1 1 1 1 #> [14,] 1 1 1 1 1 #> [15,] 1 1 1 1 1 #> [16,] 1 1 1 1 1 #> [17,] 1 1 1 1 1 #> [18,] 1 1 1 1 1 #>