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
19 changes: 19 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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
- [ ] I have run the devtools::document() command after my changes and committed the added files
18 changes: 18 additions & 0 deletions .github/workflows/dry-run-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ BugReports: https://github.com/Vitek-Lab/MSstatsLiP/issues
Encoding: UTF-8
LazyData: TRUE
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
4 changes: 2 additions & 2 deletions R/MSstatsLiP.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
#' coverage.
#' }
#'
#' @docType package
#' @name MSstatsLiP
NULL
#' @keywords internal
"_PACKAGE"
50 changes: 32 additions & 18 deletions R/SpectronauttoMSstatsLiPFormat.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Converts raw LiP MS data from Spectronautt into the format needed for
#' Converts raw LiP MS data from Spectronaut into the format needed for
#' MSstatsLiP.
#'
#' Takes as as input both raw LiP and Trp outputs from Spectronautt.
#' Takes as as input both raw LiP and Trp outputs from Spectronaut.
#'
#' @export
#' @importFrom MSstats SpectronauttoMSstatsFormat
Expand Down Expand Up @@ -143,26 +143,40 @@ SpectronauttoMSstatsLiPFormat <- function(LiP.data,

getOption("MSstatsLog")("INFO", "Formatting LiP data..")
## MSstats process
df.lip <- SpectronauttoMSstatsFormat(LiP.data, annotation, intensity,
filter_with_Qvalue, qvalue_cutoff,
useUniquePeptide, removeFewMeasurements,
removeProtein_with1Feature,
summaryforMultipleRows, use_log_file,
append, verbose, log_file_path = path,
base)
df.lip <- SpectronauttoMSstatsFormat(
LiP.data,
annotation = annotation,
intensity = intensity,
filter_with_Qvalue = filter_with_Qvalue,
qvalue_cutoff = qvalue_cutoff,
useUniquePeptide = useUniquePeptide,
removeFewMeasurements = removeFewMeasurements,
removeProtein_with1Feature = removeProtein_with1Feature,
summaryforMultipleRows = summaryforMultipleRows,
use_log_file = use_log_file,
append = append,
verbose = verbose,
log_file_path = path
)
df.lip <- as.data.table(as.matrix(df.lip))
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Critical: as.matrix coerces all columns to character; breaks downstream numeric ops.

as.data.table(as.matrix(df.lip)) converts numerics (e.g., Intensity) to character, making <= 1 comparisons and merges unreliable.

Apply:

-  df.lip <- as.data.table(as.matrix(df.lip))
+  df.lip <- as.data.table(df.lip)
📝 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
df.lip <- as.data.table(as.matrix(df.lip))
df.lip <- as.data.table(df.lip)
🤖 Prompt for AI Agents
In R/SpectronauttoMSstatsLiPFormat.R around line 161, the call
as.data.table(as.matrix(df.lip)) coerces all columns to character (breaking
numeric comparisons and merges); replace it by converting the data.frame
directly to data.table (as.data.table(df.lip)) or, if df.lip is a list/mixed
type, build the data.table and explicitly convert numeric columns back using
something like dt[, (numCols) := lapply(.SD, as.numeric), .SDcols = numCols]
where numCols includes Intensity and any other numeric fields required
downstream. Ensure the resulting data.table preserves numeric types before any
<= or numeric merges.

if (!is.null(Trp.data)){

getOption("MSstatsLog")("INFO", "Formatting TrP data..")
df.trp <- SpectronauttoMSstatsFormat(as.data.frame(Trp.data), annotation,
intensity,
filter_with_Qvalue, qvalue_cutoff,
useUniquePeptide,
removeFewMeasurements,
removeProtein_with1Feature,
summaryforMultipleRows, use_log_file,
append, verbose, log_file_path = path,
base)
df.trp <- SpectronauttoMSstatsFormat(
as.data.frame(Trp.data),
annotation = annotation,
intensity = intensity,
filter_with_Qvalue = filter_with_Qvalue,
qvalue_cutoff = qvalue_cutoff,
useUniquePeptide = useUniquePeptide,
removeFewMeasurements = removeFewMeasurements,
removeProtein_with1Feature = removeProtein_with1Feature,
summaryforMultipleRows = summaryforMultipleRows,
use_log_file = use_log_file,
append = append,
verbose = verbose,
log_file_path = path
)
Comment on lines +167 to +180
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Repeat the same fix for TrP path.

Avoid character coercion for TrP as well.

-    df.trp <- as.data.table(as.matrix(df.trp))
+    df.trp <- as.data.table(df.trp)
📝 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
as.data.frame(Trp.data),
annotation = annotation,
intensity = intensity,
filter_with_Qvalue = filter_with_Qvalue,
qvalue_cutoff = qvalue_cutoff,
useUniquePeptide = useUniquePeptide,
removeFewMeasurements = removeFewMeasurements,
removeProtein_with1Feature = removeProtein_with1Feature,
summaryforMultipleRows = summaryforMultipleRows,
use_log_file = use_log_file,
append = append,
verbose = verbose,
log_file_path = path
)
df.trp <- as.data.table(df.trp)
🤖 Prompt for AI Agents
In R/SpectronauttoMSstatsLiPFormat.R around lines 166 to 179, repeat the same
fix applied to the Trp path for the TrP path: stop coercing TrP into characters
by removing the direct as.data.frame(Trp.data) call passed into the function and
instead ensure TrP is a proper data.frame before the call (e.g., if not already
a data.frame, convert it with as.data.frame(TrP.data, stringsAsFactors =
FALSE)), then pass the TrP data.frame variable as-is to avoid character
coercion.

df.trp <- as.data.table(as.matrix(df.trp))
}

Expand Down
5 changes: 4 additions & 1 deletion man/MSstatsLiP.Rd

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

4 changes: 2 additions & 2 deletions man/SpectronauttoMSstatsLiPFormat.Rd

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

Loading