Skip to content

Commit 21cbfae

Browse files
committed
Fixed the error in generating SBS matrix when only one sample input (#432)
1 parent 981a081 commit 21cbfae

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Diff for: DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: sigminer
22
Title: Extract, Analyze and Visualize Mutational Signatures for Genomic
33
Variations
4-
Version: 2.2.0
4+
Version: 2.2.1
55
Authors@R: c(
66
person("Shixiang", "Wang", , "[email protected]", role = c("aut", "cre"),
77
comment = c(ORCID = "0000-0001-9855-7357")),

Diff for: NEWS.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# sigminer 2.2.1
2+
3+
- Fixed the error in generating SBS matrix when only one sample input (#432).
4+
15
# sigminer 2.2.0
26

37
- Removed package 'copynumber' from suggests filed.

Diff for: R/generate_matrices.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ generate_matrix_SBS <- function(query, ref_genome, genome_build = "hg19", add_tr
247247

248248
if (add_trans_bias) {
249249
send_info("Return SBS-192 as major matrix.")
250-
SBS_192 <- SBS_384[, grepl("T:|U:", colnames(SBS_384))]
250+
SBS_192 <- SBS_384[, grepl("T:|U:", colnames(SBS_384)), drop = FALSE]
251251
res <- list(
252252
nmf_matrix = SBS_192,
253253
all_matrices = list(
@@ -276,10 +276,10 @@ generate_matrix_SBS <- function(query, ref_genome, genome_build = "hg19", add_tr
276276

277277
# Reorder mutation types
278278
res$all_matrices = lapply(res$all_matrices, function(x) {
279-
y = x[, sort(colnames(x))]
279+
y = x[, sort(colnames(x)), drop = FALSE]
280280
y
281281
})
282-
res$nmf_matrix = res$nmf_matrix[, sort(colnames(res$nmf_matrix))]
282+
res$nmf_matrix = res$nmf_matrix[, sort(colnames(res$nmf_matrix)), drop = FALSE]
283283

284284
# Return
285285
res

0 commit comments

Comments
 (0)