runRNAsubopt: Run RNAsubopt in R

View source: R/Structure.R

runRNAsuboptR Documentation

Run RNAsubopt in R

Description

This function can run and capture the result of RNAsubopt (ViennaRNA Package) in R by invoking the OS command. The results can be formatted and used as the features of tool "catRAPID", "lncPro", etc. ViennaRNA Package is required (http://www.tbi.univie.ac.at/RNA/index.html).

Usage

runRNAsubopt(
  seqs,
  structureRNA.num = 6,
  args.RNAsubopt = NULL,
  path.RNAsubopt = "RNAsubopt",
  returnSum = FALSE,
  verbose = FALSE,
  parallel.cores = 2,
  cl = NULL
)

Arguments

seqs

RNA sequences loaded by function read.fasta from seqinr-package. Or a list of RNA/protein sequences. RNA sequences will be converted into lower case letters. Each sequence should be a vector of single characters.

structureRNA.num

integer. Number of random samples of suboptimal structures. Default: 6.

args.RNAsubopt

string (in format such as "-N –pfScale 1.07") specifying additional arguments (except "-p" which is already determined by structureRNA.num) for RNAsubopt. This is used when you want to control the behaviour of RNAsubopt. Arguments for RNAsubopt please refer to its manual. Default: NULL.

path.RNAsubopt

string specifying the location of RNAsubopt program.

returnSum

logical. If FALSE, the raw output of RNAsubopt (Dot-Bracket Notation of RNA structure) will be returned. If TRUE, the results of RNAsubopt will be converted into numeric sequence: In any RNA structure sequence (Dot-Bracket Notation), "." (Dot) will be replaced with 0; "(" and ")" (Bracket) will be replaced with 1. And structureRNA.num binary sequences will be added to obtain a new numeric sequence.

verbose

logical. Should the relevant information be printed during the calculation? (Only available on UNIX/Linux.)

parallel.cores

an integer that indicates the number of cores for parallel computation. Default: 2. Set parallel.cores = -1 to run with all the cores. parallel.cores should be == -1 or >= 1.

cl

parallel cores to be passed to this function.

Details

This function depends on the program "RNAsubopt" of software "ViennaRNA". (http://www.tbi.univie.ac.at/RNA/index.html)

Parameter path.RNAsubopt can be simply defined as "RNAsubopt" as default when the OS is UNIX/Linux. However, for some OS, such as Windows, users need to specify the path.RNAsubopt if the path of "RNAsubopt" haven't been added in environment variables (e.g. path.RNAsubopt = '"C:/Program Files/ViennaRNA/RNAsubopt.exe"').

This function can print the related information when running on Linux OS, such as:

"25 of 100, length: 695 nt",

which means around 100 sequences are assigned to this node, and the program is now computing the 25th sequence. The length of this sequence is 695 nt.

Value

This function returns a data frame that contains the raw outputs when returnSum = FALSE. Or a list of numeric results of RNAsubopt when returnSum = TRUE.

References

Lorenz R, Bernhart SH, Honer zu Siederdissen C, et al. ViennaRNA Package 2.0. Algorithms Mol. Biol. 2011; 6:26

See Also

runPredator

Examples



data(demoPositiveSeq)
seqsRNA <- demoPositiveSeq$RNA.positive

path.RNAsubopt <- "RNAsubopt" # you need to use your own paths, for example:
# path.RNAsubopt <- '"C:/Program Files (x86)/ViennaRNA Package/RNAsubopt.exe"' # in Windows OS

RNAsubopt_1 <- runRNAsubopt(seqs = seqsRNA, path.RNAsubopt = path.RNAsubopt,
                            returnSum = FALSE, verbose = TRUE,
                            parallel.cores = 2)

RNAsubopt_2 <- runRNAsubopt(seqs = seqsRNA, args.RNAsubopt = "--pfScale 1.07",
                            structureRNA.num = 6,
                            path.RNAsubopt = path.RNAsubopt,
                            returnSum = TRUE, parallel.cores = 2)


HAN-Siyu/ncProR documentation built on Nov. 3, 2023, 12:08 a.m.