From 93b92974acfd130bca55b6a145e59e85d2b267d2 Mon Sep 17 00:00:00 2001 From: jeffersonfparil Date: Mon, 3 Jun 2024 11:40:13 +1000 Subject: [PATCH] using case-insensitive grep to validate allele freq tsv file header instead of exact matches --- R/load.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/R/load.R b/R/load.R index 8194f3e..bfd746b 100644 --- a/R/load.R +++ b/R/load.R @@ -986,7 +986,10 @@ fn_load_genotype = function(fname_geno, ploidy=NULL, retain_minus_one_alleles_pe ### TSV: allele frequency table file ### ######################################## df = utils::read.delim(fname_geno, sep="\t", header=TRUE) - if (sum(colnames(df)[1:3] == c("chr", "pos", "allele"), na.rm=TRUE) < 3) { + if (!((grepl("chr", colnames(df)[1], ignore.case=TRUE)) & + (grepl("pos", colnames(df)[2], ignore.case=TRUE)) & + (grepl("allele", colnames(df)[3], ignore.case=TRUE))) + ) { error = methods::new("gpError", code=000, message=paste0(