From 8839fc1227b9054c0a22b387d07f2ce61cfe7346 Mon Sep 17 00:00:00 2001 From: Kdreval Date: Fri, 15 Mar 2024 09:34:34 -0700 Subject: [PATCH] pr comments: improve documentation --- R/bins_to_bedgraph.R | 6 +++--- R/cache_output.R | 3 ++- R/calculate_tmb.R | 2 +- R/copy_no_clobber.R | 3 ++- man/bins_to_bedgraph.Rd | 2 +- man/cache_output.Rd | 2 +- man/calculate_tmb.Rd | 2 +- man/copy_no_clobber.Rd | 2 +- 8 files changed, 12 insertions(+), 10 deletions(-) diff --git a/R/bins_to_bedgraph.R b/R/bins_to_bedgraph.R index 97ac777..7a520e3 100644 --- a/R/bins_to_bedgraph.R +++ b/R/bins_to_bedgraph.R @@ -6,7 +6,7 @@ #' @param min_value Minimum value to retain the bin. #' @param filename Path to a local file on drive to save the resulting file. #' -#' @return file +#' @return full path to the file that was written #' #' @export bins_to_bedgraph = function(bin_df,min_value = 3,filename = "test.bed"){ @@ -17,8 +17,8 @@ bins_to_bedgraph = function(bin_df,min_value = 3,filename = "test.bed"){ bed_cols = mutate(bed_cols,chr = paste0("chr",chr)) } bed_cols = dplyr::filter(bed_cols,value > min_value) - this = dplyr::filter(chr1p,bin_start==27985000) + this = dplyr::filter(chr1p,bin_start==27985000) bed_cols = mutate(bed_cols,end=format(end, scientific=F),start=format(start, scientific=F)) write.table(bed_cols,row.names=F,col.names=F,quote=F,sep="\t",file=filename) - + return(filename) } diff --git a/R/cache_output.R b/R/cache_output.R index 92b576e..64bc573 100644 --- a/R/cache_output.R +++ b/R/cache_output.R @@ -9,7 +9,7 @@ #' @param function_params TODO. #' @param additional_details TODO. #' -#' @return file +#' @return full path to the file that was written #' #' @export cache_output = function(result_df, @@ -44,4 +44,5 @@ cache_output = function(result_df, message(paste("creating/overwriting",cache_file_name)) write_tsv(result_df,file=cache_file_name) + return(cache_file_name) } diff --git a/R/calculate_tmb.R b/R/calculate_tmb.R index 0d61faf..ebda2ed 100644 --- a/R/calculate_tmb.R +++ b/R/calculate_tmb.R @@ -1,4 +1,4 @@ -#' @title Return TMB counts. +#' @title Calculate tumour mutation burden. #' #' @description This function implements tumor mutation burden calculation. #' TODO: add more details. diff --git a/R/copy_no_clobber.R b/R/copy_no_clobber.R index e15e43b..8750b83 100644 --- a/R/copy_no_clobber.R +++ b/R/copy_no_clobber.R @@ -6,7 +6,7 @@ #' @param to_file TODO. #' @param force TODO. #' -#' @return file +#' @return full path to the file that was written #' #' @export copy_no_clobber = function(from_file, @@ -19,4 +19,5 @@ copy_no_clobber = function(from_file, if(force){ file.copy(from_file,to_file) } + return(to_file) } diff --git a/man/bins_to_bedgraph.Rd b/man/bins_to_bedgraph.Rd index 5a94d39..97c05ce 100644 --- a/man/bins_to_bedgraph.Rd +++ b/man/bins_to_bedgraph.Rd @@ -14,7 +14,7 @@ bins_to_bedgraph(bin_df, min_value = 3, filename = "test.bed") \item{filename}{Path to a local file on drive to save the resulting file.} } \value{ -file +full path to the file that was written } \description{ This function will generate bed file. diff --git a/man/cache_output.Rd b/man/cache_output.Rd index 5176b2c..c772f23 100644 --- a/man/cache_output.Rd +++ b/man/cache_output.Rd @@ -28,7 +28,7 @@ cache_output( \item{additional_details}{TODO.} } \value{ -file +full path to the file that was written } \description{ TODO. diff --git a/man/calculate_tmb.Rd b/man/calculate_tmb.Rd index 77f6563..9dca146 100644 --- a/man/calculate_tmb.Rd +++ b/man/calculate_tmb.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/calculate_tmb.R \name{calculate_tmb} \alias{calculate_tmb} -\title{Return TMB counts.} +\title{Calculate tumour mutation burden.} \usage{ calculate_tmb( maf_data, diff --git a/man/copy_no_clobber.Rd b/man/copy_no_clobber.Rd index 1f3132a..af22267 100644 --- a/man/copy_no_clobber.Rd +++ b/man/copy_no_clobber.Rd @@ -14,7 +14,7 @@ copy_no_clobber(from_file, to_file, force = FALSE) \item{force}{TODO.} } \value{ -file +full path to the file that was written } \description{ TODO.