Skip to content

Commit

Permalink
fixed chrom order bug
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-sandercock committed Aug 28, 2024
1 parent 5b39803 commit f58e43d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/mod_diversity.R
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,12 @@ mod_diversity_server <- function(id){
)
#Order the Chr column
diversity_items$pos_df$POS <- as.numeric(diversity_items$pos_df$POS)
# Sort the dataframe
# Sort the dataframe and pad with a 0 if only a single digit is provided
diversity_items$pos_df$CHROM <- ifelse(
nchar(diversity_items$pos_df$CHROM) == 1,
paste0("0", diversity_items$pos_df$CHROM),
diversity_items$pos_df$CHROM
)
diversity_items$pos_df <- diversity_items$pos_df[order(diversity_items$pos_df$CHROM), ]

#Plot
Expand Down

0 comments on commit f58e43d

Please sign in to comment.