Skip to content

Commit

Permalink
updated parsing of empty investigator fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakejh committed May 23, 2023
1 parent b0cda50 commit 4a0ff68
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
@@ -1,3 +1,3 @@
Version: 1.0.15
Date: 2022-12-13 21:38:16 UTC
SHA: 4b014e60c1e04e8711dd6613ac5e63a90888fdd6
Version: 1.0.16
Date: 2023-02-12 15:41:49 UTC
SHA: b0cda50ec63986ee6160581dc70e904cf88a3dec
2 changes: 1 addition & 1 deletion DESCRIPTION
@@ -1,6 +1,6 @@
Package: pmparser
Title: Create and Maintain a Relational Database of Data from PubMed/MEDLINE
Version: 1.0.16
Version: 1.0.17
Authors@R: c(person('Jake', 'Hughey', , 'jakejhughey@gmail.com', c('aut', 'cre')),
person('Josh', 'Schoenbachler', , 'josh.schoenbachler@gmail.com', 'aut'),
person('Elliot', 'Outland', , 'ehoutland@gmail.com', 'aut'))
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
@@ -1,3 +1,6 @@
# pmparser 1.0.17
* Updated parsing of empty investigator fields.

# pmparser 1.0.16
* Updated readme table in test standards.

Expand Down
3 changes: 2 additions & 1 deletion R/parse_element.R
Expand Up @@ -325,7 +325,8 @@ parseMesh = function(pmXml, dPmid, con = NULL, tableSuffix = NULL) {
x5 = xml_find_all(x4, './/QualifierName', flatten = FALSE)
nQualPerDesc = lengths(x5)

descPos = unlist(lapply(nDescPerPmid[nDescPerPmid > 0], function(n) 1:n))
descPos = unlist(lapply(
nDescPerPmid[nDescPerPmid > 0], function(n) seq_len(n)))

if (length(nQualPerDesc) > 0 && sum(nQualPerDesc) > 0) {
x6 = data.table(
Expand Down
4 changes: 2 additions & 2 deletions R/parse_person.R
Expand Up @@ -108,8 +108,8 @@ parsePerson = function(pmXml, dPmid, con = NULL, tableSuffix = NULL,
x10[is.na(n_affil_ids), n_affil_ids := 0]
x10[, n_person_ids := n_total_ids - n_affil_ids]

if (nrow(x10) > 0) {
x11 = x10[n_person_ids > 0, .(id_pos = 1:n_person_ids), by = cols]
if (nrow(x10) > 0 && any(x10$n_person_ids > 0)) {
x11 = x10[n_person_ids > 0, .(id_pos = seq_len(n_person_ids)), by = cols]

dAllId[, id_pos := seq_len(.N), by = cols]
dPersonId = merge(dAllId, x11, by = c(cols, 'id_pos'))
Expand Down
6 changes: 3 additions & 3 deletions cran-comments.md
Expand Up @@ -16,14 +16,14 @@
Found the following files/directories:
'lastMiKTeXException'

See results for [Windows](https://builder.r-hub.io/status/pmparser_1.0.16.tar.gz-7c295fe76dd64afdac4541030567c42f), [Ubuntu](https://builder.r-hub.io/status/pmparser_1.0.16.tar.gz-aa5fdb1f25ae49aabe4188b7cffba9ab), and [Fedora](https://builder.r-hub.io/status/pmparser_1.0.16.tar.gz-bf42f4c7ae324c94bcd7a0fb8ca9b8cc).
See results for [Windows](https://builder.r-hub.io/status/pmparser_1.0.17.tar.gz-aac25aa5452a4d71849cc4b1efc67ced), [Ubuntu](https://builder.r-hub.io/status/pmparser_1.0.17.tar.gz-a892eda3b5a542dc9a28e7a330f41b06), and [Fedora](https://builder.r-hub.io/status/pmparser_1.0.17.tar.gz-b9631972a174459a833eebd5f0744c95).

### GitHub Actions

0 errors ✓ | 0 warnings ✓ | 0 notes ✓

See results for Mac, Windows, and Ubuntu [here](https://github.com/hugheylab/pmparser/actions/runs/4156795437).
See results for Mac, Windows, and Ubuntu [here]().

## Changes from current CRAN release

The test standards have been updated to include the latest version of the readme file on PubMed, which was the source of the test failures.
* Updated parsing of empty investigator fields.

0 comments on commit 4a0ff68

Please sign in to comment.