Learn R Programming

cubfits (version 0.1-2)

Coverting Utility: Convert Data Frame to Other Formats

Description

These utility functions convert data of format divided by amino acids into list of format divided by ORFs, or convert data to other formats.

Usage

convert.reu13.df.to.list(reu13.df) convert.y.to.list(y) convert.n.to.list(n)
convert.y.to.scuo(y) convert.seq.data.to.string(seq.data)
codon.low2up(x) codon.up2low(x)
dna.low2up(x) dna.up2low(x)
convert.b.to.bVec(b) convert.bVec.to.b(bVec, aa.names, model = .CF.CT$model[1])

Arguments

reu13.df
a list of reu13.df data frames divided by amino acids.
y
a list of y data frames divided by amino acids.
n
a list of n vectors divided by amino acids.
seq.data
a vector of seq.data format.
x
a codon or dna string, such "ACG", "acg", or "A", "a".
b
a b object.
bVec
a bVec object.
aa.names
a vector contains amino acid names for analysis.
model
model fitted.

Value

All functions return the corresponding formats.

Details

convert.reu13.df.to.list(), convert.y.to.list(), and convert.n.to.list(): these utility functions take the inputs divided by amino acids and return the outputs divided by ORFs.

convert.y.scuo() converts y into scuo format.

convert.seq.data.to.string() converts seq.data into seq.string format.

codon.low2up() and codon.up2low() convert codon strings between lower or upper cases.

convert.bVec.to.b() and convert.b.to.bVec() convert objects b and bVec.

References

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

See Also

AllDataFormats, rearrange.n(), rearrange.reu13.df(), rearrange.y(), and read.seq().

Examples

Run this code
## Not run: 
# suppressMessages(library(cubfits, quietly = TRUE))
# 
# reu13.list <- convert.reu13.df.to.list(ex.train$reu13.df)
# y.list <- convert.y.to.list(ex.train$y)
# n.list <- convert.n.to.list(ex.train$n)
# 
# scuo <- convert.y.to.scuo(ex.train$y)
# 
# seq.data <- read.seq(get.expath("seq_200.fasta"))
# seq.string <- convert.seq.data.to.string(seq.data)
# 
# codon.low2up("acg")
# codon.up2low("ACG")
# 
# dna.low2up(c("a", "c", "g"))
# dna.up2low(c("A", "C", "G"))
# ## End(Not run)

Run the code above in your browser using DataLab