Skip to content

Commit

Permalink
Support separated index, related to ShixiangWang/sigflow#11
Browse files Browse the repository at this point in the history
  • Loading branch information
ShixiangWang committed Sep 2, 2020
1 parent 6ae28b8 commit 8540b92
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# sigminer 1.0.14

- Supported signature index separated by `,` in `sig_fit()` and `sig_fit_bootstrap*` functions.
- Added `output_*` functions from [sigflow](https://github.com/ShixiangWang/sigminer.workflow).
- Enhanced DBS search and error handling in `sig_tally()`.
- Added option `highlight_genes` in `show_cn_group_profile()` to show gene labels.
Expand Down
8 changes: 8 additions & 0 deletions R/sig_fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ sig_fit <- function(catalogue_matrix,
on.exit(send_elapsed_time(timer))

if (is.null(sig_index)) {
send_info("Signature index not detected.")
if (inherits(sig, "Signature")) {
send_success("Signature object detected.")
sig_matrix <- sig$Signature
Expand Down Expand Up @@ -167,6 +168,13 @@ sig_fit <- function(catalogue_matrix,
sig_index <- avail_index
}

if (length(sig_index) == 1) {
if (grepl(",", sig_index)) {
send_success("Signature indices separated by comma are detected.")
sig_index <- split_seq(sig_index)
}
}

if (!all(sig_index %in% avail_index)) {
send_error("Invalid index.")
send_info(msg)
Expand Down
2 changes: 2 additions & 0 deletions R/sig_fit_bootstrap_batch.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#' Exposure Instability Analysis of Signature Exposures with Bootstrapping
#'
#' Read [sig_fit_bootstrap] for more option setting.
#'
#' @inheritParams sig_fit
#' @inheritParams sig_fit_bootstrap
#' @param methods a subset of `c("NNLS", "QP", "SA")`.
Expand Down

0 comments on commit 8540b92

Please sign in to comment.