From 7df8bb423c9b8fd87d70e1394e22ee3e8d6bbcea Mon Sep 17 00:00:00 2001 From: Danielle Callan Date: Mon, 15 Apr 2024 12:52:29 -0400 Subject: [PATCH 1/2] add region to 16s collection names --- R/internal-utils.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/internal-utils.R b/R/internal-utils.R index 7dfbc3c..c62e7cd 100644 --- a/R/internal-utils.R +++ b/R/internal-utils.R @@ -117,7 +117,7 @@ findCollectionDataColumns <- function(dataColNames, collectionId) { #' @export getCollectionName <- function(collectionId, dataSourceName, ontology = NULL) { if (grepl("16S", dataSourceName, fixed=TRUE)) { - dataSourceName <- "16S" + dataSourceName <- paste("16S", regmatches(dataSourceName,regexpr("(\\(.*?)\\)",dataSourceName))) } if (grepl("Metagenomic", dataSourceName, fixed=TRUE)) { From fb56c664f122e78120b685c9a77884880610718a Mon Sep 17 00:00:00 2001 From: Danielle Callan Date: Tue, 16 Apr 2024 10:04:47 -0400 Subject: [PATCH 2/2] improve finding id cols --- R/internal-utils.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/internal-utils.R b/R/internal-utils.R index c62e7cd..59c4a55 100644 --- a/R/internal-utils.R +++ b/R/internal-utils.R @@ -32,14 +32,14 @@ findCollectionIds <- function(dataColNames) { #' @export findRecordIdColumn <- function(dataColNames) { # for now assume were working w bulk download files, which means its the first column - allIdColumns <- dataColNames[grepl("_Id", dataColNames, fixed=TRUE)] + allIdColumns <- dataColNames[grepl("_Id$", dataColNames)] return(allIdColumns[1]) } #' @export findAncestorIdColumns <- function(dataColNames) { # for now assume were working w bulk download files, which means they have '_Id' - allIdColumns <- dataColNames[grepl("_Id", dataColNames, fixed=TRUE)] + allIdColumns <- dataColNames[grepl("_Id$", dataColNames)] if (length(allIdColumns) == 1) { return(character(0)) }