Skip to content

Commit

Permalink
v1.2.4
Browse files Browse the repository at this point in the history
Added a Percolator feature.
  • Loading branch information
qzhang503 committed Apr 24, 2023
1 parent d2ca103 commit b3d4702
Show file tree
Hide file tree
Showing 99 changed files with 1,589 additions and 717 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Imports:
data.table,
digest,
dplyr,
e1071,
fastmatch,
ggplot2,
purrr,
Expand Down
10 changes: 5 additions & 5 deletions R/batchMS2.R
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ hbatch_ms2ions <- function (ms1_time = NULL, type_ms2ions = "by",
c("gen_ms2ions_base",
"ms2ions_by_type",
"byions", "czions", "axions"),
envir = environment(mzion:::gen_ms2ions_base)
envir = environment(mzion::matchMS)
)

ms2s <- parallel::clusterApply(
Expand Down Expand Up @@ -237,7 +237,7 @@ hbatch_ms2ions <- function (ms1_time = NULL, type_ms2ions = "by",
"gen_ms2ions_base",
"ms2ions_by_type",
"byions", "czions", "axions"),
envir = environment(mzion:::gen_ms2ions_a0_vnl0_fnl1)
envir = environment(mzion::matchMS)
)

ms2s <- parallel::clusterApply(
Expand Down Expand Up @@ -316,7 +316,7 @@ hbatch_ms2ions <- function (ms1_time = NULL, type_ms2ions = "by",
"ms2ions_by_type",
"byions", "czions", "axions",
"add_hexcodes"),
envir = environment(mzion:::gen_ms2ions_a1_vnl0_fnl0)
envir = environment(mzion::matchMS)
)

ms2s <- parallel::clusterApply(
Expand Down Expand Up @@ -395,7 +395,7 @@ hbatch_ms2ions <- function (ms1_time = NULL, type_ms2ions = "by",
"ms2ions_by_type",
"byions", "czions", "axions",
"add_hexcodes_vnl2"),
envir = environment(mzion:::gen_ms2ions_a1_vnl1_fnl0)
envir = environment(mzion::matchMS)
)

ms2s <- parallel::clusterApply(
Expand Down Expand Up @@ -475,7 +475,7 @@ hbatch_ms2ions <- function (ms1_time = NULL, type_ms2ions = "by",
"ms2ions_by_type",
"byions", "czions", "axions",
"add_hexcodes_fnl2"),
envir = environment(mzion:::gen_ms2ions_a1_vnl0_fnl1)
envir = environment(mzion::matchMS)
)

ms2s <- parallel::clusterApply(
Expand Down
4 changes: 2 additions & 2 deletions R/bin_masses.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ bin_ms1masses <- function (res = NULL, min_mass = 200L, max_mass = 4500L,
"binTheoSeqs2",
"bin_theoseqs",
"find_ms1_cutpoints"),
envir = environment(mzion:::binTheoSeqs_i))
envir = environment(mzion::matchMS))

# No need of flatten() as saveRDS by INDIVIDUAL idx (and return NULL)
parallel::clusterApplyLB(
Expand Down Expand Up @@ -320,7 +320,7 @@ binTheoSeqs <- function (idxes = NULL, res = NULL, min_mass = 200L,
parallel::clusterExport(cl, list("qread", "qsave"), envir = environment(qs::qsave))

parallel::clusterExport(cl, c("bin_theoseqs", "find_ms1_cutpoints"),
envir = environment(mzion:::bin_theoseqs))
envir = environment(mzion::matchMS))

out <- parallel::clusterMap(cl, bin_theoseqs,
res, file.path(out_dir, out_nms),
Expand Down
25 changes: 13 additions & 12 deletions R/funs.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
# $funs.R
# character(0)
#
# $hello.R
# [1] "hello"
#
# $ion_ladder.R
# [1] "ms2ions_by_type" "byions" "czions" "axions" "bions_base" "yions_base"
# [7] "b2ions_base" "bstarions" "bstar2ions" "b0ions" "b02ions" "y2ions"
Expand All @@ -32,7 +29,7 @@
# [1] "mapMS2ions" "match_mgf_path" "match_raw_id" "add_raw_ids"
# [5] "find_secion_types" "find_psm_rows" "find_psm_rows1" "find_psm_rows2"
# [9] "find_theoexpt_pair" "find_mgf_query" "combine_prisec_matches" "check_existed_psms"
# [13] "get_mzion_coltypes"
# [13] "get_mzion_coltypes"
#
# $mgfs.R
# [1] "load_mgfs" "readMGF" "post_readmgf" "readlineMGFs" " f"
Expand Down Expand Up @@ -81,11 +78,14 @@
# $msmsmatches2.R
# [1] "ms2match" "hcalc_tmtint" "reverse_peps_in_frame" "reverse_seqs" "calib_ms1masses"
#
# $mzion.R
# character(0)
#
# $mztab.R
# [1] "make_mztab"
#
# $mzion.R
# character(0)
# $percolator.R
# [1] "creat_folds" "cv_svm" "perco_svm" "probco_bypepcharge" "calc_z_pepfdr"
#
# $quant2.R
# [1] "calc_tmtint" "add_rptrs" "find_reporter_ints" "find_reporters_ppm" "msub_protpep"
Expand All @@ -101,12 +101,13 @@
# [5] "calc_probi" "scalc_pepprobs" "calc_pepprobs_i" "calc_pepscores"
# [9] "find_decoy" "find_targets" "calcpepsc" "add_primatches"
# [13] "collapse_vecs" "post_pepscores" "find_pepscore_co1" "find_pepscore_co2"
# [17] "probco_bypeplen" "find_optlens" "find_probco_valley" "calc_pepfdr"
# [21] "fill_probco_nas" "fill_probs" "post_pepfdr" "calc_protfdr"
# [25] "aggr_prot_es" "calc_protfdr_i" "fit_protfdr" " f"
# [29] "find_ppm_outer_bycombi" "match_ex2th2" "calc_peploc" "calcpeprank_1"
# [33] "calcpeprank_2" "calcpeprank_3" "find_chunkbreaks" "findLocFracsDF"
# [37] "concatFracs" "na.interp" "is.constant" "tsoutliers"
# [17] "probco_bypeplen" "sub_td_byfdrtype" "find_optlens" "find_probco_valley"
# [21] "prep_pepfdr_td" "keep_pepfdr_best" "calc_pepfdr" "fill_probco_nas"
# [25] "fill_probs" "post_pepfdr" "calc_protfdr" "aggr_prot_es"
# [29] "calc_protfdr_i" "fit_protfdr" " f" "find_ppm_outer_bycombi"
# [33] "match_ex2th2" "calc_peploc" "calcpeprank_1" "calcpeprank_2"
# [37] "calcpeprank_3" "find_chunkbreaks" "findLocFracsDF" "concatFracs"
# [41] "na.interp" "is.constant" "tsoutliers"
#
# $silac.R
# [1] "matchMS_silac_mix" "matchMS_par_groups" "add_fixedlab_masses" "matchMS_noenzyme" "combine_ion_matches"
Expand Down
2 changes: 1 addition & 1 deletion R/mgfs.R
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ read_mgf_chunks <- function (filepath = "~/mzion/mgf/temp_1",
"index_mz",
"integerize_ms2ints",
"find_ms1_interval"),
envir = environment(mzion:::proc_mgf_chunks)
envir = environment(mzion::matchMS)
)

out <- parallel::clusterApply(cl, file.path(filepath, filelist),
Expand Down
18 changes: 9 additions & 9 deletions R/ms1_precursors.R
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ calc_pepmasses2 <- function (aa_masses = NULL,
c("hsemipeps_byprots",
"semipeps_byprots",
"calc_semipepmasses"),
envir = environment(mzion:::calc_semipepmasses)
envir = environment(mzion::matchMS)
)

fwd_peps <- parallel::clusterApply(
Expand Down Expand Up @@ -383,7 +383,7 @@ calc_pepmasses2 <- function (aa_masses = NULL,
"ct_counts",
"rm_char_in_nfirst",
"rm_char_in_nlast"),
envir = environment(mzion:::distri_peps)
envir = environment(mzion::matchMS)
)

# aa_masses_all[[1]] is for the original all-fixed mode not for the coerced,
Expand Down Expand Up @@ -423,7 +423,7 @@ calc_pepmasses2 <- function (aa_masses = NULL,
cl <- parallel::makeCluster(getOption("cl.cores", n_cores))

parallel::clusterExport(cl, c("simple_prots_peps"),
envir = environment(mzion:::simple_prots_peps))
envir = environment(mzion::matchMS))

prps <- parallel::clusterApply(
cl,
Expand Down Expand Up @@ -538,7 +538,7 @@ calc_pepmasses2 <- function (aa_masses = NULL,
"ms1_a0_vnl0_fnl1",
"expand_grid_rows",
"delta_ms1_a0_fnl1"),
envir = environment(mzion:::ms1_a0_vnl0_fnl1))
envir = environment(mzion::matchMS))

fwd_peps[[i]] <- parallel::clusterApply(
cl,
Expand Down Expand Up @@ -602,7 +602,7 @@ calc_pepmasses2 <- function (aa_masses = NULL,
"expand_grid_rows",
"recur_flatten",
"delta_ms1_a0_fnl1"),
envir = environment(mzion:::ms1_a1_vnl0_fnl0))
envir = environment(mzion::matchMS))

for (i in inds) {
amods_i <- amods[[i]]
Expand Down Expand Up @@ -1924,7 +1924,7 @@ split_fastaseqs <- function (fasta = NULL, enzyme = "trypsin_p",
cl,
c("make_fastapeps0",
"keep_n_misses"),
envir = environment(mzion:::make_fastapeps0))
envir = environment(mzion::matchMS))

# ---
message("Splitting fasta sequences.")
Expand Down Expand Up @@ -2157,7 +2157,7 @@ split_fastaseqs_noenz <- function (fasta = NULL, acc_type = "uniprot_acc",
"mmake_noenzpeps",
"hmake_noenzpeps",
"ms1masses_bare_noenz"),
envir = environment(mzion:::make_noenzpeps))
envir = environment(mzion::matchMS))

peps <- parallel::clusterApply(cl, chunksplit(fasta_db, n_cores),
mmake_noenzpeps,
Expand Down Expand Up @@ -2657,7 +2657,7 @@ ms1masses_bare <- function (seqs = NULL, aa_masses = NULL, ftmass = NULL,
cl <- parallel::makeCluster(getOption("cl.cores", n_cores))

parallel::clusterExport(cl, c("roll_sum", "accumulate_char"),
envir = environment(mzion:::roll_sum))
envir = environment(mzion::matchMS))

ms_1 <- parallel::clusterApply(
cl = cl,
Expand Down Expand Up @@ -2775,7 +2775,7 @@ ms1masses_noterm <- function (aa_seqs, aa_masses, maxn_vmods_per_pep = 5L,
c("calcms1mass_noterm",
"calcms1mass_noterm_byprot",
"calcms1mass_noterm_bypep"),
envir = environment(mzion:::calcms1mass_noterm))
envir = environment(mzion::matchMS))

out <- parallel::clusterApply(cl, aa_seqs, calcms1mass_noterm,
aa_masses = aa_masses,
Expand Down
3 changes: 2 additions & 1 deletion R/ms2_a0_vnl0_fnl1.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ ms2match_a0_vnl0_fnl1 <- function (i, aa_masses, ms1vmods, ms2vmods,
"gen_ms2ions_a0_vnl0_fnl1",
"expand_grid_rows",
"gen_ms2ions_base",
"calc_rev_ms2",
"ms2ions_by_type",
"byions", "czions", "axions",
"bions_base", "yions_base",
Expand All @@ -51,7 +52,7 @@ ms2match_a0_vnl0_fnl1 <- function (i, aa_masses, ms1vmods, ms2vmods,
"fuzzy_match_one",
"fuzzy_match_one2",
"post_frame_adv"),
envir = environment(mzion:::frames_adv)
envir = environment(mzion::matchMS)
)

out <- parallel::clusterMap(
Expand Down
3 changes: 2 additions & 1 deletion R/ms2_a1_vnl0_fnl0.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ ms2match_a1_vnl0_fnl0 <- function (i, aa_masses, ms1vmods, ms2vmods,
cl,
c("frames_adv",
"gen_ms2ions_a1_vnl0_fnl0",
"calc_rev_ms2",
"match_mvmods",
"expand_grid_rows",
"find_vmodscombi",
Expand All @@ -63,7 +64,7 @@ ms2match_a1_vnl0_fnl0 <- function (i, aa_masses, ms1vmods, ms2vmods,
"fuzzy_match_one",
"fuzzy_match_one2",
"post_frame_adv"),
envir = environment(mzion:::frames_adv)
envir = environment(mzion::matchMS)
)

out <- parallel::clusterMap(
Expand Down
3 changes: 2 additions & 1 deletion R/ms2_a1_vnl0_fnl1.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ ms2match_a1_vnl0_fnl1 <- function (i, aa_masses, ms1vmods, ms2vmods,
c("frames_adv",
"gen_ms2ions_a1_vnl0_fnl1",
"gen_ms2ions_a1_vnl0_fnl0",
"calc_rev_ms2",
"match_mvmods",
"expand_grid_rows",
"find_vmodscombi",
Expand All @@ -69,7 +70,7 @@ ms2match_a1_vnl0_fnl1 <- function (i, aa_masses, ms1vmods, ms2vmods,
"fuzzy_match_one",
"fuzzy_match_one2",
"post_frame_adv"),
envir = environment(mzion:::frames_adv)
envir = environment(mzion::matchMS)
)

out <- parallel::clusterMap(
Expand Down
3 changes: 2 additions & 1 deletion R/ms2_a1_vnl1_fnl0.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ms2match_a1_vnl1_fnl0 <- function (i, aa_masses, ms1vmods, ms2vmods,
cl,
c("frames_adv",
"gen_ms2ions_a1_vnl1_fnl0",
"calc_rev_ms2",
"match_mvmods",
"expand_grid_rows",
"find_vmodscombi",
Expand All @@ -66,7 +67,7 @@ ms2match_a1_vnl1_fnl0 <- function (i, aa_masses, ms1vmods, ms2vmods,
"fuzzy_match_one",
"fuzzy_match_one2",
"post_frame_adv"),
envir = environment(mzion:::frames_adv)
envir = environment(mzion::matchMS)
)

out <- parallel::clusterMap(
Expand Down
3 changes: 2 additions & 1 deletion R/ms2_base.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ ms2match_base <- function (i, aa_masses, ms1vmods, ms2vmods, ntmass, ctmass,
cl,
c("frames_adv",
"gen_ms2ions_base",
"calc_rev_ms2",
"ms2ions_by_type",
"byions", "czions", "axions",
"bions_base", "yions_base",
Expand All @@ -61,7 +62,7 @@ ms2match_base <- function (i, aa_masses, ms1vmods, ms2vmods, ntmass, ctmass,
"fuzzy_match_one",
"fuzzy_match_one2",
"post_frame_adv"),
envir = environment(mzion:::frames_adv)
envir = environment(mzion::matchMS)
)

out <- parallel::clusterMap(
Expand Down
Loading

0 comments on commit b3d4702

Please sign in to comment.