Skip to content

Commit

Permalink
Merge pull request #30 from aberHRML/devel
Browse files Browse the repository at this point in the history
Version 0.3.1
  • Loading branch information
wilsontom authored Nov 25, 2019
2 parents 725d24a + e3e9397 commit ce83f9b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: classyfireR
Type: Package
Title: R Interface to the ClassyFire RESTful API
Version: 0.3.0
Date: 2019-11-18
Version: 0.3.1
Date: 2019-11-22
Authors@R: c(
person("Tom", "Wilson", , "tpw2@aber.ac.uk", c("aut", "cre"), comment = c(ORCID = "0000-0003-3112-4682")),
person("Jasen", "Finch", , "jsf9@aber.ac.uk", "aut"))
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# classyfireR 0.3.1

* Add length checks in `get_classification` for when elements of the `json` output is missing (ie, no external descriptors present)

# classyfireR 0.3.0

* Use `S4` object orientation (OO) for storing and accessing results
Expand Down
14 changes: 12 additions & 2 deletions R/get_classification.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,19 @@ get_classification <- function(inchi_key)
url = json_res$alternative_parents$url
)

object@predicted_chebi <- json_res$predicted_chebi_terms
if(length(json_res$predicted_chebi_terms) > 0) {
object@predicted_chebi <- json_res$predicted_chebi_terms
}else{
object@predicted_chebi <- vector(mode = 'character')
}


if(length(json_res$external_descriptors) > 0) {
object@external_descriptors <- parse_external_desc(json_res)
}else{
object@external_descriptors <- tibble::tibble()
}

object@external_descriptors <- parse_external_desc(json_res)

object@description <- json_res$description

Expand Down
Binary file modified inst/classyfireR-manual.pdf
Binary file not shown.

0 comments on commit ce83f9b

Please sign in to comment.