io: Import and export

Description Usage Arguments Value Coercion to Sets Author(s) Examples

Description

The functions import and export load and save objects from and to particular file formats. The unisets package aims to implement support for a number of annotation and sequence formats. The following file formats are currently supported: GMT.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
GMTFile(resource)

import.gmt(con, ...)

## S4 method for signature 'GMTFile,ANY,ANY'
import(con, format, text, ...)

export.gmt(object, con, ...)

## S4 method for signature 'Sets,GMTFile,ANY'
export(object, con, format, ...)

import.Go3AnnDbBimap(con, format, text, ...)

## S4 method for signature 'Go3AnnDbBimap,ANY,ANY'
import(con, format, text, ...)

Arguments

resource

For GMTFile(), the .gmt file that will be imported in.

con

The connection from which data is loaded or to which data is saved. If this is a character vector, it is assumed to be a filename and a corresponding file connection is created and then closed after exporting the object. If a RTLFile derivative, the data is loaded from or saved to the underlying resource. Certain subclasses of BiMap are supported: Go3AnnDbBimap.

...

Parameters to pass to the format-specific method.

format, text

Arguments defined in the rtracklayer::import() generic. Currently ignored.

object

An object of class inheriting from GMTFile.

Go3AnnDbBimap

A Go3AnnDbBimap.

Value

For GMTFile(), an object representing the path to a .gmt file on disk

Coercion to Sets

as(Go3AnnDbBimap, "Sets") and as.Sets(Go3AnnDbBimap) return a Sets from a Gene Ontology Bimap stored distributed in a Bioconductor annotation package.

Author(s)

Robert A. Amezquita

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Example file ----

gmt <- system.file(package="unisets", "extdata", "example.gmt")

# Import ----

bs <- import(gmt)
bs

# Export ----

tf <- tempfile(fileext = ".gmt")
export(bs, tf)

# Import (Go3AnnDbBimap) ----

library(org.Hs.eg.db)
bs1 <- import(org.Hs.egGO)
bs1

kevinrue/unisets documentation built on May 15, 2020, 10:48 p.m.