score_matrix: Converts the data frame of paired-sine scores to a matrix

Description Usage Arguments Value Examples

View source: R/score_matrix.R

Description

This function expects a data frame df, as returned by the function paired_sine_analysis, i.e., containing the scores (-log10(ε_{1,2}^2)) for each gene pair. The resulting matrix is a wide format of the gene-pairs scores (originally in long format in df).

Usage

1
score_matrix(df, gene_1 = "gene_1", gene_2 = "gene_2", score = "score")

Arguments

df

A data frame as returned by paired_sine_analysis.

gene_1

Name of the column containing the names of the first gene in the gene pair (default is "gene_1").

gene_2

Name of the column containing the names of the second gene in the gene pair (default is "gene_2").

score

Name of the column containing the scores (default is "score").

Value

A symmetric matrix of gene pair scores (-log10(ε_{1,2}^2)). Column and row names are the gene names in alphabetical order.

Examples

1
2
3
4
5
m <- cbind(t(combn(1:5, m = 2, simplify = TRUE)), 1:10)
colnames(m) <- c('x', 'y', 'z')

score_matrix(m, gene_1 = 'x', gene_2 = 'y', score = 'z')
 

ramiromagno/oscillation documentation built on April 20, 2020, 10:37 a.m.