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
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
upgrade: 'TRUE'
extra-packages: |
any::testthat
any::devtools
Expand Down
15 changes: 9 additions & 6 deletions R/sic_extraction.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ compute_sic_posterior <- function(fit,
for (group_i in indices) {
for (source in source_types) {
# Find coefficient indices for this target-source pair
coef_pattern <- paste0("_", target_type, "_", source)
coef_ix <- grep(coef_pattern, coef_names, fixed = TRUE)
# Use $ anchor to match exact source name at end (avoids matching cd4tcells_ICOS when looking for cd4tcells)
coef_pattern <- paste0("_", target_type, "_", source, "$")
coef_ix <- grep(coef_pattern, coef_names)

if (length(coef_ix) == 0) {
warning(sprintf("No coefficients found for %s -> %s", source, target_type))
Expand Down Expand Up @@ -221,8 +222,9 @@ compute_sic_posterior <- function(fit,
for (patient_i in indices) {
for (source in source_types) {
# Find coefficient indices for this target-source pair
coef_pattern <- paste0("_", target_type, "_", source)
coef_ix <- grep(coef_pattern, coef_names, fixed = TRUE)
# Use $ anchor to match exact source name at end (avoids matching cd4tcells_ICOS when looking for cd4tcells)
coef_pattern <- paste0("_", target_type, "_", source, "$")
coef_ix <- grep(coef_pattern, coef_names)

if (length(coef_ix) == 0) {
warning(sprintf("No coefficients found for %s -> %s", source, target_type))
Expand Down Expand Up @@ -283,8 +285,9 @@ compute_sic_posterior <- function(fit,
for (image_i in indices) {
for (source in source_types) {
# Find coefficient indices for this target-source pair
coef_pattern <- paste0("_", target_type, "_", source)
coef_ix <- grep(coef_pattern, coef_names, fixed = TRUE)
# Use $ anchor to match exact source name at end (avoids matching cd4tcells_ICOS when looking for cd4tcells)
coef_pattern <- paste0("_", target_type, "_", source, "$")
coef_ix <- grep(coef_pattern, coef_names)

if (length(coef_ix) == 0) {
warning(sprintf("No coefficients found for %s -> %s", source, target_type))
Expand Down