A gene cluster is defined as the k nearest genes surrounding a reference gene according to the rank matrix. The rank matrix is a gene-by-species matrix, where each column contains the genomic ranks of genes for a given species.

getGeneCluster(queryGR, queryGeneName, homologsList, k = 10, radius = 0)

Arguments

queryGR

The query GRanges outputted by grangesFromEnsemblIDs.

queryGeneName

The center gene used to search.

homologsList

The homologs list outputted by getHomologGeneList.

k

The maximum number of nearest genes.

radius

The maximum number of gap genes for the search. If radius is set to greater than 0, k parameter will be ignored.

Value

The ids of the cluster for the center gene.

Examples

fish <- readRDS(system.file('extdata', 'fish.rds',
                            package = 'geneClusterPattern'))
homologs <- readRDS(system.file('extdata', 'homologs.rds',
                                package = 'geneClusterPattern'))
queryGene <- 'inhbaa'
nearestNeighbors <- getGeneCluster(fish, queryGene, homologs)