processAnnotation: Function to process a set of annotation files given a list of...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/processAnnotations.R

Description

For each file in the list extract all identifiers that belong to each GO or pathway category in the list of identifiers. An identifier “belongs” to a GO or pathway category if it is annotated at the category itself or any of its children in the GO graph.

Usage

1
2
processAnnotation(file.list, AnnotIDlist, data.file.name = NULL, printFiles = FALSE,
	format = c("compact","long"), datafile.ignore.cols = 1, aggregateFun="sum")

Arguments

file.list

A list of files

AnnotIDlist

A list of GO/pathway identifiers

data.file.name

A list containing additional data such as abundance information

printFiles

TRUE/FALSE If true an annotation summary file is generated for each input file

format

One of “compact” by default or or “long”, the format of the annotation files. See details.

datafile.ignore.cols

How many columns in the abundance file to ignore. By default assume the first only, containing identifiers.

aggregateFun

Either "sum" or "product"; the aggregation operation for abundance data

Details

The format is for the GO/pathway files is “compact” by default, meaning a text file containing ID's in the first column, and GO/pathway identifiers in the second, separated by spaces or semicolons. This is the same as the “Wego native format”. A “long” format is also accepted, meaning a text file with two or more columns separated by spaces, containing an identifier, followed by a GO/pathway id, followed optionally by other columns which are ignored. The GO/pathway id's will first be aggregated for each identifier.

Value

A list of the same length as the list of files submitted. Each list element is the result of processGoFile or processPathFile.

Author(s)

D. Pascovici, J.Wu

See Also

processGoFile, processPathFile

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# For GO analysis
# choose two simple GO categories
termList <- c("response to stimulus", "transport")
GOIDmap <- getGoID(termList)
GOIDlist <- names(GOIDmap)


path <- system.file("files", package = "PloGO2")
file.names <- file.path(path, c("00100.txt", "01111.txt", "10000.txt",
	"11111.txt", "Control.txt"))

# summarize annotation
res.list <- processAnnotation(file.names, GOIDlist)

# files in long format
longFormat <- file.path(path,  "goRetOutput.txt")
processAnnotation(longFormat, GOIDlist, format = "long")

# For KEGG pathway analysis
fname <- file.path(path,"PWFiles", "red.txt")
datafile <- file.path(path,"Abundance_data.csv")

AnnotIDlist <- c("osa01100","osa01110","osa01230","osa00300","osa00860")
		
res.list <- processAnnotation(fname, AnnotIDlist,  data.file.name = datafile)

PloGO2 documentation built on Nov. 8, 2020, 5:40 p.m.