diff --git a/DESCRIPTION b/DESCRIPTION index 32b8f59..8ac8f5a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: mzion Type: Package Title: Database Searches of Proteomic Mass-spectrometrirc Data -Version: 1.2.6.1 +Version: 1.2.6.2 Authors@R: person(given = "Qiang", family = "Zhang", diff --git a/R/mgfs.R b/R/mgfs.R index bda8eda..7283333 100644 --- a/R/mgfs.R +++ b/R/mgfs.R @@ -97,7 +97,7 @@ load_mgfs <- function (out_path, mgf_path, min_mass = 200L, max_mass = 4500L, delete_files( out_path, - ignores = c("\\.[Rr]$", "\\.(mgf|MGF)$", "\\.xlsx$", + ignores = c("\\.[Rr]$", "\\.(mgf|MGF)$", "\\.mzML$", "\\.xlsx$", "\\.xls$", "\\.csv$", "\\.txt$", "\\.tsv$", "^mgf$", "^mgfs$", "Calls", # in case of reprocessing after proteoQ @@ -1339,8 +1339,8 @@ readmzML <- function (filepath = NULL, filelist = NULL, # parallel here files <- file.path(filepath, filelist) sizes <- max(unlist(lapply(files, file.size)))/1024^3 - # n_cores <- min(detect_cores(16L), floor((max_ram <- 32)/(sizes * 8)), len) - n_cores <- min(detect_cores(32L), floor((find_free_mem()/1024)/(sizes * 8)), len) + # n_cores <- min(detect_cores(32L), floor((find_free_mem()/1024)/(sizes * 8)), len) + n_cores <- min(detect_cores(32L), floor((find_free_mem()/1024)/(sizes * 8)) + 1L, len) n_cores <- max(1L, n_cores) if (n_cores == 1L) { diff --git a/R/ms2_gen.R b/R/ms2_gen.R index 6192be1..e6ec1a3 100644 --- a/R/ms2_gen.R +++ b/R/ms2_gen.R @@ -109,9 +109,9 @@ gen_ms2ions_base <- function (aa_seq = NULL, ms1_mass = NULL, aas <- .Internal(strsplit(aa_seq, "", fixed = TRUE, perl = FALSE, useBytes = FALSE)) aas <- .Internal(unlist(aas, recursive = FALSE, use.names = FALSE)) aam <- aa_masses[aas] - naa <- length(aas) - nm <- .Internal(paste0(list(rep("0", naa)), collapse = "", recycle0 = FALSE)) + + nm <- .Internal(paste0(list(rep_len("0", naa)), collapse = "", recycle0 = FALSE)) af <- ms2ions_by_type(aam, ntmass, ctmass, type_ms2ions, digits) av <- list(calc_rev_ms2(af, aas)) @@ -190,6 +190,21 @@ gen_ms2ions_a0_vnl0_fnl1 <- function (aa_seq, ms1_mass = NULL, maxn_vmods_sitescombi_per_pep = 64L, digits = 4L) { + if (maxn_fnl_per_seq < 2L) + return( + gen_ms2ions_base(aa_seq = aa_seq, ms1_mass = ms1_mass, + aa_masses = aa_masses, ms1vmods = NULL, ms2vmods = NULL, + ntmod = NULL, ctmod = NULL, + ntmass = ntmass, ctmass = ctmass, + amods = NULL, vmods_nl = NULL, fmods_nl = NULL, + mod_indexes = mod_indexes, + type_ms2ions = type_ms2ions, + maxn_vmods_per_pep = maxn_vmods_per_pep, + maxn_sites_per_vmod = maxn_sites_per_vmod, + maxn_vmods_sitescombi_per_pep = + maxn_vmods_sitescombi_per_pep, + digits = digits)) + # (1, 2) "amods- tmod+ vnl- fnl-", "amods- tmod- vnl- fnl-" # (no pep_seq dispatching by Anywhere fmod residues -> possible no matched sites) @@ -233,8 +248,7 @@ gen_ms2ions_a0_vnl0_fnl1 <- function (aa_seq, ms1_mass = NULL, # --- fmods_combi <- aas[idxes] - # names(fmods_combi) <- idxes - + if (length(fmods_combi) == 1L) { fnls <- fmods_nl[[fmods_combi]] len <- length(fnls) @@ -490,8 +504,9 @@ gen_ms2ions_a1_vnl0_fnl0 <- function (aa_seq, ms1_mass = NULL, aa_masses = NULL, aa_masses = aa_masses, ntmod = ntmod, ctmod = ctmod, ms1_mass = ms1_mass) + ms2vmods <- ms2vmods[idxes] - if (!length(ms2vmods <- ms2vmods[idxes])) + if (!length(ms2vmods)) return(NULL) # most likely a list-one @@ -499,27 +514,22 @@ gen_ms2ions_a1_vnl0_fnl0 <- function (aa_seq, ms1_mass = NULL, aa_masses = NULL, ms2vmods <- ms2vmods[[1]] if (attr(ms2vmods, "single")) { - vmods_combi <- - find_vmodposU(M = ms2vmods, aas = aas, nmax = maxn_vmods_sitescombi_per_pep) - - M <- attr(vmods_combi, "mods", exact = TRUE) + P <- find_vmodposU(M = ms2vmods, aas = aas, nmax = maxn_vmods_sitescombi_per_pep) + M <- attr(P, "mods", exact = TRUE) af <- calc_ms2ions_a1_vnl0_fnl0( - M = M, vmods_combi = vmods_combi, aam = aam, aa_masses = aa_masses, + M = M, P = P, aam = aam, aa_masses = aa_masses, ntmass = ntmass, ctmass = ctmass, type_ms2ions = type_ms2ions, mod_indexes = mod_indexes, digits = digits) } else { - vmods_combi <- - find_vmodposM(M = ms2vmods, aas = aas, nmax = maxn_vmods_sitescombi_per_pep) - - M <- attr(vmods_combi, "mods", exact = TRUE) + P <- find_vmodposM(M = ms2vmods, aas = aas, nmax = maxn_vmods_sitescombi_per_pep) + M <- attr(P, "mods", exact = TRUE) af <- lapply(split_matrix(M, by = "row"), calc_ms2ions_a1_vnl0_fnl0, - vmods_combi = vmods_combi, aam = aam, aa_masses = aa_masses, + P = P, aam = aam, aa_masses = aa_masses, ntmass = ntmass, ctmass = ctmass, type_ms2ions = type_ms2ions, mod_indexes = mod_indexes, digits = digits) - af <- .Internal(unlist(af, recursive = FALSE, use.names = TRUE)) } @@ -532,23 +542,23 @@ gen_ms2ions_a1_vnl0_fnl0 <- function (aa_seq, ms1_mass = NULL, aa_masses = NULL, #' Helper for the calculation of MS2 ion series. #' #' @param M A modification matrix or vector. -#' @param vmods_combi Lists of variable modifications. +#' @param P A matrix of position permutations. #' @param mod_indexes Modification indexes. #' @inheritParams ms2ions_by_type #' @inheritParams add_var_masses -calc_ms2ions_a1_vnl0_fnl0 <- function (M, vmods_combi, aam, aa_masses, - ntmass, ctmass, type_ms2ions = "by", - mod_indexes, digits = 4L) +calc_ms2ions_a1_vnl0_fnl0 <- function (M, P, aam, aa_masses, ntmass, ctmass, + type_ms2ions = "by", mod_indexes, + digits = 4L) { ds <- aa_masses[M] - nvm <- nrow(vmods_combi) + nvm <- nrow(P) out <- vector("list", nvm) naa <- length(aam) hex0 <- rep_len("0", naa) for (i in 1:nvm) { - vi <- vmods_combi[i, ] + vi <- P[i, ] aam_i <- aam aam_i[vi] <- aam_i[vi] + ds out[[i]] <- ms2ions_by_type(aam_i, ntmass, ctmass, type_ms2ions, digits) @@ -767,10 +777,29 @@ gen_ms2ions_a1_vnl0_fnl1 <- function (aa_seq = NULL, ms1_mass = NULL, maxn_vnl_per_seq = 3L, digits = 4L) { + if (maxn_fnl_per_seq < 2L) + return( + gen_ms2ions_a1_vnl0_fnl0(aa_seq = aa_seq, ms1_mass = ms1_mass, + aa_masses = aa_masses, + ms1vmods = ms1vmods, ms2vmods = ms2vmods, + ntmod = ntmod, ctmod = ctmod, + ntmass = ntmass, ctmass = ctmass, + amods = amods, mod_indexes = mod_indexes, + type_ms2ions = type_ms2ions, + maxn_vmods_per_pep = maxn_vmods_per_pep, + maxn_sites_per_vmod = maxn_sites_per_vmod, + maxn_vmods_sitescombi_per_pep = + maxn_vmods_sitescombi_per_pep, + digits = digits)) + # (7, 8) "amods+ tmod- vnl- fnl-", "amods+ tmod+ vnl- fnl-" # (no pep_seq dispatching by fmod residues -> possible no matched sites) sites <- names(fmods_nl) - pattern <- .Internal(paste(list(sites), sep = " ", collapse = "|", recycle0 = FALSE)) + # pattern <- .Internal(paste(list(sites), sep = " ", collapse = "|", recycle0 = FALSE)) + pattern <- if (length(sites) > 1L) + .Internal(paste0(list(sites), collapse = "|", recycle0 = FALSE)) + else + sites if (!grepl(pattern, aa_seq)) return( @@ -800,8 +829,9 @@ gen_ms2ions_a1_vnl0_fnl1 <- function (aa_seq = NULL, ms1_mass = NULL, aa_masses = aa_masses, ntmod = ntmod, ctmod = ctmod, ms1_mass = ms1_mass) + ms2vmods <- ms2vmods[idxes] - if (!length(ms2vmods <- ms2vmods[idxes])) + if (!length(ms2vmods)) return(NULL) fnl_idxes <- .Internal(which(aas %fin% names(fmods_nl))) @@ -826,25 +856,21 @@ gen_ms2ions_a1_vnl0_fnl1 <- function (aa_seq = NULL, ms1_mass = NULL, ms2vmods <- ms2vmods[[1]] if (attr(ms2vmods, "single")) { - vmods_combi <- - find_vmodposU(M = ms2vmods, aas = aas, nmax = maxn_vmods_sitescombi_per_pep) - - M <- attr(vmods_combi, "mods", exact = TRUE) + P <- find_vmodposU(M = ms2vmods, aas = aas, nmax = maxn_vmods_sitescombi_per_pep) + M <- attr(P, "mods", exact = TRUE) af <- calc_ms2ions_a1_vnl0_fnl1( - M = M, vmods_combi = vmods_combi, fnl_combi = fnl_combi, + M = M, P = P, fnl_combi = fnl_combi, fnl_idxes = fnl_idxes, aam = aam, aa_masses = aa_masses, ntmass = ntmass, ctmass = ctmass, type_ms2ions = type_ms2ions, mod_indexes = mod_indexes, digits = digits) } else { - vmods_combi <- - find_vmodposM(M = ms2vmods, aas = aas, nmax = maxn_vmods_sitescombi_per_pep) - - M <- attr(vmods_combi, "mods", exact = TRUE) + P <- find_vmodposM(M = ms2vmods, aas = aas, nmax = maxn_vmods_sitescombi_per_pep) + M <- attr(P, "mods", exact = TRUE) af <- lapply(split_matrix(M, by = "row"), calc_ms2ions_a1_vnl0_fnl1, - vmods_combi = vmods_combi, fnl_combi = fnl_combi, + P = P, fnl_combi = fnl_combi, fnl_idxes = fnl_idxes, aam = aam, aa_masses = aa_masses, ntmass = ntmass, ctmass = ctmass, type_ms2ions = type_ms2ions, mod_indexes = mod_indexes, digits = digits) @@ -866,13 +892,13 @@ gen_ms2ions_a1_vnl0_fnl1 <- function (aa_seq = NULL, ms1_mass = NULL, #' @param mod_indexes Modification indexes. #' @inheritParams calc_ms2ions_a1_vnl0_fnl0 #' @inheritParams hms1_a0_vnl0_fnl1 -calc_ms2ions_a1_vnl0_fnl1 <- function (M, vmods_combi, fnl_combi, fnl_idxes, +calc_ms2ions_a1_vnl0_fnl1 <- function (M, P, fnl_combi, fnl_idxes, aam, aa_masses, ntmass, ctmass, type_ms2ions = "by", mod_indexes, digits = 4L) { ds <- aa_masses[M] - nvm <- nrow(vmods_combi) + nvm <- nrow(P) nnl <- length(fnl_combi) len <- nvm * nnl out <- vector("list", len) @@ -882,7 +908,7 @@ calc_ms2ions_a1_vnl0_fnl1 <- function (M, vmods_combi, fnl_combi, fnl_idxes, hex0 <- rep_len("0", naa) for (i in 1:nvm) { - vi <- vmods_combi[i, ] + vi <- P[i, ] aam_i <- aam aam_i[vi] <- aam_i[vi] + ds @@ -1129,10 +1155,23 @@ gen_ms2ions_a1_vnl1_fnl0 <- function (aa_seq = NULL, ms1_mass = NULL, # dummy maxn_fnl_per_seq = 3L, - maxn_vnl_per_seq = 3L, digits = 4L) { + if (maxn_vnl_per_seq < 2L) + return(gen_ms2ions_a1_vnl0_fnl0(aa_seq = aa_seq, ms1_mass = ms1_mass, + aa_masses = aa_masses, + ms1vmods = ms1vmods, ms2vmods = ms2vmods, + ntmod = ntmod, ctmod = ctmod, + ntmass = ntmass, ctmass = ctmass, + amods = amods, mod_indexes = mod_indexes, + type_ms2ions = type_ms2ions, + maxn_vmods_per_pep = maxn_vmods_per_pep, + maxn_sites_per_vmod = maxn_sites_per_vmod, + maxn_vmods_sitescombi_per_pep = + maxn_vmods_sitescombi_per_pep, + digits = digits)) + aas <- .Internal(strsplit(aa_seq, "", fixed = TRUE, perl = FALSE, useBytes = FALSE)) aas <- .Internal(unlist(aas, recursive = FALSE, use.names = FALSE)) aam <- aa_masses[aas] @@ -1145,8 +1184,9 @@ gen_ms2ions_a1_vnl1_fnl0 <- function (aa_seq = NULL, ms1_mass = NULL, aa_masses = aa_masses, ntmod = ntmod, ctmod = ctmod, ms1_mass = ms1_mass) - - if (!length(ms2vmods <- ms2vmods[idxes])) + ms2vmods <- ms2vmods[idxes] + + if (!length(ms2vmods)) return(NULL) # most likely a list-one @@ -1154,57 +1194,101 @@ gen_ms2ions_a1_vnl1_fnl0 <- function (aa_seq = NULL, ms1_mass = NULL, ms2vmods <- ms2vmods[[1]] if (attr(ms2vmods, "single")) { - vmods_combi <- - find_vmodposU(M = ms2vmods, aas = aas, nmax = maxn_vmods_sitescombi_per_pep) - - M <- attr(vmods_combi, "mods", exact = TRUE) - vnl_combi <- expand_grid_rows(vmods_nl[ms2vmods], nmax = maxn_vnl_per_seq) + P <- find_vmodposU(M = ms2vmods, aas = aas, nmax = maxn_vmods_sitescombi_per_pep) + M <- attr(P, "mods", exact = TRUE) + nP <- nrow(P) - af <- calc_ms2ions_a1_vnl1_fnl0( - vnl_combi = vnl_combi, - M = M, - vmods_combi = vmods_combi, - aam = aam, - aa_masses = aa_masses, - ntmass = ntmass, - ctmass = ctmass, - type_ms2ions = type_ms2ions, - mod_indexes = mod_indexes, - maxn_vmods_sitescombi_per_pep = - maxn_vmods_sitescombi_per_pep, - digits = digits) + if (nP >= maxn_vmods_sitescombi_per_pep) + af <- calc_ms2ions_a1_vnl0_fnl0( + M = M, P = P, aam = aam, aa_masses = aa_masses, + ntmass = ntmass, ctmass = ctmass, type_ms2ions = type_ms2ions, + mod_indexes = mod_indexes, digits = digits) + else { + nnl <- min(maxn_vmods_sitescombi_per_pep %/% nP, maxn_vnl_per_seq) + + if (nnl <= 1L) + af <- calc_ms2ions_a1_vnl0_fnl0( + M = M, P = P, aam = aam, aa_masses = aa_masses, + ntmass = ntmass, ctmass = ctmass, type_ms2ions = type_ms2ions, + mod_indexes = mod_indexes, digits = digits) + else + af <- calc_ms2ions_a1_vnl1_fnl0( + N = expand_grid_rows(vmods_nl[ms2vmods], nmax = nnl), + M = M, + P = P, + aam = aam, + aa_masses = aa_masses, + ntmass = ntmass, + ctmass = ctmass, + type_ms2ions = type_ms2ions, + mod_indexes = mod_indexes, + digits = digits) + } } else { - vmods_combi <- - find_vmodposM(M = ms2vmods, aas = aas, nmax = maxn_vmods_sitescombi_per_pep) - - M <- attr(vmods_combi, "mods", exact = TRUE) - M <- split_matrix(M, by = "row") - - vnl_combi <- - lapply(M, function (x) expand_grid_rows(vmods_nl[x], nmax = maxn_vnl_per_seq)) + P <- find_vmodposM(M = ms2vmods, aas = aas, nmax = maxn_vmods_sitescombi_per_pep) + M <- attr(P, "mods", exact = TRUE) + nP <- nrow(P) + nM <- nrow(M) + n1 <- nP * nM - # garanteed from matchMS: maxn_vmods_sitescombi_per_pep >= 2L - maxnvmods <- max(maxn_vmods_sitescombi_per_pep %/% length(M), 2L) - - af <- mapply( - calc_ms2ions_a1_vnl1_fnl0, - vnl_combi, M, - MoreArgs = list( - vmods_combi = vmods_combi, - aam = aam, - aa_masses = aa_masses, - ntmass = ntmass, - ctmass = ctmass, - type_ms2ions = type_ms2ions, - mod_indexes = mod_indexes, - maxn_vmods_sitescombi_per_pep = maxnvmods, - digits = digits - ), - SIMPLIFY = FALSE, - USE.NAMES = FALSE) - - af <- .Internal(unlist(af, recursive = FALSE, use.names = TRUE)) + if (n1 > maxn_vmods_sitescombi_per_pep) { + l <- maxn_vmods_sitescombi_per_pep %/% nP + M <- M[1:l, ] # l >= 1L + + if (l == 1L) { + af <- calc_ms2ions_a1_vnl0_fnl0( + M = M, P = P, aam = aam, aa_masses = aa_masses, + ntmass = ntmass, ctmass = ctmass, type_ms2ions = type_ms2ions, + mod_indexes = mod_indexes, digits = digits) + } + else { + M <- split_matrix(M, by = "row") + af <- lapply(M, calc_ms2ions_a1_vnl0_fnl0, + P = P, aam = aam, aa_masses = aa_masses, + ntmass = ntmass, ctmass = ctmass, type_ms2ions = type_ms2ions, + mod_indexes = mod_indexes, digits = digits) + af <- .Internal(unlist(af, recursive = FALSE, use.names = TRUE)) + } + } + else { + M <- split_matrix(M, by = "row") + l <- maxn_vmods_sitescombi_per_pep %/% n1 + + if (l == 1L) { + af <- lapply(M, calc_ms2ions_a1_vnl0_fnl0, + P = P, aam = aam, aa_masses = aa_masses, + ntmass = ntmass, ctmass = ctmass, type_ms2ions = type_ms2ions, + mod_indexes = mod_indexes, digits = digits) + af <- .Internal(unlist(af, recursive = FALSE, use.names = TRUE)) + } + else { + n2 <- n1 * prod(lengths(vmods_nl)) + + N <- if (n2 > maxn_vmods_sitescombi_per_pep) + lapply(M, function (x) expand_grid_rows(vmods_nl[x], nmax = 2L)) + else + lapply(M, function (x) expand_grid_rows(vmods_nl[x], nmax = maxn_vnl_per_seq)) + + af <- mapply( + calc_ms2ions_a1_vnl1_fnl0, + N, M, + MoreArgs = list( + P = P, + aam = aam, + aa_masses = aa_masses, + ntmass = ntmass, + ctmass = ctmass, + type_ms2ions = type_ms2ions, + mod_indexes = mod_indexes, + digits = digits + ), + SIMPLIFY = FALSE, + USE.NAMES = FALSE) + + af <- .Internal(unlist(af, recursive = FALSE, use.names = TRUE)) + } + } } # hexcodes of the reversed entries are not yet reversed; @@ -1217,47 +1301,40 @@ gen_ms2ions_a1_vnl1_fnl0 <- function (aa_seq = NULL, ms1_mass = NULL, #' Calculates MS2 ions. -#' -#' @param M A modification matrix or vector. -#' @param vmods_combi Lists of variable modifications. -#' @param vnl_combi Lists of combinations of neutral losses for corresponding -#' \code{vmods_combi}. Each list contains a table where each column -#' corresponds to a set of neutral loss. The first column corresponds to the -#' combination without NLs. +#' +#' @param M A vector of modifications. +#' @param P A matrix of positions. +#' @param N Lists of combinations of neutral losses for corresponding \code{P}. +#' Each list contains a table where each column corresponds to a set of +#' neutral loss. The first column corresponds to the combination without NLs. #' @param mod_indexes Modification indexes. #' @inheritParams ms2ions_by_type #' @inheritParams add_var_masses #' @inheritParams matchMS -calc_ms2ions_a1_vnl1_fnl0 <- function (vnl_combi, M, vmods_combi, aam, aa_masses, +calc_ms2ions_a1_vnl1_fnl0 <- function (N, M, P, aam, aa_masses, ntmass, ctmass, type_ms2ions = "by", mod_indexes, - maxn_vmods_sitescombi_per_pep = 64L, digits = 4L) { - naa <- length(aam) + naa <- length(aam) hex0 <- rep_len("0", naa) ds <- aa_masses[M] - nnl <- length(vnl_combi) - nvm <- nrow(vmods_combi) - - mod <- maxn_vmods_sitescombi_per_pep %/% nnl - maxn_vmods_sitescombi_per_pep <- mod * nnl - len <- min(nvm * nnl, maxn_vmods_sitescombi_per_pep) + nnl <- length(N) + nvm <- nrow(P) + len <- nvm * nnl out <- vector("list", len) - ite <- min(mod, nvm) r <- 1L - for (i in 1:ite) { - vi <- vmods_combi[i, ] + for (i in 1:nvm) { + vi <- P[i, ] aam_i <- aam aam_i[vi] <- aam_i[vi] + ds for (j in 1:nnl) { aam_j <- aam_i - delta_nl <- .Internal(unlist(vnl_combi[[j]], recursive = FALSE, - use.names = FALSE)) + delta_nl <- .Internal(unlist(N[[j]], recursive = FALSE, use.names = FALSE)) aam_j[vi] <- aam_j[vi] - delta_nl out[[r]] <- ms2ions_by_type(aam_j, ntmass, ctmass, type_ms2ions, digits) r <- r + 1L diff --git a/R/ms2frames.R b/R/ms2frames.R index cf18c9e..6150625 100644 --- a/R/ms2frames.R +++ b/R/ms2frames.R @@ -166,8 +166,8 @@ pair_mgftheo <- function (mgf_path, n_modules, .path_bin, by_modules = TRUE, hms2match <- function (aa_masses_all, funs_ms2, ms1vmods_all, ms2vmods_all, mod_indexes, mgf_path, out_path, type_ms2ions = "by", maxn_vmods_per_pep = 5L, - maxn_sites_per_vmod = 3L, maxn_fnl_per_seq = 64L, - maxn_vnl_per_seq = 64L, + maxn_sites_per_vmod = 3L, maxn_fnl_per_seq = 3L, + maxn_vnl_per_seq = 3L, maxn_vmods_sitescombi_per_pep = 64L, minn_ms2 = 6L, ppm_ms1 = 10L, ppm_ms2 = 10L, min_ms2mass = 115L, index_mgf_ms2 = FALSE, @@ -272,8 +272,8 @@ hms2match <- function (aa_masses_all, funs_ms2, ms1vmods_all, ms2vmods_all, ms2match_all <- function (mgth, aa_masses_all, funs_ms2, ms1vmods_all, ms2vmods_all, mod_indexes, mgf_path, out_path, type_ms2ions = "by", maxn_vmods_per_pep = 5L, - maxn_sites_per_vmod = 3L, maxn_fnl_per_seq = 64L, - maxn_vnl_per_seq = 64L, + maxn_sites_per_vmod = 3L, maxn_fnl_per_seq = 3L, + maxn_vnl_per_seq = 3L, maxn_vmods_sitescombi_per_pep = 64L, minn_ms2 = 6L, ppm_ms1 = 10L, ppm_ms2 = 10L, min_ms2mass = 115L, index_mgf_ms2 = FALSE, @@ -367,8 +367,8 @@ mframes_adv <- function (mgf_frames = NULL, theopeps = NULL, aa_masses_all, funs_ms2, ms1vmods_all, ms2vmods_all, mod_indexes = NULL, type_ms2ions = "by", maxn_vmods_per_pep = 5L, - maxn_sites_per_vmod = 3L, maxn_fnl_per_seq = 64L, - maxn_vnl_per_seq = 64L, + maxn_sites_per_vmod = 3L, maxn_fnl_per_seq = 3L, + maxn_vnl_per_seq = 3L, maxn_vmods_sitescombi_per_pep = 64L, minn_ms2 = 6L, ppm_ms1 = 10L, ppm_ms2 = 10L, min_ms2mass = 115L, index_mgf_ms2 = FALSE, @@ -1403,7 +1403,7 @@ ms2match_one <- function (pep_mod_group, aa_masses, FUN, ms1vmods, ms2vmods, cl, mod_indexes, mgf_path, out_path, type_ms2ions = "by", maxn_vmods_per_pep = 5L, maxn_sites_per_vmod = 3L, - maxn_fnl_per_seq = 8L, maxn_vnl_per_seq = 8L, + maxn_fnl_per_seq = 3L, maxn_vnl_per_seq = 3L, maxn_vmods_sitescombi_per_pep = 64L, minn_ms2 = 6L, ppm_ms1 = 10L, ppm_ms2 = 10L, min_ms2mass = 115L, index_mgf_ms2 = FALSE, @@ -1543,7 +1543,7 @@ frames_adv <- function (mgf_frames = NULL, theopeps = NULL, pep_mod_group = NULL, mod_indexes = NULL, type_ms2ions = "by", maxn_vmods_per_pep = 5L, maxn_sites_per_vmod = 3L, - maxn_fnl_per_seq = 8L, maxn_vnl_per_seq = 8L, + maxn_fnl_per_seq = 3L, maxn_vnl_per_seq = 3L, maxn_vmods_sitescombi_per_pep = 64L, minn_ms2 = 6L, ppm_ms1 = 10L, ppm_ms2 = 10L, min_ms2mass = 115L, index_mgf_ms2 = FALSE, diff --git a/R/msmsmatches.R b/R/msmsmatches.R index 6fb458b..cc78fbb 100644 --- a/R/msmsmatches.R +++ b/R/msmsmatches.R @@ -139,9 +139,13 @@ #' considered, the value of \code{maxn_sites_per_vmod} needs to be four or #' greater. #' @param maxn_fnl_per_seq A non-negative integer; the maximum number of -#' permutative neutral losses per peptide sequence for fixed modifications. +#' permutative neutral losses per peptide sequence for fixed modifications. To +#' bypass the combinatorial of neutral losses, set \code{maxn_fnl_per_seq = 1} +#' or \code{0}. #' @param maxn_vnl_per_seq A non-negative integer; the maximum number of #' permutative neutral losses per peptide sequence for variable modifications. +#' To bypass the combinatorial of neutral losses, set \code{maxn_vnl_per_seq = +#' 1} or \code{0}. #' @param maxn_vmods_sitescombi_per_pep A non-negative integer; the maximum #' number of combinatorial variable modifications per peptide sequence (per #' module). The combinations include the ways of neutral losses and @@ -868,7 +872,7 @@ matchMS <- function (out_path = "~/mzion/outs", stopifnot(min_len >= 1L, max_len >= min_len, max_miss <= 10L, minn_ms2 >= 2L, min_mass >= 1L, max_mass >= min_mass, min_ms2mass >= 1L, max_ms2mass > min_ms2mass, - maxn_fnl_per_seq >= 2L, maxn_vnl_per_seq >= 2L, + # maxn_fnl_per_seq >= 2L, maxn_vnl_per_seq >= 2L, maxn_vmods_sitescombi_per_pep >= 2L, n_13c >= 0L, noenzyme_maxn >= 0L, maxn_vmods_per_pep >= maxn_sites_per_vmod, max_n_prots > 1000L, diff --git a/R/vmod_ms2_labels.R b/R/vmod_ms2_labels.R index 2a4d128..5910bd2 100644 --- a/R/vmod_ms2_labels.R +++ b/R/vmod_ms2_labels.R @@ -3,13 +3,8 @@ #' One-to-one correspondence between Names and Sites. Finds the positions of #' residues (sites) from a given amino acid sequence (aas). #' -#' @param M A matrix of labels of modification names with permutation. Each -#' permutation in a row. The corresponding matrix of site permutations in the -#' attribute of \code{resids}. -#' -#' Note that M is a matrix other than lists of vectors, which allows the -#' application of one copy of attributes to all rows. -#' @param nmax The maximum number of combinations. +#' @param M A vector of modifications. +#' @param nmax The maximum number of combinations being allowed. #' @param aas \code{aa_seq} split in a sequence of LETTERS. #' @examples #' \donttest{ @@ -46,14 +41,14 @@ #' } find_vmodposU <- function (M, aas, nmax = 64L) { - rs <- attr(M, "resids") + rs <- attr(M, "resids", exact = TRUE) nr <- length(rs) - ps <- attr(M, "ps") + ps <- attr(M, "ps", exact = TRUE) ss <- names(ps) if (nmax == 1L) { ns <- length(ss) - combi <- character(nr) + P <- character(nr) ends <- cumsum(ps) r1 <- 1L @@ -61,44 +56,44 @@ find_vmodposU <- function (M, aas, nmax = 64L) si <- ss[[i]] pi <- ps[[i]] ei <- ends[[i]] - combi[r1:ei] <- .Internal(which(aas == si))[1:pi] + P[r1:ei] <- .Internal(which(aas == si))[1:pi] r1 <- pi + 1L } # one-row matrix - combi <- .Internal(matrix(combi, nrow = 1L, ncol = 1L, byrow = FALSE, + P <- .Internal(matrix(P, nrow = 1L, ncol = 1L, byrow = FALSE, dimnames = NULL, FALSE, TRUE)) # remove attributes - attr(combi, "mods") <- M[1:nr] - - return(combi) + attr(P, "mods") <- M[1:nr] + return(P) } if (nr == 1L) { - combi <- .Internal(which(aas == ss)) - combi <- .Internal(matrix(combi, nrow = 1L, ncol = 1L, byrow = FALSE, - dimnames = NULL, TRUE, FALSE)) + P <- .Internal(which(aas == ss)) + P <- .Internal(matrix(P, nrow = 1L, ncol = 1L, byrow = FALSE, + dimnames = NULL, TRUE, FALSE)) + attr(P, "mods") <- M[1:nr] + return(P) } - else { - ns <- length(ss) - X <- vector("list", ns) - - for (i in 1:ns) { - si <- .Internal(which(aas == names(ps)[i])) - ni <- ps[[i]] - - X[[i]] <- if (ni == 1L) - matrix(si) - else - arrangements::combinations(si, ni, nitem = nmax, layout = "row") - } + + ns <- length(ss) + X <- vector("list", ns) + + for (i in 1:ns) { + si <- .Internal(which(aas == names(ps)[i])) + ni <- ps[[i]] - combi <- expand_gr(X, nmax = nmax) + X[[i]] <- if (ni == 1L) + matrix(si) + else + arrangements::combinations(si, ni, nitem = nmax, layout = "row") } - attr(combi, "mods") <- M[1:nr] + P <- expand_gr(X, nmax = nmax) - combi + attr(P, "mods") <- M[1:nr] + + P } @@ -113,6 +108,19 @@ find_vmodposU <- function (M, aas, nmax = 64L) #' \donttest{ #' library(mzion) #' +#' Vec <- c("Carbamidomethyl (M)", "Carbamyl (M)") +#' vec <- c("M", "M") +#' aas <- unlist(strsplit("HQGVMNVGMGQKMNS", "")) +#' ps <- c(2) +#' names(ps) <- c("M") +#' attr(Vec, "ps") <- ps +#' attr(Vec, "resids") <- vec +#' rs <- unique(vec) +#' inds <- lapply(rs, function (x) which(vec == x)) +#' attr(Vec, "inds") <- inds +#' mzion:::find_vmodposM(Vec, aas) +#' mzion:::find_vmodposM(Vec, aas, nmax = 1L) +#' #' Vec <- c("Carbamidomethyl (M)", "Deamidated (N)", "Carbamyl (M)") #' vec <- c("M", "N", "M") #' aas <- unlist(strsplit("HQGVMNVGMGQKMNS", "")) @@ -152,29 +160,58 @@ find_vmodposU <- function (M, aas, nmax = 64L) #' attr(Vec, "inds") <- inds #' mzion:::find_vmodposM(Vec, aas) #' mzion:::find_vmodposM(Vec, aas, nmax = 1L) +#' mzion:::find_vmodposM(Vec, aas, nmax = 16L) +#' mzion:::find_vmodposM(Vec, aas, nmax = 8L) +#' lapply(1:32, function (x) mzion:::find_vmodposM(Vec, aas, nmax = x)) #' } find_vmodposM <- function (M, aas, nmax = 64L) { rs <- attr(M, "resids", exact = TRUE) ps <- attr(M, "ps", exact = TRUE) - inds <- attr(M, "inds", exact = TRUE) - + ds <- attr(M, "inds", exact = TRUE) np <- length(ps) A <- P <- vector("list", np) - + nmax2 <- nmax + for (i in 1:np) { ri <- names(ps)[i] si <- .Internal(which(aas == ri)) ni <- ps[[i]] - P[[i]] <- arrangements::combinations(si, ni, nitem = nmax, layout = "row") - pi <- inds[[i]] - ai <- unique(arrangements::permutations(M[pi], nitem = nmax, layout = "list")) - A[[i]] <- do.call(rbind, ai) + nP <- nrow(P[[i]] <- arrangements::combinations(si, ni, nitem = nmax, layout = "row")) + nmax2 <- nmax2 %/% nP + + if (nmax2 <= 1L) { + A[[i]] <- .Internal(matrix(M[ds[[i]]], nrow = 1L, ncol = 1L, byrow = FALSE, + dimnames = NULL, FALSE, TRUE)) + A <- A[1:i] + P <- P[1:i] + # np <- i + break + } + else { + Mi <- M[ds[[i]]] + + nA <- if (length(Mi) == 1L) # Deamidated (N) + nrow(A[[i]] <- .Internal(matrix(Mi, nrow = 1L, ncol = 1L, byrow = FALSE, + dimnames = NULL, TRUE, FALSE))) + else # Carbamidomethyl (M), Carbamyl (M) + nrow(A[[i]] <- unique(arrangements::permutations(Mi, nitem = nmax, layout = "row"))) + + nmax2 <- nmax2 %/% nA + } + } + + if (np == 1L) { + combP <- P[[1]] + combA <- A[[1]] + } + else { + combP <- expand_gr(P, nmax = nmax) + # combA <- expand_gr(A, nmax = max(nmax %/% nrow(combP), 1L)) + combA <- expand_gr(A, nmax = nmax) } - combP <- expand_gr(P, nmax = nmax) - combA <- expand_gr(A, nmax = nmax) attr(combP, "mods") <- combA combP diff --git a/man/calc_ms2ions.Rd b/man/calc_ms2ions.Rd index 3240976..bb1f650 100644 --- a/man/calc_ms2ions.Rd +++ b/man/calc_ms2ions.Rd @@ -45,10 +45,14 @@ variable modifications per site in a per peptide sequence.} combinatorial variable modifications per peptide sequence.} \item{maxn_fnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for fixed modifications.} +permutative neutral losses per peptide sequence for fixed modifications. To +bypass the combinatorial of neutral losses, set \code{maxn_fnl_per_seq = 1} +or \code{0}.} \item{maxn_vnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for variable modifications.} +permutative neutral losses per peptide sequence for variable modifications. +To bypass the combinatorial of neutral losses, set \code{maxn_vnl_per_seq = +1} or \code{0}.} \item{digits}{Integer; the number of decimal places to be used.} } diff --git a/man/calc_ms2ions_a1_vnl0_fnl0.Rd b/man/calc_ms2ions_a1_vnl0_fnl0.Rd index 89e9b07..2e43f7c 100644 --- a/man/calc_ms2ions_a1_vnl0_fnl0.Rd +++ b/man/calc_ms2ions_a1_vnl0_fnl0.Rd @@ -6,7 +6,7 @@ \usage{ calc_ms2ions_a1_vnl0_fnl0( M, - vmods_combi, + P, aam, aa_masses, ntmass, @@ -19,7 +19,7 @@ calc_ms2ions_a1_vnl0_fnl0( \arguments{ \item{M}{A modification matrix or vector.} -\item{vmods_combi}{Lists of variable modifications.} +\item{P}{A matrix of position permutations.} \item{aam}{A sequence of amino-acid residues with \emph{masses}. Residues are in names and masses in values (note that argument \code{aas} diff --git a/man/calc_ms2ions_a1_vnl0_fnl1.Rd b/man/calc_ms2ions_a1_vnl0_fnl1.Rd index c7d18c9..ed5ff3a 100644 --- a/man/calc_ms2ions_a1_vnl0_fnl1.Rd +++ b/man/calc_ms2ions_a1_vnl0_fnl1.Rd @@ -6,7 +6,7 @@ \usage{ calc_ms2ions_a1_vnl0_fnl1( M, - vmods_combi, + P, fnl_combi, fnl_idxes, aam, @@ -21,7 +21,7 @@ calc_ms2ions_a1_vnl0_fnl1( \arguments{ \item{M}{A modification matrix or vector.} -\item{vmods_combi}{Lists of variable modifications.} +\item{P}{A matrix of position permutations.} \item{fnl_combi}{A data.frame of combinations of neutral losses for fixed modifications. Each row corresponds to a set of neutral loss. The first row diff --git a/man/calc_ms2ions_a1_vnl1_fnl0.Rd b/man/calc_ms2ions_a1_vnl1_fnl0.Rd index b113b87..ec152f5 100644 --- a/man/calc_ms2ions_a1_vnl1_fnl0.Rd +++ b/man/calc_ms2ions_a1_vnl1_fnl0.Rd @@ -5,28 +5,26 @@ \title{Calculates MS2 ions.} \usage{ calc_ms2ions_a1_vnl1_fnl0( - vnl_combi, + N, M, - vmods_combi, + P, aam, aa_masses, ntmass, ctmass, type_ms2ions = "by", mod_indexes, - maxn_vmods_sitescombi_per_pep = 64L, digits = 4L ) } \arguments{ -\item{vnl_combi}{Lists of combinations of neutral losses for corresponding -\code{vmods_combi}. Each list contains a table where each column -corresponds to a set of neutral loss. The first column corresponds to the -combination without NLs.} +\item{N}{Lists of combinations of neutral losses for corresponding \code{P}. +Each list contains a table where each column corresponds to a set of +neutral loss. The first column corresponds to the combination without NLs.} -\item{M}{A modification matrix or vector.} +\item{M}{A vector of modifications.} -\item{vmods_combi}{Lists of variable modifications.} +\item{P}{A matrix of positions.} \item{aam}{A sequence of amino-acid residues with \emph{masses}. Residues are in names and masses in values (note that argument \code{aas} @@ -46,15 +44,6 @@ and y-ions.} \item{mod_indexes}{Modification indexes.} -\item{maxn_vmods_sitescombi_per_pep}{A non-negative integer; the maximum -number of combinatorial variable modifications per peptide sequence (per -module). The combinations include the ways of neutral losses and -modification labels. For instance, at \code{maxn_vnl_per_seq = 2}, the ways -of allowed position permutation will be 32. Similarly, at -\code{maxn_vnl_per_seq = 2} and, for example, the permutation of labels -\code{Acetyl (K)} and \code{TMT (K)} (let's say three ways), the ways of -position permutation will be limited to \code{64/2/3}.} - \item{digits}{A non-negative integer; the number of decimal places to be used. The default is 4.} } diff --git a/man/calc_ms2ionseries.Rd b/man/calc_ms2ionseries.Rd index c8b1c38..f8bd962 100644 --- a/man/calc_ms2ionseries.Rd +++ b/man/calc_ms2ionseries.Rd @@ -48,10 +48,14 @@ variable modifications per site in a per peptide sequence.} combinatorial variable modifications per peptide sequence.} \item{maxn_fnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for fixed modifications.} +permutative neutral losses per peptide sequence for fixed modifications. To +bypass the combinatorial of neutral losses, set \code{maxn_fnl_per_seq = 1} +or \code{0}.} \item{maxn_vnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for variable modifications.} +permutative neutral losses per peptide sequence for variable modifications. +To bypass the combinatorial of neutral losses, set \code{maxn_vnl_per_seq = +1} or \code{0}.} \item{digits}{Integer; the number of decimal places to be used.} } diff --git a/man/calib_mgf.Rd b/man/calib_mgf.Rd index 455627f..c77757f 100644 --- a/man/calib_mgf.Rd +++ b/man/calib_mgf.Rd @@ -80,10 +80,14 @@ default is 5.} greater.} \item{maxn_fnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for fixed modifications.} +permutative neutral losses per peptide sequence for fixed modifications. To +bypass the combinatorial of neutral losses, set \code{maxn_fnl_per_seq = 1} +or \code{0}.} \item{maxn_vnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for variable modifications.} +permutative neutral losses per peptide sequence for variable modifications. +To bypass the combinatorial of neutral losses, set \code{maxn_vnl_per_seq = +1} or \code{0}.} \item{maxn_vmods_sitescombi_per_pep}{A non-negative integer; the maximum number of combinatorial variable modifications per peptide sequence (per diff --git a/man/find_vmodposM.Rd b/man/find_vmodposM.Rd index 0c2f2dd..acbdce9 100644 --- a/man/find_vmodposM.Rd +++ b/man/find_vmodposM.Rd @@ -20,6 +20,19 @@ Multiple Names to the same Site. \donttest{ library(mzion) +Vec <- c("Carbamidomethyl (M)", "Carbamyl (M)") +vec <- c("M", "M") +aas <- unlist(strsplit("HQGVMNVGMGQKMNS", "")) +ps <- c(2) +names(ps) <- c("M") +attr(Vec, "ps") <- ps +attr(Vec, "resids") <- vec +rs <- unique(vec) +inds <- lapply(rs, function (x) which(vec == x)) +attr(Vec, "inds") <- inds +mzion:::find_vmodposM(Vec, aas) +mzion:::find_vmodposM(Vec, aas, nmax = 1L) + Vec <- c("Carbamidomethyl (M)", "Deamidated (N)", "Carbamyl (M)") vec <- c("M", "N", "M") aas <- unlist(strsplit("HQGVMNVGMGQKMNS", "")) @@ -59,5 +72,8 @@ inds <- lapply(rs, function (x) which(vec == x)) attr(Vec, "inds") <- inds mzion:::find_vmodposM(Vec, aas) mzion:::find_vmodposM(Vec, aas, nmax = 1L) +mzion:::find_vmodposM(Vec, aas, nmax = 16L) +mzion:::find_vmodposM(Vec, aas, nmax = 8L) +lapply(1:32, function (x) mzion:::find_vmodposM(Vec, aas, nmax = x)) } } diff --git a/man/find_vmodposU.Rd b/man/find_vmodposU.Rd index 5c9c310..e06436f 100644 --- a/man/find_vmodposU.Rd +++ b/man/find_vmodposU.Rd @@ -7,16 +7,11 @@ find_vmodposU(M, aas, nmax = 64L) } \arguments{ -\item{M}{A matrix of labels of modification names with permutation. Each - permutation in a row. The corresponding matrix of site permutations in the - attribute of \code{resids}. - - Note that M is a matrix other than lists of vectors, which allows the - application of one copy of attributes to all rows.} +\item{M}{A vector of modifications.} \item{aas}{\code{aa_seq} split in a sequence of LETTERS.} -\item{nmax}{The maximum number of combinations.} +\item{nmax}{The maximum number of combinations being allowed.} } \description{ One-to-one correspondence between Names and Sites. Finds the positions of diff --git a/man/frames_adv.Rd b/man/frames_adv.Rd index dcd788f..5dabdf1 100644 --- a/man/frames_adv.Rd +++ b/man/frames_adv.Rd @@ -22,8 +22,8 @@ frames_adv( type_ms2ions = "by", maxn_vmods_per_pep = 5L, maxn_sites_per_vmod = 3L, - maxn_fnl_per_seq = 8L, - maxn_vnl_per_seq = 8L, + maxn_fnl_per_seq = 3L, + maxn_vnl_per_seq = 3L, maxn_vmods_sitescombi_per_pep = 64L, minn_ms2 = 6L, ppm_ms1 = 10L, @@ -90,10 +90,14 @@ default is 5.} greater.} \item{maxn_fnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for fixed modifications.} +permutative neutral losses per peptide sequence for fixed modifications. To +bypass the combinatorial of neutral losses, set \code{maxn_fnl_per_seq = 1} +or \code{0}.} \item{maxn_vnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for variable modifications.} +permutative neutral losses per peptide sequence for variable modifications. +To bypass the combinatorial of neutral losses, set \code{maxn_vnl_per_seq = +1} or \code{0}.} \item{maxn_vmods_sitescombi_per_pep}{A non-negative integer; the maximum number of combinatorial variable modifications per peptide sequence (per diff --git a/man/gen_ms2ions_base.Rd b/man/gen_ms2ions_base.Rd index 10ff31c..d0c6b17 100644 --- a/man/gen_ms2ions_base.Rd +++ b/man/gen_ms2ions_base.Rd @@ -176,10 +176,14 @@ default is 5.} greater.} \item{maxn_fnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for fixed modifications.} +permutative neutral losses per peptide sequence for fixed modifications. To +bypass the combinatorial of neutral losses, set \code{maxn_fnl_per_seq = 1} +or \code{0}.} \item{maxn_vnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for variable modifications.} +permutative neutral losses per peptide sequence for variable modifications. +To bypass the combinatorial of neutral losses, set \code{maxn_vnl_per_seq = +1} or \code{0}.} \item{maxn_vmods_sitescombi_per_pep}{A non-negative integer; the maximum number of combinatorial variable modifications per peptide sequence (per diff --git a/man/hms2match.Rd b/man/hms2match.Rd index 7abf11a..7f346cf 100644 --- a/man/hms2match.Rd +++ b/man/hms2match.Rd @@ -15,8 +15,8 @@ hms2match( type_ms2ions = "by", maxn_vmods_per_pep = 5L, maxn_sites_per_vmod = 3L, - maxn_fnl_per_seq = 64L, - maxn_vnl_per_seq = 64L, + maxn_fnl_per_seq = 3L, + maxn_vnl_per_seq = 3L, maxn_vmods_sitescombi_per_pep = 64L, minn_ms2 = 6L, ppm_ms1 = 10L, @@ -75,10 +75,14 @@ default is 5.} greater.} \item{maxn_fnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for fixed modifications.} +permutative neutral losses per peptide sequence for fixed modifications. To +bypass the combinatorial of neutral losses, set \code{maxn_fnl_per_seq = 1} +or \code{0}.} \item{maxn_vnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for variable modifications.} +permutative neutral losses per peptide sequence for variable modifications. +To bypass the combinatorial of neutral losses, set \code{maxn_vnl_per_seq = +1} or \code{0}.} \item{maxn_vmods_sitescombi_per_pep}{A non-negative integer; the maximum number of combinatorial variable modifications per peptide sequence (per diff --git a/man/matchMS.Rd b/man/matchMS.Rd index 1acbd76..924f48c 100644 --- a/man/matchMS.Rd +++ b/man/matchMS.Rd @@ -228,10 +228,14 @@ default is 5.} greater.} \item{maxn_fnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for fixed modifications.} +permutative neutral losses per peptide sequence for fixed modifications. To +bypass the combinatorial of neutral losses, set \code{maxn_fnl_per_seq = 1} +or \code{0}.} \item{maxn_vnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for variable modifications.} +permutative neutral losses per peptide sequence for variable modifications. +To bypass the combinatorial of neutral losses, set \code{maxn_vnl_per_seq = +1} or \code{0}.} \item{maxn_vmods_sitescombi_per_pep}{A non-negative integer; the maximum number of combinatorial variable modifications per peptide sequence (per diff --git a/man/mframes_adv.Rd b/man/mframes_adv.Rd index f1c47d7..5b62ad4 100644 --- a/man/mframes_adv.Rd +++ b/man/mframes_adv.Rd @@ -15,8 +15,8 @@ mframes_adv( type_ms2ions = "by", maxn_vmods_per_pep = 5L, maxn_sites_per_vmod = 3L, - maxn_fnl_per_seq = 64L, - maxn_vnl_per_seq = 64L, + maxn_fnl_per_seq = 3L, + maxn_vnl_per_seq = 3L, maxn_vmods_sitescombi_per_pep = 64L, minn_ms2 = 6L, ppm_ms1 = 10L, @@ -70,10 +70,14 @@ default is 5.} greater.} \item{maxn_fnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for fixed modifications.} +permutative neutral losses per peptide sequence for fixed modifications. To +bypass the combinatorial of neutral losses, set \code{maxn_fnl_per_seq = 1} +or \code{0}.} \item{maxn_vnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for variable modifications.} +permutative neutral losses per peptide sequence for variable modifications. +To bypass the combinatorial of neutral losses, set \code{maxn_vnl_per_seq = +1} or \code{0}.} \item{maxn_vmods_sitescombi_per_pep}{A non-negative integer; the maximum number of combinatorial variable modifications per peptide sequence (per diff --git a/man/ms2match.Rd b/man/ms2match.Rd index 580c1c2..e37ca85 100644 --- a/man/ms2match.Rd +++ b/man/ms2match.Rd @@ -82,10 +82,14 @@ default is 5.} greater.} \item{maxn_fnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for fixed modifications.} +permutative neutral losses per peptide sequence for fixed modifications. To +bypass the combinatorial of neutral losses, set \code{maxn_fnl_per_seq = 1} +or \code{0}.} \item{maxn_vnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for variable modifications.} +permutative neutral losses per peptide sequence for variable modifications. +To bypass the combinatorial of neutral losses, set \code{maxn_vnl_per_seq = +1} or \code{0}.} \item{maxn_vmods_sitescombi_per_pep}{A non-negative integer; the maximum number of combinatorial variable modifications per peptide sequence (per diff --git a/man/ms2match_all.Rd b/man/ms2match_all.Rd index 289fed0..3334938 100644 --- a/man/ms2match_all.Rd +++ b/man/ms2match_all.Rd @@ -16,8 +16,8 @@ ms2match_all( type_ms2ions = "by", maxn_vmods_per_pep = 5L, maxn_sites_per_vmod = 3L, - maxn_fnl_per_seq = 64L, - maxn_vnl_per_seq = 64L, + maxn_fnl_per_seq = 3L, + maxn_vnl_per_seq = 3L, maxn_vmods_sitescombi_per_pep = 64L, minn_ms2 = 6L, ppm_ms1 = 10L, @@ -77,10 +77,14 @@ default is 5.} greater.} \item{maxn_fnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for fixed modifications.} +permutative neutral losses per peptide sequence for fixed modifications. To +bypass the combinatorial of neutral losses, set \code{maxn_fnl_per_seq = 1} +or \code{0}.} \item{maxn_vnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for variable modifications.} +permutative neutral losses per peptide sequence for variable modifications. +To bypass the combinatorial of neutral losses, set \code{maxn_vnl_per_seq = +1} or \code{0}.} \item{maxn_vmods_sitescombi_per_pep}{A non-negative integer; the maximum number of combinatorial variable modifications per peptide sequence (per diff --git a/man/ms2match_one.Rd b/man/ms2match_one.Rd index d3ab4a3..e12efa7 100644 --- a/man/ms2match_one.Rd +++ b/man/ms2match_one.Rd @@ -17,8 +17,8 @@ ms2match_one( type_ms2ions = "by", maxn_vmods_per_pep = 5L, maxn_sites_per_vmod = 3L, - maxn_fnl_per_seq = 8L, - maxn_vnl_per_seq = 8L, + maxn_fnl_per_seq = 3L, + maxn_vnl_per_seq = 3L, maxn_vmods_sitescombi_per_pep = 64L, minn_ms2 = 6L, ppm_ms1 = 10L, @@ -80,10 +80,14 @@ default is 5.} greater.} \item{maxn_fnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for fixed modifications.} +permutative neutral losses per peptide sequence for fixed modifications. To +bypass the combinatorial of neutral losses, set \code{maxn_fnl_per_seq = 1} +or \code{0}.} \item{maxn_vnl_per_seq}{A non-negative integer; the maximum number of -permutative neutral losses per peptide sequence for variable modifications.} +permutative neutral losses per peptide sequence for variable modifications. +To bypass the combinatorial of neutral losses, set \code{maxn_vnl_per_seq = +1} or \code{0}.} \item{maxn_vmods_sitescombi_per_pep}{A non-negative integer; the maximum number of combinatorial variable modifications per peptide sequence (per