Title: | Save and Load Biostrings to/from File |
---|---|
Description: | Save Biostrings objects to file artifacts, and load them back into memory. This is a more portable alternative to serialization of such objects into RDS files. Each artifact is associated with metadata for further interpretation; downstream applications can enrich this metadata with context-specific properties. |
Authors: | Aaron Lun [aut, cre] |
Maintainer: | Aaron Lun <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.5.0 |
Built: | 2024-06-30 02:56:03 UTC |
Source: | https://github.com/bioc/alabaster.string |
Read a XStringSet object from its on-disk representation.
This is usually not directly called by users, but is instead called by dispatch in readObject
.
readXStringSet(path, metadata, ...)
readXStringSet(path, metadata, ...)
path |
String containing a path to a directory, itself created using the |
metadata |
Named list of metadata for this object, see |
... |
Further arguments passed to internal |
An XStringSet subclass containing DNA, RNA, protein or custom sequences. This may also be a QualityScaledDNAStringSet with quality scores.
"saveObject,XStringSet-method"
, to save an XStringSet to disk.
library(Biostrings) stuff <- DNAStringSet(c("AAA", "CC", "G", "TTTT")) tmp <- tempfile() saveObject(stuff, tmp) readObject(tmp)
library(Biostrings) stuff <- DNAStringSet(c("AAA", "CC", "G", "TTTT")) tmp <- tempfile() saveObject(stuff, tmp) readObject(tmp)
Save a XStringSet to its on-disk representation.
## S4 method for signature 'XStringSet' saveObject(x, path, ...)
## S4 method for signature 'XStringSet' saveObject(x, path, ...)
x |
A XStringSet or any of its subclasses such as a QualityScaledXStringSet. |
path |
String containing the path to a directory in which to save |
... |
Further arguments to pass to specific methods. |
The contents of x
are saved into a path
, and NULL
is invisibly returned.
Aaron Lun
readXStringSet
, to read the XStringSet back into the R session.
library(Biostrings) stuff <- DNAStringSet(c("AAA", "CC", "G", "TTTT")) tmp <- tempfile() saveObject(stuff, tmp) list.files(tmp, recursive=TRUE)
library(Biostrings) stuff <- DNAStringSet(c("AAA", "CC", "G", "TTTT")) tmp <- tempfile() saveObject(stuff, tmp) list.files(tmp, recursive=TRUE)