R/processAnnotations.R

Defines functions processAnnotation

Documented in processAnnotation

processAnnotation <- function(file.list, AnnotIDlist, data.file.name = NULL, 
	printFiles = FALSE, format=c("compact","long"), datafile.ignore.cols=1,
	aggregateFun="sum") 
  
  {
  format <- match.arg(format)
	annotation.list <- lapply(file.list, FUN = function(fname) {
	  
	  if(length(grep("^GO:", AnnotIDlist)) == length(AnnotIDlist)) {
	    res <- processGoFile(fname, AnnotIDlist, data.file.name, format=format, 
	                         datafile.ignore.cols=datafile.ignore.cols,
	                         aggregateFun=aggregateFun)
  	
	  } else {
	    res <- processPathFile(fname, AnnotIDlist, data.file.name, format=format, 
	                           datafile.ignore.cols=datafile.ignore.cols,
	                           aggregateFun=aggregateFun)
	  }

	  fout <- basename(fname)

		if (printFiles)
			writeGOannot(res, fname = paste("Annot", fout), datafile = data.file.name)

		res
	})

	names(annotation.list) <- basename(file.list)

	annotation.list
}

Try the PloGO2 package in your browser

Any scripts or data that you put into this service are public.

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