Skip to content
Open
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: 10 additions & 9 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Package: hdxstats
Title: Statistical analysis of hydrogen deuterium exchange mass spectrometry
Version: 1.0
Author: c(person("Crook", "Oliver M.",
email = "oliver.crook@stats.ox.ac.uk",
comment = c(ORCID = "0000-0001-5669-8506"),
role = c("aut", "cre")))
Maintainer: Oliver Crook <oliver.crook@stats.ox.ac.uk>
Version: 1.0.1
Authors@R: c(person(family = "Crook", given = "Oliver M.",
email = "oliver.crook@stats.ox.ac.uk",
comment = c(ORCID = "0000-0001-5669-8506"),
role = c("aut", "cre")))
Description: The hdxstats package enables the analysis and visualisation
of hydrogen deuterium exchange mass spectromery experiments. It supports
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

Spelling error: 'spectromery' should be 'spectrometry'.

Suggested change
of hydrogen deuterium exchange mass spectromery experiments. It supports
of hydrogen deuterium exchange mass spectrometry experiments. It supports

Copilot uses AI. Check for mistakes.
all types of HDX-MS experiments but provides additional support for epitope
mapping experiments.
mapping experiments. The package focuses and implements empirical Bayes
functional models for hydrogen deuterium exchange data.
License: Artistic-2.0
Encoding: UTF-8
Depends: R (>= 4.0), S4Vectors, Biobase, QFeatures
Depends: R (>= 4.1), S4Vectors, Biobase, QFeatures
Imports: Rcpp (>= 1.0.4.6),
ggplot2,
dplyr,
Expand All @@ -29,7 +29,8 @@ Imports: Rcpp (>= 1.0.4.6),
broom,
limma,
lmerTest,
harmonicmeanp
harmonicmeanp,
stats
Suggests: pheatmap,
viridis,
scales,
Expand Down
6 changes: 5 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ exportPattern("^[[:alpha:]]+")
importFrom("minpack.lm", "nlsLM", "nls.lm.control")
importFrom("broom", "tidy")
importFrom("Biobase", "exprs")
importFrom("QFeatures", "readQFeatures")
importFrom("QFeatures", "readQFeatures", "longFormat")
importFrom("S4Vectors", "DataFrame")
importFrom("harmonicmeanp", "p.hmp")
importFrom("RColorBrewer", "brewer.pal")
importFrom("methods", "is")
import("Rcpp", "ggplot2", "dplyr", "plyr", "knitr", "BiocParallel", "robustbase",
"BiocStyle", "stringi")
exportMethods(logLik, residuals, vcov, likRatio, coef, deviance, summary, wilk)
4 changes: 2 additions & 2 deletions R/functionalAnalysis-plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ forestPlot <- function(params, condition = c(1,2)) {
model2 <- params@alternative@nlsmodels[[2]]

tmp <- summary(model1)$parameters
tmp2 <- summary(model1)$parameters
tmp2 <- summary(model2)$parameters

df <- data.frame(tmp)
df$rownames <- rownames(df)
Expand Down Expand Up @@ -729,7 +729,7 @@ forestPlot <- function(params, condition = c(1,2)) {
scale_color_viridis(discrete = TRUE, begin = 0.2, direction = 1) + theme(text = element_text(size = 16)) +
geom_vline(xintercept = 0, linetype = "dashed")

print(gg)
return(gg)
}
##' Underlying computation for compute residue level differences plots. Uses
##' average differences at each residue.
Expand Down
2 changes: 1 addition & 1 deletion R/hdxstat-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ setOldClass("gg")
.hdxstatmodel <- setClass("HdxStatModel",
slots = c(nullmodel = "nls",
alternative = "nlsList",
vis = "gg",
vis = "ANY",
method = "character",
formula = "formula"),
validity = function(object){
Expand Down
5 changes: 5 additions & 0 deletions R/hdxstat-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ setMethod("wilk", "HdxStatModel",
setMethod("coef", "HdxStatModel",
function(object) {
.out <- t(sapply(c(list(object@nullmodel), object@alternative@nlsmodels), coef))
if(dim(.out)[1] == 1){
nm <- colnames(.out)[1]
.out <- t(.out)
colnames(.out) <- nm
}
rownames(.out) <- c("null", paste0("alt", seq.int(length(object))))
Comment on lines +69 to 74
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

The logic for preserving column names appears incorrect. When transposing a matrix with 1 row, you're saving only the first column name, but after transposing, you should preserve all the original column names as the new row names, not just the first one. Consider saving the entire colnames(.out) vector before transposing, then assigning it as rownames after the transpose.

Suggested change
if(dim(.out)[1] == 1){
nm <- colnames(.out)[1]
.out <- t(.out)
colnames(.out) <- nm
}
rownames(.out) <- c("null", paste0("alt", seq.int(length(object))))
if (dim(.out)[1] == 1) {
## Preserve all original column names as row names after transposing
nm <- colnames(.out)
.out <- t(.out)
rownames(.out) <- nm
} else {
rownames(.out) <- c("null", paste0("alt", seq.int(length(object))))
}

Copilot uses AI. Check for mistakes.
.out
})
Expand Down
31,856 changes: 31,856 additions & 0 deletions inst/extdata/Project_2_SecA_Cluster_Data.csv

Large diffs are not rendered by default.

674 changes: 674 additions & 0 deletions vignettes/flexible-fits.html

Large diffs are not rendered by default.

Loading