Skip to content

Commit

Permalink
Fix bug in encode_geno()
Browse files Browse the repository at this point in the history
 - use of nchar() didn't work right if allele_codes was a data frame
  • Loading branch information
kbroman committed Mar 25, 2021
1 parent ab5b527 commit 3cad8d0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: qtl2convert
Version: 0.22-7
Date: 2020-06-30
Version: 0.23-1
Date: 2021-03-25
Title: Convert Data among QTL Mapping Packages
Description: Functions to convert data structures among the 'qtl2', 'qtl', and 'DOQTL' packages for mapping quantitative trait loci (QTL).
Author: Karl W Broman [aut, cre] (<https://orcid.org/0000-0002-4914-6671>)
Expand Down
10 changes: 9 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
## qtl2convert 0.23-1 (2021-03-25)

### Bug fixes

- Needed to fix use of `nchar()` in `encode_geno()` as it no longer
works properly with data frames.


## qtl2convert 0.22-7 (2020-06-30)

## Minor changes
### Minor changes

Cosmetic changes to prepare for posting to CRAN:

Expand Down
2 changes: 1 addition & 1 deletion R/encode_geno.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function(geno, allele_codes, output_codes=c("-", "A", "H", "B"), cores=1)
stopifnot(ncol(allele_codes) == 2)

if(any(is.na(allele_codes))) stop("allele_codes can't have missing values")
if(any(nchar(allele_codes)>1)) stop("allele_codes should be single characters")
if(any(apply(allele_codes, 2, nchar) > 1)) stop("allele_codes should be single characters")

if(!is.matrix(geno)) geno <- as.matrix(geno)
if(!is.matrix(allele_codes)) allele_codes <- as.matrix(allele_codes)
Expand Down

0 comments on commit 3cad8d0

Please sign in to comment.