From 51da42621ed0983a2b90fc352b00be8107bc5dad Mon Sep 17 00:00:00 2001 From: Mangiola Laboratory Date: Fri, 5 Apr 2024 16:58:59 +1030 Subject: [PATCH 1/2] Improve error message --- R/utilities.R | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/R/utilities.R b/R/utilities.R index 4d7f3a1a..ba7bb7e2 100755 --- a/R/utilities.R +++ b/R/utilities.R @@ -42,9 +42,9 @@ as_data_frame <- function(tbl, my_stop = function() { stop(" - You should call tidybulk library *after* tidyverse libraries. tidybulk says: The function does not know what your sample, transcript and counts columns are. - You have to either enter those as arguments, or use the function tidybulk() to pass your column names that will be remembered. + You might need to specify the arguments .sample, .transcript and/or .abundance. + Read the documentation of this function for more information. ") } @@ -590,9 +590,9 @@ get_transcript = function(.data, .transcript){ my_stop = function() { stop(" - tidybulk says: The function does not know what your transcript, transcript and counts columns are.\n - You have to either enter those as symbols (e.g., `transcript`), \n - or use the function create_tt_from_tibble() to pass your column names that will be remembered. + tidybulk says: The function does not know what your sample, transcript and counts columns are. + You might need to specify the arguments .sample, .transcript and/or .abundance. + Read the documentation of this function for more information. ") } @@ -706,9 +706,9 @@ get_elements_features = function(.data, .element, .feature, of_samples = TRUE){ # Else through error else stop(" - tidybulk says: The function does not know what your elements (e.g., sample) and features (e.g., transcripts) are.\n - You have to either enter those as symbols (e.g., `sample`), \n - or use the function create_tt_from_tibble() to pass your column names that will be remembered. + tidybulk says: The function does not know what your sample, transcript and counts columns are. + You might need to specify the arguments .sample, .transcript and/or .abundance + Read the documentation of this function for more information. ") } } @@ -733,9 +733,9 @@ get_elements_features_abundance = function(.data, .element, .feature, .abundance my_stop = function() { stop(" - tidybulk says: The function does not know what your elements (e.g., sample) and features (e.g., transcripts) are.\n - You have to either enter those as symbols (e.g., `sample`), \n - or use the function create_tt_from_tibble() to pass your column names that will be remembered. + tidybulk says: The function does not know what your sample, transcript and counts columns are. + You might need to specify the arguments .sample, .transcript and/or .abundance + Read the documentation of this function for more information. ") } @@ -799,9 +799,9 @@ get_elements = function(.data, .element, of_samples = TRUE){ # Else through error else stop(" - tidybulk says: The function does not know what your elements (e.g., sample) are.\n - You have to either enter those as symbols (e.g., `sample`), \n - or use the function create_tt_from_tibble() to pass your column names that will be remembered. + tidybulk says: The function does not know what your sample, transcript and counts columns are. + You might need to specify the arguments .sample, .transcript and/or .abundance. + Read the documentation of this function for more information. ") } } @@ -846,9 +846,9 @@ get_abundance_norm_if_exists = function(.data, .abundance){ # Else through error else stop(" - tidybulk says: The function does not know what your elements (e.g., sample) are.\n - You have to either enter those as symbols (e.g., `sample`), \n - or use the function create_tt_from_tibble() to pass your column names that will be remembered. + tidybulk says: The function does not know what your sample, transcript and counts columns are. + You might need to specify the arguments .sample, .transcript and/or .abundance. + Read the documentation of this function for more information. ") } } From 657280d8fcc4cf90a3d209f2cf16040b25d45f21 Mon Sep 17 00:00:00 2001 From: Mangiola Laboratory Date: Fri, 5 Apr 2024 17:01:47 +1030 Subject: [PATCH 2/2] Update utilities.R --- R/utilities.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/R/utilities.R b/R/utilities.R index ba7bb7e2..ad09fc19 100755 --- a/R/utilities.R +++ b/R/utilities.R @@ -44,7 +44,7 @@ my_stop = function() { stop(" tidybulk says: The function does not know what your sample, transcript and counts columns are. You might need to specify the arguments .sample, .transcript and/or .abundance. - Read the documentation of this function for more information. + Please read the documentation of this function for more information. ") } @@ -592,7 +592,7 @@ get_transcript = function(.data, .transcript){ stop(" tidybulk says: The function does not know what your sample, transcript and counts columns are. You might need to specify the arguments .sample, .transcript and/or .abundance. - Read the documentation of this function for more information. + Please read the documentation of this function for more information. ") } @@ -708,7 +708,7 @@ get_elements_features = function(.data, .element, .feature, of_samples = TRUE){ stop(" tidybulk says: The function does not know what your sample, transcript and counts columns are. You might need to specify the arguments .sample, .transcript and/or .abundance - Read the documentation of this function for more information. + Please read the documentation of this function for more information. ") } } @@ -735,7 +735,7 @@ get_elements_features_abundance = function(.data, .element, .feature, .abundance stop(" tidybulk says: The function does not know what your sample, transcript and counts columns are. You might need to specify the arguments .sample, .transcript and/or .abundance - Read the documentation of this function for more information. + Please read the documentation of this function for more information. ") } @@ -801,7 +801,7 @@ get_elements = function(.data, .element, of_samples = TRUE){ stop(" tidybulk says: The function does not know what your sample, transcript and counts columns are. You might need to specify the arguments .sample, .transcript and/or .abundance. - Read the documentation of this function for more information. + Please read the documentation of this function for more information. ") } } @@ -848,7 +848,7 @@ get_abundance_norm_if_exists = function(.data, .abundance){ stop(" tidybulk says: The function does not know what your sample, transcript and counts columns are. You might need to specify the arguments .sample, .transcript and/or .abundance. - Read the documentation of this function for more information. + Please read the documentation of this function for more information. ") } }