Calculate the gene order score.

geneOrderScore(
  genesList,
  ids,
  ref,
  k = length(ids),
  max_gap = 1e+07,
  method = c("edit distance", "global alignment score", "spearman correlation",
    "non-random score", "pairs distance", "pairs direction"),
  output = c("score", "value matrix")
)

Arguments

genesList

A list of GRanges.

ids

IDs to be plotted. See getGeneCluster.

ref

The reference species.

k

The maximum number of nearest genes used in getGeneCluster.

max_gap

The maximal gaps from the first ID in `ids`.

method

The method to calculate the gene order score. 'edit distance', the gene order score is the mean of edit (Levenshtein) distance of given ids from different species. Gene order score = mean(adist)*k/length(ids). The higher the gene order score, the lower the conservation of the gene order. 'global alignment score', the gene order score is the mean of global alignment score. see pairwiseAlignment. The higher the gene order score, the higher the conservation of the gene order. 'spearman correlation', the score is the mean of absolute value of Spearman correlation of the genes appearance order. 'non-random score', the score is the mean of Jaccard index of 2-order and 3-order of ids for paired samples. The higher the gene order score, the higher the conservation of the gene order. 'pairs distance', the score is the mean of pairwise coordinates distance. The higher the gene order score, the lower the conservation of gene order. 'pairs direction', the score is the mean of alignment of pairwise strand information. The higher the gene order score, the higher the conservation of gene order.

output

Output values

Value

the score or values matrix such as adist, or alignment scores.

Examples

# example code
fish <- readRDS(system.file('extdata', 'fish.rds',
package = 'geneClusterPattern'))
homologs <- readRDS(system.file('extdata', 'homologs.rds',
                                package = 'geneClusterPattern'))
queryGene <- 'inhbaa'
nearest10neighbors <- getGeneCluster(fish, queryGene, homologs, k=10)
genesList <- c(drerio=fish, homologs)[
c("hsapiens", "mmusculus", "drerio", "olatipes", "nfurzeri", "gaculeatus")]
geneOrderScore(genesList, nearest10neighbors, ref='drerio')
#> [1] 132.4
geneOrderScore(genesList, nearest10neighbors, method='edit distance')
#> [1] 161.5333
geneOrderScore(genesList, nearest10neighbors, method='global alignment score')
#> [1] -532.9976
geneOrderScore(genesList, nearest10neighbors, method='spearman correlation')
#> [1] 0.4101958
geneOrderScore(genesList, nearest10neighbors, method='non-random score')
#> [1] 0.5375864
geneOrderScore(genesList, nearest10neighbors, method='pairs distance')
#> [1] 5501692
geneOrderScore(genesList, nearest10neighbors, method='pairs direction')
#> [1] 0.3555556