Skip to content

Commit

Permalink
rectifying insufficient rows/columns to sample from in the conversion…
Browse files Browse the repository at this point in the history
… of non-numeric into numeric genotype matrix
  • Loading branch information
jeffersonfparil committed Jul 17, 2024
1 parent 76e5804 commit c55accb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/io.R
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ fn_G_non_numeric_to_numeric = function(G_non_numeric, retain_minus_one_alleles_p
}
### Extract ploidy where we assume the same ploidy across the entire data set
ploidy = length(unlist(strsplit(G_non_numeric[1,1], "")))
for (i in sample(1:nrow(G_non_numeric), size=100, replace=FALSE)) {
for (j in sample(1:ncol(G_non_numeric), size=100, replace=FALSE)) {
for (i in sample(1:nrow(G_non_numeric), size=min(c(100, nrow(G_non_numeric))), replace=FALSE)) {
for (j in sample(1:ncol(G_non_numeric), size=min(c(100, ncol(G_non_numeric))), replace=FALSE)) {
if (length(unlist(strsplit(G_non_numeric[i, j], ""))) != ploidy) {
error = methods::new("gpError",
code=213,
Expand Down
2 changes: 1 addition & 1 deletion man/fn_cv_1.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c55accb

Please sign in to comment.