Skip to content

Commit

Permalink
Fix #354: Infolist missing COMMENT columns
Browse files Browse the repository at this point in the history
  • Loading branch information
Michele Stravs committed Jan 12, 2024
1 parent 53bf476 commit 2e76c0d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/createMassBank.R
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,9 @@ flatten <- function(mbdata)

colNames <- names(unlist(mbdata[[1]]))
commentNames <- colNames[grepl(x = colNames, pattern = "^COMMENT\\_")]
if(!is.null(mbdata[[1]]$COMMENT)) {
commentNames <- c(commentNames, glue::glue("COMMENT_{names(mbdata[[1]]$COMMENT)}"))
}

colList <- c(
"id",
Expand Down Expand Up @@ -1350,6 +1353,7 @@ readMbdata <- function(row)
mbdata[['PUBLICATION']] <- getOption("RMassBank")$annotations$publication
}
commentNames <- names(row)[grepl(x = names(row), pattern = "^COMMENT\\.")]
commentNames <- c(commentNames, names(row)[grepl(x = names(row), pattern = "^COMMENT\\_")])
commentNames <- commentNames[!is.na(row[commentNames])]

# Read all determined fields from the file
Expand Down

0 comments on commit 2e76c0d

Please sign in to comment.