Skip to content

how to prepare your own geneList

ControlCcolon edited this page Apr 30, 2019 · 2 revisions

geneList contains three features:

  1. numeric vector: fold change or other type of numerical variable
  2. named vector: every number has a name, the corresponding gene ID
  3. sorted vector: number should be sorted in decreasing order

If you import your data from a csv file, the file should contains two columns, one for gene ID (no duplicated ID allowed) and another one for fold change.

d = read.csv(your_csv_file)
## assume 1st column is ID
## 2nd column is FC

## feature 1: numeric vector
geneList = d[,2]
## feature 2: named vector
names(geneList) = as.character(d[,1])
## feature 3: decreasing orde
geneList = sort(geneList, decreasing = TRUE)