readGAF: Read a Gene Ontology annotation file

Description Usage Arguments Details Value References See Also Examples

View source: R/MgsaGoSets-class.R

Description

Creates a MgsaGoSets using gene ontology annotations provided by a file in GAF 1.0 or 2.0 format.

Usage

1
readGAF(filename, evidence=NULL, aspect=c("P", "F", "C"))

Arguments

filename

The name of the Gene Ontology annotation file. It must be in the GAF 1.0 or 2.0 format. It may be gzip-compressed.

evidence

character or NULL. Only annotations with evidence code in evidence are returned. If NULL (default), annotations of all evidence codes are returned.

aspect

character with values in P, C or F. Only annotations of the listed GO namespaces P (biological process), F (molecular function) or C (cellular component) are returned. By default, annotations of the three namespaces are returned.

Details

The function extracts from the annotation file all direct gene annotations and infers from the Gene Ontology all the indirect annotations (due to term relationships). This is done using the package Go.db which provides the ontology as a database and RSQLite for querying the database.

Value

An MgsaGoSets object.

References

The Gene Ontology Consortium. Gene Ontology: tool for the unification of biology. Nature Genetics, 2000. The GAF file format: http://www.geneontology.org/GO.format.annotation.shtml GO evidence codes: http://www.geneontology.org/GO.evidence.shtml

See Also

MgsaGoSets, mgsa

Examples

1
2
3
4
5
## parsing provided example file (yeast)
gofile = system.file("example_files/gene_association_head.sgd", package="mgsa")
readGAF(gofile)
## only annoations infered from experiment or a direct assay
readGAF(gofile, evidence=c("EXP", "IDA"))

Example output

Loading required package: gplots

Attaching package: 'gplots'

The following object is masked from 'package:stats':

    lowess

Loading required package: GO.db
Loading required package: AnnotationDbi
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, basename, cbind, colMeans, colSums, colnames,
    dirname, do.call, duplicated, eval, evalq, get, grep, grepl,
    intersect, is.unsorted, lapply, lengths, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind,
    rowMeans, rowSums, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which, which.max, which.min

Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: IRanges
Loading required package: S4Vectors

Attaching package: 'S4Vectors'

The following object is masked from 'package:gplots':

    space

The following object is masked from 'package:base':

    expand.grid


Loading required package: RSQLite
Loading required package: DBI
Object of class MgsaGoSets
138 sets over 3 unique items.

Set annotations:
                                        term                        definition
GO:0000295 adenine nucleotide transmembra... Catalysis of the transfer of a...
GO:0000313               organellar ribosome A ribosome contained within a ...
GO:0000314 organellar small ribosomal sub... The smaller of the two subunit...
GO:0000315 organellar large ribosomal sub... The larger of the two subunits...
GO:0003674                molecular_function Elemental activities, such as ...
... and  133  other sets.

Item annotations:
             symbol                              name
S000004660     AAC1 Mitochondrial inner membrane A...
S000007287 15S_RRNA Ribosomal RNA of the small mit...
S000007288 21S_RRNA            Mitochondrial 21S rRNA
Warning messages:
1: RSQLite: Passing numeric values to row.names is deprecated. Pass a logical or a column name. 
2: In result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
3: In result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Object of class MgsaGoSets
55 sets over 2 unique items.

Set annotations:
                                        term                        definition
GO:0000295 adenine nucleotide transmembra... Catalysis of the transfer of a...
GO:0000313               organellar ribosome A ribosome contained within a ...
GO:0000315 organellar large ribosomal sub... The larger of the two subunits...
GO:0003674                molecular_function Elemental activities, such as ...
GO:0005215              transporter activity Enables the directed movement ...
... and  50  other sets.

Item annotations:
             symbol                              name
S000004660     AAC1 Mitochondrial inner membrane A...
S000007288 21S_RRNA            Mitochondrial 21S rRNA
Warning messages:
1: In result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
2: In result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries

mgsa documentation built on Nov. 8, 2020, 7:54 p.m.