Skip to content

Commit c661426

Browse files
committed
compatibility with R 4.1.0, better docs and added imports
1 parent 0d89d94 commit c661426

8 files changed

+41
-13
lines changed

DESCRIPTION

+5-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ Imports:
6363
gtools,
6464
forcats,
6565
circlize,
66-
BiocParallel
66+
BiocParallel,
67+
fpc,
68+
ggnewscale,
69+
miniUI,
70+
pals
6771
RoxygenNote: 7.1.1
6872
VignetteBuilder: knitr
6973
Depends:

NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ importFrom(shiny,checkboxGroupInput)
130130
importFrom(shiny,fillCol)
131131
importFrom(shiny,plotOutput)
132132
importFrom(shiny,stopApp)
133+
importFrom(stringr,fixed)
133134
importFrom(stringr,str_detect)
134135
importFrom(stringr,str_extract)
135136
importFrom(stringr,str_remove)

R/plotUmap.R

+6-4
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ plotUmap <- function(scCNA,
8080
),
8181
size = 1.8,
8282
shape = 21) +
83-
scale_fill_manual(values = c(subclones_pal()),
84-
name = "subclones") +
83+
scale_fill_manual(values = subclones_pal(),
84+
name = "subclones",
85+
limits = force) +
8586
theme_classic() +
8687
my_theme
8788

@@ -110,8 +111,9 @@ plotUmap <- function(scCNA,
110111
),
111112
size = 1.8,
112113
shape = 21) +
113-
scale_fill_manual(values = c(subclones_pal()),
114-
name = "subclones") + # palettes are in sysdata.rda
114+
scale_fill_manual(values = subclones_pal(),
115+
name = "subclones",
116+
limits = force) +
115117
theme_classic() +
116118
my_theme
117119

R/runCountReads.R

+11-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#' @return Genomic ranges can be accessed with \code{SummarizedExperiment::rowRanges()}
1818
#'
1919
#' @importFrom Rsubread featureCounts
20-
#' @importFrom stringr str_replace str_remove str_detect
20+
#' @importFrom stringr str_replace str_remove str_detect fixed
2121
#' @importFrom dplyr rename mutate relocate
2222
#' @importFrom GenomicRanges makeGRangesFromDataFrame
2323
#' @importFrom S4Vectors DataFrame metadata
@@ -114,7 +114,13 @@ runCountReads <- function(dir,
114114
'[[',
115115
1)
116116

117-
names(varbin_counts_list) <- files_names
117+
varbin_counts_list <- lapply(varbin_counts_list,
118+
as.vector)
119+
120+
names(varbin_counts_list) <- stringr::str_remove(files_names,
121+
stringr::fixed(".bam",
122+
ignore_case = TRUE))
123+
118124

119125
#LOWESS GC normalization
120126

@@ -166,7 +172,9 @@ runCountReads <- function(dir,
166172
'[[',
167173
4)
168174

169-
names(varbin_reads_list) <- files_names
175+
names(varbin_reads_list) <- stringr::str_remove(files_names,
176+
stringr::fixed(".bam",
177+
ignore_case = TRUE))
170178

171179
# saving info and removing columns from list elements
172180
metadata_info_names <- varbin_reads_list[[1]][c(1, 2, 8, 9, 12, 14), 1]

R/runSegmentation.R

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#' @importFrom dplyr mutate bind_cols
1515
#' @importFrom stringr str_detect str_remove str_replace
1616
#' @importFrom S4Vectors metadata
17+
#' @importFrom SummarizedExperiment assay
1718
#' @importFrom BiocParallel bplapply bpparam
1819
#' @importMethodsFrom SummarizedExperiment assay
1920
#' @export
@@ -88,10 +89,12 @@ runSegmentation <- function(scCNA,
8889

8990
}
9091

92+
93+
9194
if (method == "CBS") {
9295

9396
if (S4Vectors::metadata(scCNA)$vst == 'ft') {
94-
counts_df <- assay(scCNA, 'ft')
97+
counts_df <- SummarizedExperiment::assay(scCNA, 'ft')
9598

9699
CBS_seg <- BiocParallel::bplapply(counts_df, FUN = function(x) {
97100
CNA_object <-
@@ -129,7 +132,7 @@ runSegmentation <- function(scCNA,
129132
noBreaks. = TRUE)
130133
# segmentation with undo.splits = "prune"
131134

132-
counts_df <- assay(scCNA, 'log')
135+
counts_df <- SummarizedExperiment::assay(scCNA, 'log')
133136

134137
CBS_seg <-
135138
BiocParallel::bplapply(as.data.frame(counts_df), function(x) {

R/runVarbin.R

+2
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ runVarbin <- function(dir,
8282
name = 'segment_ratios',
8383
BPPARAM = bpparam()) {
8484

85+
genome <- match.arg(genome)
86+
vst <- match.arg(vst)
8587

8688
copykit_object <- runCountReads(dir,
8789
bin_size = bin_size,

R/runVst.R

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
runVst <- function(scCNA,
2929
transformation = c('ft','log')) {
3030

31+
transformation <- match.arg(transformation)
32+
3133
varbin_counts_df <- copykit::bin_counts(scCNA)
3234

3335
if (transformation == 'ft') {

man/runVst.Rd

+9-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)