phsc.read.subtrees: Read subtree information

View source: R/phyloscan.fun.private.R

phsc.read.subtreesR Documentation

Read subtree information

Description

This function reads the subtree information that is generated with the phyloscanner toolkit.

Usage

phsc.read.subtrees(
  prefix.infiles,
  prefix.run = "ptyr",
  regexpr.subtrees = "Subtrees_r_.*\\.rda$",
  prefix.wfrom = "Window_",
  prefix.wto = "Window_[0-9]+_to_",
  save.file = NA,
  resume = FALSE,
  zip = FALSE
)

Arguments

prefix.infiles

Full path name that identifies subtree files

prefix.run

Character string to identify separate phyloscanner runs. After the prefix, an integer number is expected. For example, if prefix.run='ptyr', then files are expected to start like 'ptyr123_'.

regexpr.subtrees

Regular expression that identifies subtree files in the directory. By default, this is 'Subtrees_r_.*\.rda$' or 'Subtrees_c_.*\.rda$' from the phyloscanner toolkit.

prefix.wfrom

Character string to identify the start of a short read window. After the prefix, an integer number is expected. For example, if prefix.wfrom='Window_', then 'Window_800_to_1100' has start coordinate 800.

prefix.wto

Character string to identify the end of a short read window. After the prefix, an integer number is expected. For example, if prefix.wto='Window_[0-9]+_to_', then 'Window_800_to_1100' has end coordinate 1100.

save.file

If not missing, function output (a data.table) will be stored to 'save.file', input files will be zipped, and input files will be deleted.

resume

If TRUE and save.file is not missing, the function loads and returns subtree info stored in save.file.

zip

If TRUE and save.file is not missing, the function zips and removes subtree files that match the regular expression for subtrees.

Value

data.table with columns PTY_RUN W_FROM W_TO orig.patients patient.splits tip.names.


olli0601/Phyloscanner.R.utilities documentation built on May 6, 2024, 8:11 p.m.