Skip to content

Commit

Permalink
Fixed the error in generating SBS matrix when only one sample input (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ShixiangWang committed May 17, 2023
1 parent 981a081 commit 21cbfae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: sigminer
Title: Extract, Analyze and Visualize Mutational Signatures for Genomic
Variations
Version: 2.2.0
Version: 2.2.1
Authors@R: c(
person("Shixiang", "Wang", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-9855-7357")),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# sigminer 2.2.1

- Fixed the error in generating SBS matrix when only one sample input (#432).

# sigminer 2.2.0

- Removed package 'copynumber' from suggests filed.
Expand Down
6 changes: 3 additions & 3 deletions R/generate_matrices.R
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ generate_matrix_SBS <- function(query, ref_genome, genome_build = "hg19", add_tr

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

# Reorder mutation types
res$all_matrices = lapply(res$all_matrices, function(x) {
y = x[, sort(colnames(x))]
y = x[, sort(colnames(x)), drop = FALSE]
y
})
res$nmf_matrix = res$nmf_matrix[, sort(colnames(res$nmf_matrix))]
res$nmf_matrix = res$nmf_matrix[, sort(colnames(res$nmf_matrix)), drop = FALSE]

# Return
res
Expand Down

0 comments on commit 21cbfae

Please sign in to comment.