Title: | Base Class and Methods for 'gson' Format |
---|---|
Description: | Proposes a new file format ('gson') for storing gene set and related information, and provides read, write and other utilities to process this file format. |
Authors: | Guangchuang Yu [aut, cre, cph] |
Maintainer: | Guangchuang Yu <[email protected]> |
License: | Artistic-2.0 |
Version: | 0.1.0 |
Built: | 2024-10-30 02:43:57 UTC |
Source: | https://github.com/cran/gson |
construct a 'GSON' object
gson( gsid2gene, gsid2name = NULL, gene2name = NULL, species = NULL, gsname = NULL, version = NULL, accessed_date = NULL, keytype = NULL, info = NULL )
gson( gsid2gene, gsid2name = NULL, gene2name = NULL, species = NULL, gsname = NULL, version = NULL, accessed_date = NULL, keytype = NULL, info = NULL )
gsid2gene |
A data frame with first column of gene set IDs and second column of genes |
gsid2name |
A data frame with first column of gene set IDs and second column of gene set names |
gene2name |
A data frame with first column of genes and second column of gene symbols |
species |
Which species of the genes belongs to |
gsname |
Name of the gene set (e.g., GO, KEGG, etc.) |
version |
version of the gene set |
accessed_date |
date to obtain the gene set data |
keytype |
keytype of genes |
info |
extra information |
A 'GSON' instance
wpfile <- system.file('extdata', "wikipathways-20220310-gmt-Homo_sapiens.gmt", package='gson') x <- read.gmt.wp(wpfile) gsid2gene <- data.frame(gsid=x$wpid, gene=x$gene) gsid2name <- unique(data.frame(gsid=x$wpid, name=x$name)) species <- unique(x$species) version <- unique(x$version) gson(gsid2gene=gsid2gene, gsid2name=gsid2name, species=species, version=version)
wpfile <- system.file('extdata', "wikipathways-20220310-gmt-Homo_sapiens.gmt", package='gson') x <- read.gmt.wp(wpfile) gsid2gene <- data.frame(gsid=x$wpid, gene=x$gene) gsid2name <- unique(data.frame(gsid=x$wpid, name=x$name)) species <- unique(x$species) version <- unique(x$version) gson(gsid2gene=gsid2gene, gsid2name=gsid2name, species=species, version=version)
Class "GSON" This class represents gene set information.
gsid2gene
data.frame with two columns of 'gsid' and 'gene'
gsid2name
data.frame with two columns of 'gsid' and 'name'
gene2name
data.frame with two columns of 'gene' and 'name'
species
species of the annotation
gsname
gene set name, e.g., GO, KEGG
version
version of the gene set
accessed_date
time to obtain the gene set data
keytype
keytype of genes
info
extra information
Guangchuang Yu https://yulab-smu.top
construct a 'GSONList' object
gsonList(...)
gsonList(...)
... |
input GSON objects |
A 'GSONList' instance
parse gmt file to a data.frame
read.gmt(gmtfile) read.gmt.wp(gmtfile, output = "data.frame")
read.gmt(gmtfile) read.gmt.wp(gmtfile, output = "data.frame")
gmtfile |
gmt file |
output |
one of 'data.frame' or 'GSON' |
data.frame
Guangchuang Yu
read and write gson file
read.gson(file) write.gson(x, file = "")
read.gson(file) write.gson(x, file = "")
file |
A gson file |
x |
A |
A GSON
instance
wpfile <- system.file('extdata', "wikipathways-20220310-gmt-Homo_sapiens.gmt", package='gson') x <- read.gmt.wp(wpfile, output = "GSON") f = tempfile(fileext = '.gson') write.gson(x, f) read.gson(f)
wpfile <- system.file('extdata', "wikipathways-20220310-gmt-Homo_sapiens.gmt", package='gson') x <- read.gmt.wp(wpfile, output = "GSON") f = tempfile(fileext = '.gson') write.gson(x, f) read.gson(f)
show method for GSON
instance
show(object)
show(object)
object |
A |
message
Guangchuang Yu https://yulab-smu.top