Skip to content

Commit

Permalink
add support for mulitple id files
Browse files Browse the repository at this point in the history
LaurentGatto committed Jul 27, 2017
1 parent 68a2189 commit 858dd4a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions R/methods-MSnExp.R
Original file line number Diff line number Diff line change
@@ -270,8 +270,14 @@ setMethod("addIdentificationData", c("MSnExp", "character"),
desc = "DatabaseDescription",
pepseq = "sequence",
verbose = isMSnbaseVerbose()) {
## TODO: handle case with multiple mzid files
id <- mzR::openIDfile(id)
if (length(id) == 1 && file.exists(id)) {
id <- mzR::openIDfile(id)
} else {
if (!all(flex <- file.exists(id)))
stop(paste(id[!flex], collapse = ", "), " not found.")
id <- lapply(id, function(x) as(openIDfile(x), "data.frame"))
id <- do.call(rbind, id)
}
addIdentificationData(object, id = id,
fcol = fcol, icol = icol,
acc, desc, pepseq)

0 comments on commit 858dd4a

Please sign in to comment.