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
2 changes: 1 addition & 1 deletion .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
build-args: |
GH_PAT=${{ secrets.UTILITY_ACCESS_TOKEN }}
SOURCE_BRANCH=${{ github.event.pull_request.base.ref || github.ref_name }}
NULISASEQAQ_BRANCH=${{ github.event.pull_request.base.ref || github.ref_name }}
NULISASEQAQ_BRANCH=${{ contains(github.repository, '_internal') && (github.event.pull_request.base.ref || github.ref_name) || '' }}
cache-from: type=gha
cache-to: type=gha,mode=max

Expand Down
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@
Rscript -e "library(methods); if (!requireNamespace('PCAtools', quietly = TRUE)) stop('Package PCAtools not installed')" && \
Rscript -e "library(methods); if (!requireNamespace('kableExtra', quietly = TRUE)) stop('Package kableExtra not installed')" && \
Rscript -e "remotes::install_github('Alamar-Biosciences/ComplexHeatmap', ref='master', auth_token = '${GH_PAT}')" && \
Rscript -e "library(methods); if (!requireNamespace('ComplexHeatmap', quietly = TRUE)) stop('Package ComplexHeatmap not installed')" && \
Rscript -e "devtools::install_github('Alamar-Biosciences/NULISAseqAQ', ref='${NULISASEQAQ_BRANCH}', auth_token = '${GH_PAT}')" && \
Rscript -e "library(methods); if (!requireNamespace('NULISAseqAQ', quietly = TRUE)) stop('Package NULISAseqAQ not installed')"
Rscript -e "library(methods); if (!requireNamespace('ComplexHeatmap', quietly = TRUE)) stop('Package ComplexHeatmap not installed')"

# Only install NULISAseqAQ if NULISASEQAQ_BRANCH is provided (internal repo only)
RUN if [ -n "${NULISASEQAQ_BRANCH}" ]; then \
Rscript -e "devtools::install_github('Alamar-Biosciences/NULISAseqAQ', ref='${NULISASEQAQ_BRANCH}', auth_token = '${GH_PAT}')" && \
Rscript -e "library(methods); if (!requireNamespace('NULISAseqAQ', quietly = TRUE)) stop('Package NULISAseqAQ not installed')"; \
else \
echo "Skipping NULISAseqAQ installation (NULISASEQAQ_BRANCH not set)"; \
fi

RUN mkdir -p ${HOME}/NULISAseqR
COPY . ${HOME}/NULISAseqR/.
Expand All @@ -38,6 +44,6 @@
Rscript -e "library(methods); if (!requireNamespace('NULISAseqR', quietly = TRUE)) stop('Package NULISAseqR not installed')"

EXPOSE 8000
ENV PATH "${HOME}:$PATH"

Check warning on line 47 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-base

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

CMD ["bash"]
9 changes: 5 additions & 4 deletions R/readNULISAseq.R
Original file line number Diff line number Diff line change
Expand Up @@ -1328,10 +1328,11 @@ loadNULISAseq <- function(file,
}
}
} else {
# Fallback not supported (XML version < 1.3) - NULISAseqAQ is required
stop("This XML file contains absolute quantification (AQ) data but has version < 1.3.0. ",
"The NULISAseqAQ package is required to process pre-1.3.0 AQ XML files, but it is not installed. ",
"writeUpdatedXML does not support pre-1.3.0 AQ XML files. Use NAS or contact Alamar support for help.")
# Fallback not supported (XML version < 1.3) - warn and treat as RQ
warning("This XML file contains AQ metadata but XML version < 1.3.0 and NULISAseqAQ is not installed. ",
"AQ data will not be available. Processing as RQ (relative quantification) instead.")
# Set AbsAssay to FALSE so downstream code treats this as RQ-only
AbsAssay <- FALSE
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion inst/rmarkdown/templates/nulisaseq/skeleton/skeleton.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ if(is.null(params$dataRuns)){
)
})
for(i in 1:numFiles){
AbsData <- "Abs" %in% names(runs[[i]]$ExecutionDetails)
AbsData <- runs[[i]]$AbsAssay
Tcriteria <- QCTargetCriteria(AQ=AbsData, advancedQC=params$advancedQC)
AQSC_SC <- ifelse(AbsData, "AQSC", "SC")
AQSC_SC_full <- ifelse(AbsData, "AQ sample controls (AQSC)", "Sample controls (SC)")
Expand Down
10 changes: 7 additions & 3 deletions tests/testthat/test-writeUpdatedXML.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test_that("Test that we can turn a pre-1.3.0 AQ XML into a 1.3.0 AQ XML that inc
})
})

test_that("Pre-1.3.0 AQ XML throws error when NULISAseqAQ is not available", {
test_that("Pre-1.3.0 AQ XML warns and loads as RQ when NULISAseqAQ is not available", {
# Mock NULISAseqAQ as unavailable
local_mocked_bindings(
requireNamespace = function(pkg, ...) {
Expand All @@ -41,6 +41,10 @@ test_that("Pre-1.3.0 AQ XML throws error when NULISAseqAQ is not available", {
test_path <- paste0(testthat::test_path(), "./../inst/rmarkdown/templates/nulisaseq/skeleton/")
input1 <- paste0(test_path, "Analysis_INF250_Lot4_AQ_LC_R3_20241229.xml")

# Should throw an error - conversion should not occur without NULISAseqAQ for pre-1.3 AQ XML
expect_error(loadNULISAseq(input1))
# Should warn but load successfully as RQ
expect_warning(data <- loadNULISAseq(input1), "AQ metadata")

# Verify it loaded successfully as RQ
expect_false(is.null(data$Data))
expect_true(is.null(data$AQ) || is.null(data$AQ$Data_AQ_aM))
})