loadGeneLists: Load Gene Lists

Description Usage Arguments Value Author(s) References Examples

View source: R/loadGeneLists.R

Description

Loads gene lists from a file or directory.

Usage

1
loadGeneLists(location, type = "GMT", sep = "\t", header = FALSE, col = 1)

Arguments

location

The location of the GMT file or the directory containing the gene lists.

type

A value indicating whether to load the gene lists from a single GMT file or a directory containing a separate file for each gene list. Acceptable options are "GMT" or "DIR".

sep

The field separator character by which values on each line are separated.

header

A logical value indicating whether the gene list files contain a header that should be ignored. Only applicable when type = "DIR".

col

The column in the gene lists files containing the genes. Only applicable when type = "DIR".

Value

A list of vectors. Each element of the list corresponds to a gene list, and each vector contains the genes in the gene list.

Author(s)

Brian D. Bennett
Pierre R. Bushel

References

Bennett BD and Bushel PR. goSTAG: Gene Ontology Subtrees to Tag and Annotate Genes within a set. Source Code Biol Med. 2017 Apr 13.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
tf <- tempfile()
writeLines( c(  "Gene_List_1\tNA\tGene1\tGene4",
                "Gene_List_2\tNA\tGene2\tGene7\tGene5",
                "Gene_List_3\tNA\tGene4\tGene8" ), tf )
gene_lists <- loadGeneLists( tf )
lapply( head( gene_lists ), head )

td <- tempdir()
unlink( paste( sep="/", td, list.files(td) ) )
writeLines( c( "Gene1", "Gene4" ), paste(sep="/",td,"Gene_List_1.txt") )
writeLines( c( "Gene2", "Gene7", "Gene5" ), paste(sep="/",td,"Gene_List_2.txt") )
writeLines( c( "Gene4", "Gene8" ), paste(sep="/",td,"Gene_List_3.txt") )
gene_lists <- loadGeneLists( td, type = "dir" )
lapply( head( gene_lists ), head )

goSTAG documentation built on May 2, 2018, 3:36 a.m.