From df07fdce3f167add3fdb593ea1b75b363a9b5272 Mon Sep 17 00:00:00 2001 From: Michele Stravs Date: Thu, 27 Jul 2023 13:59:34 +0200 Subject: [PATCH] Add COPYRIGHT optional column for infolist, addressing #343 --- R/createMassBank.R | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/R/createMassBank.R b/R/createMassBank.R index a1c166a..4de26cb 100755 --- a/R/createMassBank.R +++ b/R/createMassBank.R @@ -130,13 +130,14 @@ resetInfolists <- function(mb) CH.LINK.HMDB = character(0), CH.LINK.KEGG = character(0), CH.LINK.LIPIDMAPS = character(0), CH.LINK.PUBCHEM = character(0), CH.LINK.INCHIKEY = character(0), CH.LINK.CHEMSPIDER = integer(0), CH.LINK.COMPTOX = character(0), - AUTHORS = character(0) + AUTHORS = character(0), COPYRIGHT = character(0) ), .Names = c("X", "id", "dbcas", "dbname", "dataused", "COMMENT.CONFIDENCE", "COMMENT.ID", "CH.NAME1", "CH.NAME2", "CH.NAME3", "CH.NAME4", "CH.NAME5", "CH.COMPOUND_CLASS", "CH.FORMULA", "CH.EXACT_MASS", "CH.SMILES", "CH.IUPAC", "CH.LINK.CAS", "CH.LINK.CHEBI", "CH.LINK.HMDB", "CH.LINK.KEGG", "CH.LINK.LIPIDMAPS", "CH.LINK.PUBCHEM", - "CH.LINK.INCHIKEY", "CH.LINK.CHEMSPIDER", "CH.LINK.COMPTOX", "AUTHORS"), row.names = integer(0), class = "data.frame") + "CH.LINK.INCHIKEY", "CH.LINK.CHEMSPIDER", "CH.LINK.COMPTOX", + "AUTHORS", "COPYRIGHT"), row.names = integer(0), class = "data.frame") if(getOption("RMassBank")$include_sp_tags) { mb@mbdata_archive["SP.SAMPLE"] <- character(0) @@ -1270,6 +1271,9 @@ readMbdata <- function(row) if(!is.na(row[["AUTHORS"]])) mbdata[["AUTHORS"]] = row[["AUTHORS"]] + + if(!is.na(row[["COPYRIGHT"]])) + mbdata[["COPYRIGHT"]] = row[["COPYRIGHT"]]