DotBracketStringSet-io: Reading and writing DotBracketStringSet objects

Description Usage Arguments Value Examples

Description

readDotBracketStringSet and writeDotBracketStringSet are functions to read and write dot bracket strings from/to file. Since the <> is in conflict with the fasta format, saving to fastq file is sometimes the only option. Saving a string with a <> bracket type to a fasta file will throw an error.

The functions use the underlying Biostrings infrastructure and share most of its parameters. For a more detailed look have a look here.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
readDotBracketStringSet(
  filepath,
  format = "fasta",
  nrec = -1L,
  skip = 0L,
  seek.first.rec = FALSE,
  use.names = TRUE,
  with.qualities = FALSE
)

writeDotBracketStringSet(
  x,
  filepath,
  append = FALSE,
  compress = FALSE,
  format = "fasta",
  ...
)

saveDotBracketStringSet(
  x,
  objname,
  dirpath = ".",
  save.dups = FALSE,
  verbose = TRUE
)

Arguments

filepath

The file name, when writing, or file name(s) when reading.

format

"fasta" or "fastq"

nrec

Single integer. The maximum of number of records to read in. Negative values are ignored.

skip

Single non-negative integer. The number of records of the data file(s) to skip before beginning to read in records.

seek.first.rec, with.qualities, compress, ..., use.names, objname, dirpath, save.dups, verbose

Have a look here.

x

A DotBracketStringSet object

append

TRUE or FALSE. If TRUE output will be appended to file. Otherwise, it will overwrite the contents of file.

Value

readDotBracketStringSet returns a DotBracketStringSet object, writeDotBracketStringSet returns NULL invisibly.

Examples

1
2
3
4
5
6
7
data("dbs", package = "Structstrings")
file <- tempfile()
# works both since a DotBracketStringSet is a BStringSet
writeXStringSet(dbs,file)
writeDotBracketStringSet(dbs,file)
# to return immediatly a DotBracketStringSet us readDotBracketStringSet()
dbs2 <- readDotBracketStringSet(file)

Structstrings documentation built on Dec. 11, 2020, 2:01 a.m.