R/pred2tsv.R

Defines functions pred2tsv

Documented in pred2tsv

#' @title Format LTR prediction data to TSV file format
#' @description This function formats the LTR prediction \code{\link{data.frame}}
#' generated by \code{\link{LTRharvest}}, \code{\link{LTRdigest}}, or \code{\link{LTRpred}}
#' to a \code{\link{data.frame}} in \code{CSV} file format.
#' @param LTR.data the LTR prediction \code{\link{data.frame}}
#' generated by \code{\link{LTRharvest}}, \code{\link{LTRdigest}}, or \code{\link{LTRpred}}.
#' @param output filename of the output CSV file.
#' @author Hajk-Georg Drost
#' @examples 
#' gff.file <- system.file("TAIR10_chr_all_LTRdigestPrediction.gff",
#'                         package = "LTRpred")
#' tabout.file <- system.file("TAIR10_chr_all-ltrdigest_tabout.csv"
#'                            ,package = "LTRpred")
#' LTRfile <- read.prediction(gff.file,tabout.file, program = "LTRdigest")
#' 
#' # generate csv file
#' pred2csv(LTRfile$ltr.retrotransposon)
#' @return the \code{LTR.data} table in csv format saved to the hard drive.
#' @export
pred2tsv <- function(LTR.data, output = "output.tsv"){
    utils::write.table(LTR.data,output, sep = "\t", quote = FALSE, col.names = TRUE, row.names = FALSE)
}
HajkD/LTRpred documentation built on April 22, 2022, 4:35 p.m.