Skip to content

Commit

Permalink
Fix crash in haplotyping where there are null v-calls or c-valls with no
Browse files Browse the repository at this point in the history
* in the name
  • Loading branch information
williamdlees committed Nov 22, 2024
1 parent 8e91247 commit 500cc15
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 58 deletions.
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 0.5.0
Date: 2023-03-08 14:31:07 UTC
SHA: 7be6bb08b96eea277f1900b9b8f74da74136d4dd
Version: 0.5.2
Date: 2024-11-02 14:58:37 UTC
SHA: 8e9124785ceea473dc545641cc9ebf3a13dbedda
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ogrdbstats
Type: Package
Title: Analysis of Adaptive Immune Receptor Repertoire Germ Line Statistics
Version: 0.5.2
Version: 0.5.2.1
Authors@R: person(
"William", "Lees",
email = "[email protected]",
Expand Down Expand Up @@ -42,5 +42,5 @@ Suggests:
knitr,
rmarkdown
VignetteBuilder: knitr
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
LazyData: true
13 changes: 12 additions & 1 deletion R/genotype_statistics.R
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,18 @@ calc_haplo_details = function(segment, input_sequences) {
sa = rename(sa, A_CALL=V_CALL)
}

sa$a_gene = sapply(sa$A_CALL, function(x) {strsplit(x, '*', fixed=TRUE)[[1]][[1]]})
sa$a_gene = sapply(sa$A_CALL, function(x) {
if (grepl('*', x, fixed=TRUE)) {
strsplit(x, '*', fixed=TRUE)[[1]][[1]]
} else {
'X'
}
})

if (nrow(sa) == 0) {
return(list())
}

sa$a_allele = sapply(sa$A_CALL, function(x) {
if (grepl('*', x, fixed=TRUE)) {
strsplit(x, '*', fixed=TRUE)[[1]][[2]]
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
0 errors | 0 warnings | 0 notes


This is a minor update to resolve a problem notified by CRAN Package Check : https://cran.r-project.org/web/checks/check_results_ogrdbstats.html
This is a patch to resolve a problem notified by CRAN Package Check : https://cran.r-project.org/web/checks/check_results_ogrdbstats.html

I reproduced and fixed the problem. Have tested on windows, ubuntu and macos - latest, ubuntu-latest devel.
Binary file modified vignettes/man/figures/README-unnamed-chunk-1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion vignettes/using_ogrdbstats.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ rd = suppressMessages(
barplot_grobs = make_barplot_grobs(rd$input_sequences, rd$genotype_db, rd$inferred_seqs,
rd$genotype, 'V', rd$calculated_NC)
base_grobs = make_novel_base_grobs(rd$inferred_seqs, rd$input_sequences, 'V', FALSE)
gridExtra::grid.arrange(grobs=list(barplot_grobs[3][[1]], base_grobs$end[1][[1]],
gridExtra::grid.arrange(grobs=list(barplot_grobs[2][[1]], base_grobs$end[1][[1]],
base_grobs$conc[1][[1]]),ncol=1)


Expand Down
97 changes: 49 additions & 48 deletions vignettes/using_ogrdbstats.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions vignettes/using_ogrdbstats.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Using ogrdbstats
================
William Lees
2023-03-08
2024-11-22

# Conducting a Genotype Analysis with ogrdbstats

Expand Down Expand Up @@ -368,7 +368,7 @@ rd = suppressMessages(
barplot_grobs = make_barplot_grobs(rd$input_sequences, rd$genotype_db, rd$inferred_seqs,
rd$genotype, 'V', rd$calculated_NC)
base_grobs = make_novel_base_grobs(rd$inferred_seqs, rd$input_sequences, 'V', FALSE)
gridExtra::grid.arrange(grobs=list(barplot_grobs[3][[1]], base_grobs$end[1][[1]],
gridExtra::grid.arrange(grobs=list(barplot_grobs[2][[1]], base_grobs$end[1][[1]],
base_grobs$conc[1][[1]]),ncol=1)
```

Expand Down

0 comments on commit 500cc15

Please sign in to comment.