R/Modstrings-ModStringSet-io.R
ModStringSet-io.Rd
Functions to read/write an ModStringSet object from/to a file.
readModDNAStringSet(
filepath,
format = "fasta",
nrec = -1L,
skip = 0L,
seek.first.rec = FALSE,
use.names = TRUE,
with.qualities = FALSE
)
readModRNAStringSet(
filepath,
format = "fasta",
nrec = -1L,
skip = 0L,
seek.first.rec = FALSE,
use.names = TRUE,
with.qualities = FALSE
)
writeModStringSet(
x,
filepath,
append = FALSE,
compress = FALSE,
compression_level = NA,
format = "fasta",
...
)
See XStringSet-io
for more details.
A ModStringSet
object.
A ModStringSet
of the defined type.
seqs <- paste0(paste(alphabet(ModDNAString()), collapse = ""),
c("A","G","T"))
seqs
#> [1] "ACGTN-+.pδO]DJeg`bU∝πI763218∉⊆⊇Rαmh×f4νX'κo()ηa⇓⇑\"√/≡ζ~A"
#> [2] "ACGTN-+.pδO]DJeg`bU∝πI763218∉⊆⊇Rαmh×f4νX'κo()ηa⇓⇑\"√/≡ζ~G"
#> [3] "ACGTN-+.pδO]DJeg`bU∝πI763218∉⊆⊇Rαmh×f4νX'κo()ηa⇓⇑\"√/≡ζ~T"
set <- ModDNAStringSet(seqs)
set
#> A ModDNAStringSet instance of length 3
#> width seq
#> [1] 56 ACGTN-+.pδO]DJeg`bU∝πI763218∉⊆⊇Rαmh×f4νX'κo()ηa⇓⇑"√/≡ζ~A
#> [2] 56 ACGTN-+.pδO]DJeg`bU∝πI763218∉⊆⊇Rαmh×f4νX'κo()ηa⇓⇑"√/≡ζ~G
#> [3] 56 ACGTN-+.pδO]DJeg`bU∝πI763218∉⊆⊇Rαmh×f4νX'κo()ηa⇓⇑"√/≡ζ~T
file <- tempfile()
writeModStringSet(set, file)
read <- readModDNAStringSet(file)
read
#> A ModDNAStringSet instance of length 3
#> width seq names
#> [1] 56 ACGTN-+.pδO]DJeg`bU∝πI7...mh×f4νX'κo()ηa⇓⇑"√/≡ζ~A
#> [2] 56 ACGTN-+.pδO]DJeg`bU∝πI7...mh×f4νX'κo()ηa⇓⇑"√/≡ζ~G
#> [3] 56 ACGTN-+.pδO]DJeg`bU∝πI7...mh×f4νX'κo()ηa⇓⇑"√/≡ζ~T