Skip to content

Commit

Permalink
checking for duplicated IDs/samples/entries in the phenotype file
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffersonfparil committed Jul 24, 2024
1 parent e270283 commit 4f56a17
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions R/io.R
Original file line number Diff line number Diff line change
Expand Up @@ -2034,6 +2034,16 @@ fn_load_phenotype = function(fname_pheno, sep="\t", header=TRUE,
entry = as.character(df[, idx_col_id])
pop = as.character(df[, idx_col_pop])
y = df[, idx_col_y]
if (sum(duplicated(entry)) > 0) {
error = methods::new("gpError",
code=281,
message=paste0(
"Error in io::fn_load_phenotype(...). ",
"The sample names have duplicates. ",
"We expect unique samples in the phenotype file. ",
"Please remove duplicated or extract BLUEs/BLUPs using an appropriate linear model."))
return(error)
}
if (!is.numeric(y)) {
error = methods::new("gpError",
code=269,
Expand Down

0 comments on commit 4f56a17

Please sign in to comment.