Skip to content

Commit

Permalink
Bug with phenotype file ids
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-sandercock committed Sep 21, 2024
1 parent 2414f1d commit 01bd5bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/mod_gwas.R
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ mod_gwas_server <- function(input, output, session, parent_session){
info <- data.frame(vcf@fix)
gpoly_df <- cbind(info[,c("ID","CHROM","POS")], geno_mat)

if(!any(colnames(gpoly_df) %in% phenotype_file$Sample_ID)) {
if(!any(colnames(gpoly_df) %in% phenotype_file[,1])) {
shinyalert(
title = "Samples ID do not match",
text = paste("Check if passport/phenotype files have same sample ID as the VCF/genotype file."),
Expand All @@ -314,7 +314,7 @@ mod_gwas_server <- function(input, output, session, parent_session){

}
validate(
need(any(colnames(gpoly_df) %in% phenotype_file$Sample_ID), "The selected traits must be numerical.")
need(any(colnames(gpoly_df) %in% phenotype_file[,1]), "The selected traits must be numerical.")
)

write.csv(gpoly_df, file = temp_geno_file, row.names = FALSE)
Expand Down

0 comments on commit 01bd5bc

Please sign in to comment.