Skip to content

Commit

Permalink
fix cran test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ShixiangWang committed May 14, 2024
1 parent 6d11439 commit 58e5e40
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
4 changes: 2 additions & 2 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 2.1.0
Date: 2024-05-13 12:01:17 UTC
SHA: bf3ca4cfce6fe45d44ca50ba5b624bbc448c6a13
Date: 2024-05-14 16:54:49 UTC
SHA: 6d114397c129f2d8eec8e36f19e0a5054d77b306
4 changes: 2 additions & 2 deletions R/vis_dim_dist.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ vis_dim_dist <- function(ids = c("TP53", "KRAS", "PTEN", "MDM2", "CDKN1A"),
}) %>% purrr::reduce(dplyr::full_join, by = "Sample")
},
error = function(e) {
rlang::warn("access data failed, the message is provided below")
print(e$message)
rlang::inform("access data failed, the message is provided below")
rlang::warn(conditionMessage(e))
NULL
}
)
Expand Down
36 changes: 24 additions & 12 deletions R/vis_identifier_dim_dist.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,30 @@ vis_identifier_dim_dist = function(dataset = NULL, ids = NULL, grp_df, samples =
colnames(grp_df)[1] <- "sample"

if (!is.null(dataset) && !is.null(ids)) {
df <- purrr::map(ids, function(x) {
message("Querying data of identifier ", x, " from dataset ", dataset, " for DR")
data <- if (dataset == "custom_feature_dataset") query_custom_feature_value(x) else
query_molecule_value(dataset, x)
data <- dplyr::tibble(
sample = names(data),
y = as.numeric(data)
)
colnames(data)[2] <- x
data
}) %>%
purrr::reduce(dplyr::full_join, by = "sample")

df <- tryCatch(
{
purrr::map(ids, function(x) {
message("Querying data of identifier ", x, " from dataset ", dataset, " for DR")
data <- if (dataset == "custom_feature_dataset") query_custom_feature_value(x) else
query_molecule_value(dataset, x)
data <- dplyr::tibble(
sample = names(data),
y = as.numeric(data)
)
colnames(data)[2] <- x
data
}) %>%
purrr::reduce(dplyr::full_join, by = "sample")
},
error = function(e) {
rlang::inform("access data failed, the message is provided below")
rlang::warn(conditionMessage(e))
NULL
}
)
if (is.null(df)) return(NULL)

df <- dplyr::inner_join(grp_df, df, by = "sample")
} else {
message("Directly use 'grp_df' for comparison analysis.")
Expand Down

0 comments on commit 58e5e40

Please sign in to comment.