Skip to content

Commit

Permalink
Candidate release
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Drucker committed Aug 12, 2024
1 parent 8961f68 commit 09e825d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions R/read_MSstats_from_MSFragger_job.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#' if (is_PNNL_DMS_connection_successful()) {
#' msnset <- read_MSstats_from_MSFragger_job(
#' data_package_num = 4938,
#' param_file = "MSFragger_Tryp_Dyn_MetOx_ProtNTermAcet_StatCysAlk_20ppmParTol.params",
#' param_file = "MSFragger_Tryp_Dyn_MetOx_ProtNTermAcet_Stat_CysAlk_20ppmParTol.params",
#' settings_file = "MSFragger_MatchBetweenRuns_Java80GB.xml",
#' organism_db = "ID_008026_7A1842EC.fasta")
#' show(msnset)
Expand All @@ -40,8 +40,7 @@ read_MSstats_from_MSFragger_job <- function(data_package_num,
settings_file = NULL,
organism_db = NULL)
{
job_records <-
PNNL.DMS.utils::get_job_records_by_dataset_package(data_package_num)
job_records <- get_job_records_by_dataset_package(data_package_num)

# add filters on tool, parameter file and setting file
job_records <- filter(job_records, tool == "MSFragger")
Expand All @@ -59,7 +58,12 @@ read_MSstats_from_MSFragger_job <- function(data_package_num,
}

path <- unique(job_records$folder)

remote_folder <- gsub("\\\\", "/", path)
mount_folder <- local_folder <- .new_tempdir()
mount_cmd <- sprintf("mount -t smbfs %s %s", remote_folder, local_folder)
system(mount_cmd)
on.exit(system(glue::glue("umount {mount_folder}")))

if (length(path) == 0) {
stop("No jobs found.")
}
Expand All @@ -69,8 +73,7 @@ read_MSstats_from_MSFragger_job <- function(data_package_num,
"Please refine the arguments to make sure they uniquely",
" define the MSFragger job."))
}

path_to_file <- file.path(path, "MSstats.csv")
path_to_file <- file.path(local_folder, "MSstats.csv")

if (!file.exists(path_to_file)) {
stop(sprintf("MSstats.csv file not found in %s", path))
Expand Down
2 changes: 1 addition & 1 deletion R/read_msfragger_data_from_DMS.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ read_msfragger_data_from_DMS <- function(data_package_num,
mount_folder <- local_folder <- .new_tempdir()
mount_cmd <- sprintf("mount -t smbfs %s %s", remote_folder, local_folder)
system(mount_cmd)
on.exit(system(glue::glue("umount {mount_folder}")))

if (length(path) == 0) {
stop("No jobs found.")
Expand Down Expand Up @@ -108,7 +109,6 @@ read_msfragger_data_from_DMS <- function(data_package_num,
`Spectrum File` = sub("\\.pep\\.xml", "", `Spectrum File`),
`Spectrum File` = sub(fileNamePttrn, "", `Spectrum File`))

system(glue::glue("umount {mount_folder}"))

if (!assume_inference) {
dt <- dt %>%
Expand Down

0 comments on commit 09e825d

Please sign in to comment.