Skip to content

Commit

Permalink
bump version to v1.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ShixiangWang committed Feb 19, 2021
1 parent d3ae8d4 commit 70108c6
Show file tree
Hide file tree
Showing 121 changed files with 342 additions and 157 deletions.
4 changes: 2 additions & 2 deletions CRAN-RELEASE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This package was submitted to CRAN on 2021-01-30.
Once it is accepted, delete this file and tag the release (commit d8de0ae).
This package was submitted to CRAN on 2021-02-19.
Once it is accepted, delete this file and tag the release (commit d3ae8d4).
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: 1.2.4.999
Version: 1.2.5
Authors@R:
c(person(given = "Shixiang",
family = "Wang",
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export(output_tally)
export(read_copynumber)
export(read_copynumber_seqz)
export(read_maf)
export(read_rs)
export(read_sv_as_rs)
export(read_vcf)
export(read_xena_variants)
export(report_bootstrap_p_value)
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

## BUG REPORTS


## ENHANCEMENTS

- Modified the default visualization of `bp_show_survey()`.
- Enhanced `torch` check.

## NEW FUNCTIONS

- `read_sv_as_rs()` and `sig_tally.RS()` for simplified genome rearrangement classification matrix generation (experimental).

## DEPRECATED

# sigminer 1.2.4
Expand Down
25 changes: 4 additions & 21 deletions R/get_sv.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
#'
#' @examples
#' sv <- readRDS(system.file("extdata", "toy_sv.rds", package = "sigminer", mustWork = TRUE))
#' rs <- read_rs(sv)
#' rs <- read_sv_as_rs(sv)
#' \donttest{
#' tally_rs <- sig_tally(rs)
#' }
#' @testexamples
#' expect_is(rs, "RS")
#' expect_is(tally_rs, "list")
read_rs <- function(input) {
read_sv_as_rs <- function(input) {
if (is.data.frame(x = input)) {
input <- data.table::as.data.table(input)
} else {
Expand Down Expand Up @@ -65,19 +65,15 @@ read_rs <- function(input) {
}

# split by sample and collect in a list : svlist --------------------------
# imitate : sigminer::get_cnlist()
get_svlist <- function(data) {
index <- seq(1, nrow(data))
data$Index <- index
res <- split(data, by = "sample")
}


# get size
getRearrSize_v1 <- function(sv_profiles) {
# sv_profiles <- svlist
rearrsize <- purrr::map_df(sv_profiles, function(x) {
# x <- sv_profiles$PD26851a[1]
if (x$svclass == "translocation") x$rearrsize <- NA
length <- x$end2 - x$start1
if (length < 1000) x$rearrsize <- "<1Kb"
Expand All @@ -95,9 +91,6 @@ getRearrSize_v1 <- function(sv_profiles) {
rearrsize[order(rearrsize$Index)]
}




# copy from UCL-Research-Department-of-Pathology/RESIN --------------------
getDists <- function(chrom1, pos1, chrom2, pos2, doPCF = FALSE) {
pos1 <- as.numeric(pos1)
Expand Down Expand Up @@ -129,13 +122,8 @@ getDists <- function(chrom1, pos1, chrom2, pos2, doPCF = FALSE) {
return(dists)
}



# get clustered -----------------------------------------------------------
getClustered_v1 <- function(sv_profiles, threshold = NULL) {
# sv_profiles <- svlist
# x <- sv_profiles$PD26879a
# x <- sv_profiles$PD26851a
# threshold = NULL
# each list each row apply function
clustered <- purrr::map(sv_profiles, function(x) {
Expand Down Expand Up @@ -193,10 +181,7 @@ getType_v1 <- function(sv_profiles) {
}




# get features list -------------------------------------------------------
# imitate : get_features_wang
get_features_sv <- function(sv_data) {
field <- c(
"clustered",
Expand Down Expand Up @@ -255,8 +240,6 @@ call_component <- function(f_dt, f_name) {
}




# get sv matrix
get_matrix_sv <- function(CN_components, indices = NULL) {
merged_dt <- purrr::reduce(CN_components, merge, by = c("sample", "Index"), all = TRUE)
Expand Down Expand Up @@ -288,7 +271,7 @@ get_matrix_sv <- function(CN_components, indices = NULL) {
sv_mat_32 <- sv_mat[, !(grepl("<1Kb", colnames(sv_mat)))]

return(list(
SV_32 = sv_mat_32,
SV_38 = sv_mat
RS_32 = sv_mat_32,
RS_38 = sv_mat
))
}
14 changes: 7 additions & 7 deletions R/sig_tally.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#' set `sigminer.copynumber.max` to a proper value (the best is consistent
#' with [read_copynumber]).
#'
#' @param object a [CopyNumber] object or [MAF] object or SV object (from [read_sv]).
#' @param object a [CopyNumber] object or [MAF] object or SV object (from [read_sv_as_rs]).
#' @param ... custom setting for operating object. Detail see S3 method for
#' corresponding class (e.g. `CopyNumber`).
#' @return a `list` contains a `matrix` used for NMF de-composition.
Expand Down Expand Up @@ -395,25 +395,25 @@ sig_tally.CopyNumber <- function(object,
}
}

#' @describeIn sig_tally Returns rearrangement sample-by-component matrix
#' @describeIn sig_tally Returns genome rearrangement sample-by-component matrix
#' @export
sig_tally.RS <- function(object, keep_only_matrix = FALSE, ...) {
svlist <- get_svlist(object)
message("Successfully get RS list!")
send_success("Successfully get RS list!")

sv_features <- get_features_sv(svlist)
message("Successfully get RS features!")
send_success("Successfully get RS features!")

sv_component <- get_components_sv(sv_features)
message("Successfully get RS component!")
send_success("Successfully get RS component!")

sv_matrix_list <- get_matrix_sv(CN_components = sv_component)
message("Successfully get RS matrix!")
send_success("Successfully get RS matrix!")

res_list <- list(
features = sv_features,
components = sv_component,
nmf_matrix = sv_matrix_list$SV_32,
nmf_matrix = sv_matrix_list$RS_32,
all_matrices = sv_matrix_list
)

Expand Down
1 change: 0 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ p5 <- show_cosmic_sig_profile(sig_index = c("R1", "R2", "R3"), sig_db = "RS_Nik_
p5
```

> `sig_tally()` for RS is not supported.

### Features

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ For pipeline tool, please see its co-evolutionary CLI

<img src="man/figures/README-unnamed-chunk-5-1.png" width="100%" />

> `sig_tally()` for RS is not supported.
### Features

- supports a standard *de novo* pipeline for identification of **5**
Expand Down
1 change: 1 addition & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ reference:
- read_copynumber
- read_copynumber_seqz
- read_maf
- read_sv_as_rs
- read_vcf
- read_xena_variants
- CopyNumber-class
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/README_zh.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/articles/sigminer.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ pkgdown: 1.6.1
pkgdown_sha: ~
articles:
sigminer: sigminer.html
last_built: 2021-01-30T07:36Z
last_built: 2021-02-19T14:40Z

2 changes: 1 addition & 1 deletion docs/reference/CN.features.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/CopyNumber-class.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/MAF-class.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/add_h_arrow.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/add_labels.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/reference/bp.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/centromeres.hg19.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 70108c6

Please sign in to comment.