u0_io: Input and Output Utility

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

These utility functions read and write data of FASTA and phi.df formats.

Usage

1
2
3
4
5
6
7
  read.seq(file.name, forceDNAtolower = FALSE, convertDNAtoupper = TRUE)
  write.seq(seq.data, file.name)

  read.phi.df(file.name, header = TRUE, sep = "\t", quote = "")
  write.phi.df(phi.df, file.name)

  get.expath(file.name, path.root = "./ex_data/", pkg = "cubfits")

Arguments

file.name

a file name to read or write.

forceDNAtolower

an option passed to read.fasta() of seqinr package.

convertDNAtoupper

force everything in upper case.

header

an option passed to read.table().

sep

an option passed to read.table().

quote

an option passed to read.table().

seq.data

a seq.data object.

phi.df

a phi.df object.

path.root

root path for the file name relatively to the pkg.

pkg

package name for the path of root.

Details

read.seq() and write.seq() typically read and write FASTA files (DNA ORFs or sequences).

read.phi.df() and write.phi.df() typically read and write phi.df files (expression values of ORFs or sequences).

get.expath() is only for demonstration returning a full path to the file.

Value

read.seq() returns an object of seq.data format which can be converted to seq.string format later via convert.seq.data.to.string().

read.phi.df() returns an object of phi.df format which contains expression values.

Author(s)

Wei-Chen Chen wccsnow@gmail.com.

References

https://github.com/snoweye/cubfits/

See Also

convert.seq.data.to.string().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
suppressMessages(library(cubfits, quietly = TRUE))

seq.data <- read.seq(get.expath("seq_200.fasta"))
phi.df <- read.phi.df(get.expath("phi_200.tsv"))
aa.names <- c("A", "C", "D")

# Read in from FASTA file.
seq.string <- convert.seq.data.to.string(seq.data)

## End(Not run)

Example output

Loading required package: coda
Loading required package: foreach
Loading required package: parallel

cubfits documentation built on Nov. 8, 2021, 1:07 a.m.