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
5 changes: 4 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# Generated by roxygen2: do not edit by hand

export(MSstatsPrepareDoseResponseFit)
export(calculatePeptideWeights)
export(calculateTurnoverRatios)
export(convertGroupToNumericDose)
export(doseResponseFit)
export(futureExperimentSimulation)
export(plot_tpr_power_curve)
export(predictIC50)
export(predictIC50Parallel)
export(selectTopNPeptides)
export(run_tpr_simulation)
export(visualizeResponseProtein)
import(dplyr)
importFrom(BiocParallel,bplapply)
importFrom(BiocParallel,bpparam)
importFrom(data.table,rbindlist)
importFrom(dplyr,across)
importFrom(dplyr,all_of)
importFrom(dplyr,arrange)
importFrom(dplyr,distinct)
importFrom(dplyr,filter)
Expand Down Expand Up @@ -55,6 +57,7 @@ importFrom(parallel,stopCluster)
importFrom(plotly,ggplotly)
importFrom(plotly,layout)
importFrom(stats,approx)
importFrom(stats,cor)
importFrom(stats,p.adjust)
importFrom(stats,pf)
importFrom(stats,quantile)
Expand Down
2 changes: 2 additions & 0 deletions R/Visualize_Isotonic_Fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
#' print(plot2)
#'
#' # Example 3: Color points by replicate
#' \dontrun{
#' plot3 <- visualizeResponseProtein(
#' data = prepared_data,
#' protein_name = "PROTEIN_A",
Expand All @@ -74,6 +75,7 @@
#' color_by = "replicate"
#' )
#' print(plot3)
#' }
#'
#' @export
visualizeResponseProtein = function(data,
Expand Down
6 changes: 5 additions & 1 deletion R/protein_turnover_ratio_helper.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#' @return Data frame with columns: Protein, BaseSequence, TimeVal, Run, Heavy, Light, Total, H_frac, L_frac
#'
#' @examples
#' \dontrun{
#' # Basic usage - all proteins, all peptides
#' ratios <- calculateTurnoverRatios(
#' feature_data = quant_data$FeatureLevelData
Expand Down Expand Up @@ -59,6 +60,7 @@
#'
#' # Filter for specific protein after calculation
#' protein_ratios <- ratios %>% filter(Protein == "A0A2K5TXF6")
#' }
#'
#' @export
#' @importFrom dplyr filter mutate group_by summarise arrange slice_head pull ungroup select rename
Expand Down Expand Up @@ -163,7 +165,7 @@ calculateTurnoverRatios <- function(
#' @return Numeric vector of hours
#'
#' @examples
#' parse_timepoint(c("0hr", "1hr", "12hrs", "168hrs"))
#' MSstatsResponse:::parse_timepoint(c("0hr", "1hr", "12hrs", "168hrs"))
#' # Returns: 0 1 12 168
#'
#' @keywords internal
Expand Down Expand Up @@ -205,6 +207,7 @@ parse_timepoint <- function(time_strings) {
#' - weight: Combined quality weight (product of all components)
#'
#' @examples
#' \dontrun{
#' # Calculate ratios first
#' ratios <- calculateTurnoverRatios(feature_data)
#'
Expand All @@ -226,6 +229,7 @@ parse_timepoint <- function(time_strings) {
#'
#' # Use stricter validity threshold
#' ratios_weighted_strict <- calculatePeptideWeights(ratios, validity_threshold = 1.0)
#' }
#'
#' @export
#' @importFrom dplyr group_by mutate ungroup across all_of
Expand Down
75 changes: 75 additions & 0 deletions man/calculatePeptideWeights.Rd

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

2 changes: 2 additions & 0 deletions man/calculateTurnoverRatios.Rd

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

1 change: 0 additions & 1 deletion man/doseResponseFit.Rd

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

2 changes: 1 addition & 1 deletion man/parse_timepoint.Rd

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

27 changes: 0 additions & 27 deletions man/selectTopNPeptides.Rd

This file was deleted.

2 changes: 2 additions & 0 deletions man/visualizeResponseProtein.Rd

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

20 changes: 13 additions & 7 deletions tests/testthat/test-IC50_prediction.R
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,12 @@ test_that(".calcSingleIC50 handles single protein-drug pair", {
bootstrap = FALSE,
prot = "TestProtein",
drug_type = "TestDrug",
target_response = 0.5
target_response = 0.5,
precalculated_ratios = FALSE
)

expect_s3_class(result, "data.frame")
expect_named(result, c("protein", "drug", "IC50", "IC50_lower_bound", "IC50_upper_bound"))
expect_named(result, c("protein", "drug", "IC50", "IC50_lower_bound", "IC50_upper_bound", "direction"))
expect_equal(result$protein, "TestProtein")
expect_equal(result$drug, "TestDrug")
})
Expand All @@ -217,7 +218,8 @@ test_that(".calcSingleIC50 handles bootstrap option", {
bootstrap = FALSE,
prot = "P1",
drug_type = "D1",
target_response = 0.5
target_response = 0.5,
precalculated_ratios = FALSE
)

expect_true(is.na(result_no_boot$IC50_lower_bound))
Expand All @@ -234,7 +236,8 @@ test_that(".calcSingleIC50 handles bootstrap option", {
bootstrap = TRUE,
prot = "P1",
drug_type = "D1",
target_response = 0.5
target_response = 0.5,
precalculated_ratios = FALSE
)

expect_false(is.na(result_boot$IC50_lower_bound))
Expand All @@ -257,7 +260,8 @@ test_that(".calcSingleIC50 handles ratio vs log scale", {
bootstrap = FALSE,
prot = "P1",
drug_type = "D1",
target_response = 0.5
target_response = 0.5,
precalculated_ratios = FALSE
)

result_log <- .calcSingleIC50(
Expand All @@ -270,7 +274,8 @@ test_that(".calcSingleIC50 handles ratio vs log scale", {
bootstrap = FALSE,
prot = "P1",
drug_type = "D1",
target_response = 0.5
target_response = 0.5,
precalculated_ratios = FALSE
)

# Results should be different
Expand All @@ -295,7 +300,8 @@ test_that(".calcSingleIC50 handles failed fits", {
bootstrap = FALSE,
prot = "P1",
drug_type = "D1",
target_response = 0.5
target_response = 0.5,
precalculated_ratios = FALSE
)
})

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-PredictIC50.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test_that("predictIC50 returns correct structure", {
})

expect_s3_class(results, "data.frame")
expect_named(results, c("protein", "drug", "IC50", "IC50_lower_bound", "IC50_upper_bound"))
expect_named(results, c("protein", "drug", "IC50", "IC50_lower_bound", "IC50_upper_bound", "direction"))
expect_equal(nrow(results), 3) # 3 proteins
})

Expand Down
2 changes: 1 addition & 1 deletion vignettes/MSstatsResponse.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ dia_prepared <- MSstatsPrepareDoseResponseFit(
drug_column = "drug",
protein_column = "Protein",
log_abundance_column = "LogIntensities",
transform_nM_to_M = TRUE
transform_nM_to_M = FALSE
)

# Examine prepared data structure
Expand Down
Loading