Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/.DS_Store
Binary file not shown.
18 changes: 18 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Motivation and Context

Please include relevant motivation and context of the problem along with a short summary of the solution.

## Changes

Please provide a detailed bullet point list of your changes.

-

## Testing

Please describe any unit tests you added or modified to verify your changes.

## Checklist Before Requesting a Review
- [ ] I have read the MSstats [contributing guidelines](https://github.com/Vitek-Lab/MSstatsConvert/blob/master/.github/CONTRIBUTING.md)
- [ ] My changes generate no new warnings
- [ ] Any dependent changes have been merged and published in downstream modules
19 changes: 19 additions & 0 deletions .github/workflows/dry-run-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Dry runs for PRs
on:
pull_request:
branches: [devel]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup R and Bioconductor
uses: grimbough/bioc-actions/setup-bioc@v1
with:
bioc-version: devel
- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
- name: Build, Install, Check
uses: grimbough/bioc-actions/build-install-check@v1

10 changes: 7 additions & 3 deletions R/clean_DIANN.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ cleanDIANNChunk = function(input, output_path, MBR, quantificationColumn, pos,
qvalue_cutoff = 0.01,
pg_qvalue_cutoff = 0.01) {
input = MSstatsImport(list(input = input),
"MSstats", "DIANN")
"MSstats", "DIANN")
input = MSstatsClean(
input, MBR, quantificationColumn
#Todo: Add , global_qvalue_cutoff, qvalue_cutoff, pg_qvalue_cutoff params
input,
MBR = MBR,
quantificationColumn = quantificationColumn,
global_qvalue_cutoff = global_qvalue_cutoff,
qvalue_cutoff = qvalue_cutoff,
pg_qvalue_cutoff = pg_qvalue_cutoff
)
.writeChunkToFile(input, output_path, pos)
NULL
Expand Down
11 changes: 6 additions & 5 deletions R/converters.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,7 @@ bigSpectronauttoMSstatsFormat <- function(input_file, output_file_name,
#' Convert out-of-memory DIANN files to MSstats format.
#'
#' @inheritParams MSstatsPreprocessBig
#' @param MBR True if analysis was done with match between runs.
#' @param quantificationColumn Use 'FragmentQuantCorrected'(default) column for quantified intensities for DIANN 1.8.x.
#' Use 'FragmentQuantRaw' for quantified intensities for DIANN 1.9.x.
#' Use 'auto' for quantified intensities for DIANN 2.0+
#' @inheritParams MSstatsConvert::DIANNtoMSstatsFormat
#'
#' @export
#'
Expand All @@ -173,6 +170,9 @@ bigDIANNtoMSstatsFormat <- function(input_file,
backend,
MBR = TRUE,
quantificationColumn = "FragmentQuantCorrected",
global_qvalue_cutoff = 0.01,
qvalue_cutoff = 0.01,
pg_qvalue_cutoff = 0.01,
max_feature_count = 100,
filter_unique_peptides = FALSE,
aggregate_psms = FALSE,
Expand All @@ -186,7 +186,8 @@ bigDIANNtoMSstatsFormat <- function(input_file,
reduceBigDIANN(input_file,
paste0("reduce_output_", output_file_name),
MBR,
quantificationColumn)
quantificationColumn,
global_qvalue_cutoff, qvalue_cutoff, pg_qvalue_cutoff)
Comment on lines 186 to +190
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Use file.path() for intermediate file path construction.

paste0("reduce_output_", output_file_name) will produce a broken path when output_file_name contains directory components (e.g., "results/output.csv""reduce_output_results/output.csv"). Both references (lines 187 and 194) should be fixed.

🐛 Proposed fix
-  reduceBigDIANN(input_file, 
-                 paste0("reduce_output_", output_file_name),
+  intermediate_file <- file.path(dirname(output_file_name),
+                                 paste0("reduce_output_", basename(output_file_name)))
+  reduceBigDIANN(input_file, 
+                 intermediate_file,
                  MBR,
                  quantificationColumn,
                  global_qvalue_cutoff, qvalue_cutoff, pg_qvalue_cutoff)
  
   # Preprocess the cleaned data (feature selection, etc.)
   msstats_data <- MSstatsPreprocessBig(
-    paste0("reduce_output_", output_file_name),
+    intermediate_file,
     output_file_name, backend, max_feature_count,

Based on learnings: "In R converters across the MSstatsBig package, replace direct concatenation with file names by constructing intermediate file paths using file.path(dirname(output_file_name), paste0("prefix_", basename(output_file_name))). This ensures the intermediate file is created in the correct directory even when output_file_name contains directories."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
reduceBigDIANN(input_file,
paste0("reduce_output_", output_file_name),
MBR,
quantificationColumn)
quantificationColumn,
global_qvalue_cutoff, qvalue_cutoff, pg_qvalue_cutoff)
intermediate_file <- file.path(dirname(output_file_name),
paste0("reduce_output_", basename(output_file_name)))
reduceBigDIANN(input_file,
intermediate_file,
MBR,
quantificationColumn,
global_qvalue_cutoff, qvalue_cutoff, pg_qvalue_cutoff)
🤖 Prompt for AI Agents
In `@R/converters.R` around lines 186 - 190, The intermediate output path is built
by concatenating strings which breaks when output_file_name contains
directories; update the calls around reduceBigDIANN to construct the path with
file.path(dirname(output_file_name), paste0("reduce_output_",
basename(output_file_name))) (and the analogous construct used at the other
occurrence on line ~194) so the intermediate file is created in the same
directory as output_file_name; change both references to use dirname(...) and
basename(...) wrapped with file.path(...) instead of paste0("reduce_output_",
output_file_name).


# Preprocess the cleaned data (feature selection, etc.)
msstats_data <- MSstatsPreprocessBig(
Expand Down
22 changes: 19 additions & 3 deletions man/bigDIANNtoMSstatsFormat.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.