Skip to content

Commit

Permalink
Get passing all tests again
Browse files Browse the repository at this point in the history
  • Loading branch information
bschilder committed Apr 11, 2024
1 parent dc1bbf3 commit d923fcb
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 19 deletions.
52 changes: 52 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

## 1. Bug description

(A clear and concise description of what the bug is.)

### Console output

```
# Paste console output here (e.g. from R/python/command line)
```

### Expected behaviour

(A clear and concise description of what you expected to happen.)


## 2. Reproducible example

### Code

(Please add the steps to reproduce the bug here. See [here](https://www.r-bloggers.com/2020/10/how-to-make-a-reprex/) for an intro to making a reproducible example (i.e. reprex) and why they're important! __This will help us to help you much faster.__)

```R
# Paste example here

```

### Data

(If possible, upload a small sample of your data so that we can reproduce the bug on our end. If that's not possible, please at least include a screenshot of your data and other relevant details.)


## 3. Session info

(Add output of the R function `utils::sessionInfo()` below. This helps us assess version/OS conflicts which could be causing bugs.)

<details>

```
# Paste utils::sessionInfo() output
```
</details>
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [---]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: HPOExplorer
Title: Analysis and Visualisation of the Human Phenotype Ontology
Version: 1.0.0
Version: 1.0.1
Authors@R:
c(
person(given = "Brian",
Expand Down
13 changes: 13 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# HPOExplorer 1.0.1

## New features

- Add Issues templates

## Bug fixes

* Fix tests:
- `gpt_annot_check`
- `add_hpo_id`
* Fix functions: `gpt_annot_plot`

# HPOExplorer 1.0.0

## New features
Expand Down
1 change: 1 addition & 0 deletions R/0docs.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ NULL
#' returns the entirely ontology.
#' @family make_
#' @inheritParams main
#' @inheritParams KGExplorer::map_colors
#' @returns R object.
#' @name make_
NULL
3 changes: 2 additions & 1 deletion R/gpt_annot_check_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ gpt_annot_check_plot <- function(checks,
scales = "free"){
requireNamespace("ggplot2")

annotation <- metric <- metric_category <- metric_type <- NULL;
annotation <- metric <- metric_category <- metric_type <- n <-
value <- label <-NULL;
check_df <- lapply(checks[items],
data.table::as.data.table, keep.rownames = TRUE) |>
data.table::rbindlist(idcol = "metric") |>
Expand Down
3 changes: 2 additions & 1 deletion R/gpt_annot_melt.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ gpt_annot_melt <- function(res_coded){
value = TRUE)
dat <- data.table::melt.data.table(
data = res_coded$annot[
res_coded$annot_weighted[,c("hpo_id","severity_score_gpt")],on="hpo_id"],
unique(res_coded$annot_weighted[,c("hpo_id","severity_score_gpt")]),
on="hpo_id"],
id.vars = c(id.vars,"severity_score_gpt"),
variable.factor = TRUE,
value.factor = TRUE)
Expand Down
2 changes: 1 addition & 1 deletion man/make_.Rd

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

6 changes: 3 additions & 3 deletions man/plot_evidence.Rd

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

Binary file removed tests/testthat/Rplots.pdf
Binary file not shown.
13 changes: 2 additions & 11 deletions tests/testthat/test-add_hpo_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ test_that("add_hpo_id works", {

phenotype_to_genes <- load_phenotype_to_genes()
phenos <- unique(phenotype_to_genes[,-c("hpo_id")])
phenos2 <- add_hpo_id(phenos=phenos)

## Several terms were omitted from later versions of the HPO
## due to becoming obsolete.
testthat::expect_lte(sum(phenos2$hpo_id!=phenos2$hpo_id), 4)
mismatched_phenos <- map_phenotypes(
terms = phenos2$ID[phenos2$hpo_id!=phenos2$hpo_id]
)
testthat::expect_true(
all(grepl("^obsolete",mismatched_phenos, ignore.case = TRUE))
)
phenos <- add_hpo_id(phenos=phenos)
testthat::expect_equal(sum(is.na(phenos$hpo_id)),0)
})
2 changes: 1 addition & 1 deletion tests/testthat/test-gpt_annot_check.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ test_that("gpt_annot_check works", {

checks <- gpt_annot_check()
testthat::expect_true(all(
c("annot","annot_mean","annot_consist","annot_check","checkable_rate",
c("annot","annot_mean","consistency_count","annot_check","checkable_rate",
"checkable_count","true_pos_rate","false_neg_rate") %in% names(checks)
))
})

0 comments on commit d923fcb

Please sign in to comment.