Contents

1 Introduction

In some cases you have certain genes of interest and you would like to find other genes that are close to the genes of interest. This can be done using the genefinder function.

You need to specify either the index position of the genes you want (which row of the expression array the gene is in) or the name (consistent with the featureNames of the ExpressionSet).

A vector of names can be specified and matches for all will be computed. The number of matches and the distance measure used can all be specified. The examples will be carried out using the artificial data set, sample.ExpressionSet.

Two other options for genefinder are scale and method. The scale option controls the scaling of the rows (this is often desirable), while the method option controls the distance measure used between genes. The possible values and their meanings are listed at the end of this document.

library("Biobase")
library("genefilter")
data(sample.ExpressionSet)
igenes <- c(300,333,355,419) ##the interesting genes
closeg <- genefinder(sample.ExpressionSet, igenes, 10, method="euc", scale="none")
names(closeg)
## [1] "31539_r_at" "31572_at"   "31594_at"   "31658_at"

The Affymetrix identifiers (since these were originally Affymetrix data) are 31539_r_at, 31572_at, 31594_at and 31658_at. We can find the nearest genes (by index) for any of these by simply accessing the relevant component of closeg.

closeg$"31539_r_at"
## $indices
##  [1] 220 425 457 131 372 137 380 231 161  38
## 
## $dists
##  [1] 70.30643 70.94069 71.66043 71.66962 73.55186 73.66967 74.77823 77.42745
##  [9] 77.86960 83.57073
Nms1 <- featureNames(sample.ExpressionSet)[closeg$"31539_r_at"$indices]
Nms1
##  [1] "31459_i_at"      "31664_at"        "31696_at"        "31370_at"       
##  [5] "31611_s_at"      "31376_at"        "31619_at"        "31470_at"       
##  [9] "31400_at"        "AFFX-TrpnX-3_at"

You could then take these names (from Nms1) and the annotate package and explore them further. See the various HOWTO’s in annotate to see how to further explore your data. Examples include finding and searching all PubMed abstracts associated with these data. Finding and downloading associated sequence information. The data can also be visualized using the geneplotter package (again there are a number of HOWTO documents there).

2 Parameter Settings

The scale parameter can take the following values:

none No scaling is done.

range Scaling is done by \((x_{i} − x_{(1)})/(x_{(n)} − x_{(1)})\).

zscore Scaling is done by \((x_{i} − \bar{x})/s_{x}\). Where sx is the standard deviation.

The method parameter can take the following values:

euclidean Euclidean distance is used.

maximum Maximum distance between any two elements of x and y (supremum norm).

manhattan Absolute distance between the two vectors (1 norm).

canberra The \(\sum(|x_{i} − y_{i}|/|x_{i} + y_{i}|)\). Terms with zero numerator and denominator are omitted from the sum and treated as if the values were missing.

binary (aka asymmetric binary): The vectors are regarded as binary bits, so non-zero elements are on and zero elements are off. The distance is the proportion of bits in which only one is on amongst those in which at least one is on.

3 Session Information

The version number of R and packages loaded for generating the vignette were:

## R Under development (unstable) (2024-01-16 r85808)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 22.04.3 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.19-bioc/R/lib/libRblas.so 
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_GB              LC_COLLATE=C              
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## time zone: America/New_York
## tzcode source: system (glibc)
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] class_7.3-22        genefilter_1.85.1   Biobase_2.63.0     
## [4] BiocGenerics_0.49.1 BiocStyle_2.31.0   
## 
## loaded via a namespace (and not attached):
##  [1] sass_0.4.8              bitops_1.0-7            lattice_0.22-5         
##  [4] RSQLite_2.3.4           digest_0.6.34           grid_4.4.0             
##  [7] evaluate_0.23           bookdown_0.37           fastmap_1.1.1          
## [10] blob_1.2.4              jsonlite_1.8.8          Matrix_1.6-5           
## [13] AnnotationDbi_1.65.2    GenomeInfoDb_1.39.5     DBI_1.2.1              
## [16] survival_3.5-7          BiocManager_1.30.22     httr_1.4.7             
## [19] XML_3.99-0.16           Biostrings_2.71.1       jquerylib_0.1.4        
## [22] cli_3.6.2               rlang_1.1.3             crayon_1.5.2           
## [25] XVector_0.43.1          bit64_4.0.5             splines_4.4.0          
## [28] cachem_1.0.8            yaml_2.3.8              tools_4.4.0            
## [31] memoise_2.0.1           annotate_1.81.1         GenomeInfoDbData_1.2.11
## [34] vctrs_0.6.5             R6_2.5.1                png_0.1-8              
## [37] matrixStats_1.2.0       stats4_4.4.0            lifecycle_1.0.4        
## [40] zlibbioc_1.49.0         KEGGREST_1.43.0         S4Vectors_0.41.3       
## [43] IRanges_2.37.1          bit_4.0.5               bslib_0.6.1            
## [46] xfun_0.41               MatrixGenerics_1.15.0   knitr_1.45             
## [49] xtable_1.8-4            htmltools_0.5.7         rmarkdown_2.25         
## [52] compiler_4.4.0          RCurl_1.98-1.14