diff --git a/R/create_genesets.R b/R/create_genesets.R index 455a109..ffc868f 100644 --- a/R/create_genesets.R +++ b/R/create_genesets.R @@ -53,8 +53,8 @@ check_geneset_input <- function(data_lst, bin_type, bin_param, use_cm <- FALSE for (i in names(data_lst)){ - rpp = data_lst[[i]] - if (class(rpp) == "list"){ + rpp <- data_lst[[i]] + if (is(rpp,"list")){ req_cols <- c('x', 'y', 'feature_name' ) if (length(setdiff(req_cols, colnames(rpp$trans_info))) > 0){ stop("Invalid column names detected in input data_lst. diff --git a/R/get_vectors.R b/R/get_vectors.R index b76f929..fb4eaa0 100644 --- a/R/get_vectors.R +++ b/R/get_vectors.R @@ -432,7 +432,7 @@ get_vectors<- function(data_lst, cluster_info,cm_lst=NULL, bin_type, bin_param, stop("Invalid input all_genes, should be a vector of character")} req_cols <- c("x", "y","feature_name") for (i in names(data_lst)){ - rpp = data_lst[[i]] + rpp <- data_lst[[i]] if (length(setdiff(req_cols, colnames(rpp$trans_info))) > 0) stop("Invalid column names detected in input data_lst. Must contain columns 'x', 'y', diff --git a/R/jazzpanda-package.R b/R/jazzpanda-package.R index 6939bfc..02b07be 100644 --- a/R/jazzpanda-package.R +++ b/R/jazzpanda-package.R @@ -10,7 +10,9 @@ #' } #' @usage data(rep1_sub) #' @return List -#' @source \url{https://cf.10xgenomics.com/samples/xenium/1.0.1/Xenium_FFPE_Human_Breast_Cancer_Rep1/Xenium_FFPE_Human_Breast_Cancer_Rep1_outs.zip} +#' @source \url{https://cf.10xgenomics.com/samples/xenium/1.0.1/\allowbreak +#' Xenium_FFPE_Human_Breast_Cancer_Rep1/Xenium_FFPE_Human_Breast\allowbreak +#' _Cancer_Rep1_outs.zip} "rep1_sub" @@ -30,7 +32,9 @@ #' } #' @usage data(rep1_clusters) #' @return data frame -#' @source \url{https://cf.10xgenomics.com/samples/xenium/1.0.1/Xenium_FFPE_Human_Breast_Cancer_Rep1/Xenium_FFPE_Human_Breast_Cancer_Rep1_outs.zip} +#' @source \url{https://cf.10xgenomics.com/samples/xenium/1.0.1/\allowbreak +#' Xenium_FFPE_Human_Breast_Cancer_Rep1/Xenium_FFPE_Human_Breast_\allowbreak +#' Cancer_Rep1_outs.zip} "rep1_clusters" #' Rep1 negative control genes within the selected region. @@ -47,7 +51,9 @@ #' } #' @usage data(rep1_neg) #' @return List -#' @source \url{https://cf.10xgenomics.com/samples/xenium/1.0.1/Xenium_FFPE_Human_Breast_Cancer_Rep1/Xenium_FFPE_Human_Breast_Cancer_Rep1_outs.zip} +#' @source \url{https://cf.10xgenomics.com/samples/xenium/1.0.1/\allowbreak +#' Xenium_FFPE_Human_Breast_Cancer_Rep1/Xenium_FFPE_Human_Breast_\allowbreak +#' Cancer_Rep1_outs.zip} "rep1_neg" @@ -63,7 +69,9 @@ #' } #' @usage data(rep2_sub) #' @return List -#' @source \url{https://cf.10xgenomics.com/samples/xenium/1.0.1/Xenium_FFPE_Human_Breast_Cancer_Rep2/Xenium_FFPE_Human_Breast_Cancer_Rep2_outs.zip} +#' @source \url{https://cf.10xgenomics.com/samples/xenium/1.0.1/\allowbreak +#' Xenium_FFPE_Human_Breast_Cancer_Rep2/Xenium_FFPE_Human_Breast_\allowbreak +#' Cancer_Rep2_outs.zip} "rep2_sub" @@ -83,7 +91,9 @@ #' } #' @usage data(rep2_clusters) #' @return data frame -#' @source \url{https://cf.10xgenomics.com/samples/xenium/1.0.1/Xenium_FFPE_Human_Breast_Cancer_Rep2/Xenium_FFPE_Human_Breast_Cancer_Rep2_outs.zip} +#' @source \url{https://cf.10xgenomics.com/samples/xenium/1.0.1/\allowbreak +#' Xenium_FFPE_Human_Breast_Cancer_Rep2/Xenium_FFPE_Human_\allowbreak +#' Breast_Cancer_Rep2_outs.zip} "rep2_clusters" #' Rep2 negative control genes within the selected region. @@ -100,5 +110,7 @@ #' } #' @usage data(rep2_neg) #' @return List -#' @source \url{https://cf.10xgenomics.com/samples/xenium/1.0.1/Xenium_FFPE_Human_Breast_Cancer_Rep2/Xenium_FFPE_Human_Breast_Cancer_Rep2_outs.zip} +#' @source \url{https://cf.10xgenomics.com/samples/xenium/1.0.1/\allowbreak +#' Xenium_FFPE_Human_Breast_Cancer_Rep2/Xenium_FFPE_Human_Breast_\allowbreak +#' Cancer_Rep2_outs.zip} "rep2_neg" diff --git a/R/lasso_markers.R b/R/lasso_markers.R index 2eaf449..91ff1f1 100644 --- a/R/lasso_markers.R +++ b/R/lasso_markers.R @@ -39,7 +39,7 @@ check_valid_input<- function(gene_mt,cluster_mt,sample_names, n_fold=10, if (any(!non_numeric_cols)) { stop("Column names for cluster_mt contain integers.") } - }) + }) if (nrow(gene_mt) != nrow(cluster_mt)){ stop("Number of rows of gene_mt and cluster_mt does not match.") } # every gene should have non-zero variance diff --git a/inst/script/generate_vignette_data.R b/inst/script/generate_vignette_data.R index fe7f1a5..01d2c21 100644 --- a/inst/script/generate_vignette_data.R +++ b/inst/script/generate_vignette_data.R @@ -31,7 +31,6 @@ library(data.table) library(Seurat) # download the official cell types of both samples -# Specify the URL of the file s1_url <- "https://raw.githubusercontent.com/phipsonlab/jazzPanda_vignette/main/Xenium_rep1_supervised_celltype.csv" s2_url <- "https://raw.githubusercontent.com/phipsonlab/jazzPanda_vignette/main/Xenium_rep2_supervised_celltype.csv" # Download the file @@ -69,7 +68,6 @@ get_xenium_data<-function(path,mtx_name, trans_name="transcript_info.csv.gz", } rep1_path <- 'path/to/rep1/out/directory' -rep1_path="/stornext/Bioinf/data/lab_phipson/data/xenium_human_breast_cancer/rep1/" rep1 = get_xenium_data(rep1_path, mtx_name="cell_feature_matrix", trans_name="transcripts.csv.gz", @@ -181,7 +179,6 @@ rep1_neg = list(trans_info=trans_neg, # process the rep2 in the same way rep2_path <- 'path/to/rep2/out/directory' -rep2_path="/stornext/Bioinf/data/lab_phipson/data/xenium_human_breast_cancer/rep2/" rep2 = get_xenium_data(rep2_path, mtx_name="cell_feature_matrix", trans_name="transcripts.csv.gz", diff --git a/man/rep1_clusters.Rd b/man/rep1_clusters.Rd index e482322..9b2b173 100644 --- a/man/rep1_clusters.Rd +++ b/man/rep1_clusters.Rd @@ -16,7 +16,9 @@ A data frame with 1705 rows and 6 variables: } } \source{ -\url{https://cf.10xgenomics.com/samples/xenium/1.0.1/Xenium_FFPE_Human_Breast_Cancer_Rep1/Xenium_FFPE_Human_Breast_Cancer_Rep1_outs.zip} +\url{https://cf.10xgenomics.com/samples/xenium/1.0.1/ +Xenium_FFPE_Human_Breast_Cancer_Rep1/Xenium_FFPE_Human_Breast_ +Cancer_Rep1_outs.zip} } \usage{ data(rep1_clusters) diff --git a/man/rep1_neg.Rd b/man/rep1_neg.Rd index 4e269fa..ba37410 100644 --- a/man/rep1_neg.Rd +++ b/man/rep1_neg.Rd @@ -15,7 +15,9 @@ A list of named matrices } } \source{ -\url{https://cf.10xgenomics.com/samples/xenium/1.0.1/Xenium_FFPE_Human_Breast_Cancer_Rep1/Xenium_FFPE_Human_Breast_Cancer_Rep1_outs.zip} +\url{https://cf.10xgenomics.com/samples/xenium/1.0.1/ +Xenium_FFPE_Human_Breast_Cancer_Rep1/Xenium_FFPE_Human_Breast_ +Cancer_Rep1_outs.zip} } \usage{ data(rep1_neg) diff --git a/man/rep1_sub.Rd b/man/rep1_sub.Rd index 7e06e78..d6786f2 100644 --- a/man/rep1_sub.Rd +++ b/man/rep1_sub.Rd @@ -13,7 +13,9 @@ A list of named matrices: } } \source{ -\url{https://cf.10xgenomics.com/samples/xenium/1.0.1/Xenium_FFPE_Human_Breast_Cancer_Rep1/Xenium_FFPE_Human_Breast_Cancer_Rep1_outs.zip} +\url{https://cf.10xgenomics.com/samples/xenium/1.0.1/ +Xenium_FFPE_Human_Breast_Cancer_Rep1/Xenium_FFPE_Human_Breast +_Cancer_Rep1_outs.zip} } \usage{ data(rep1_sub) diff --git a/man/rep2_clusters.Rd b/man/rep2_clusters.Rd index fa9b8d1..8b11e52 100644 --- a/man/rep2_clusters.Rd +++ b/man/rep2_clusters.Rd @@ -16,7 +16,9 @@ A data frame with 1815 rows and and 6 variables: } } \source{ -\url{https://cf.10xgenomics.com/samples/xenium/1.0.1/Xenium_FFPE_Human_Breast_Cancer_Rep2/Xenium_FFPE_Human_Breast_Cancer_Rep2_outs.zip} +\url{https://cf.10xgenomics.com/samples/xenium/1.0.1/ +Xenium_FFPE_Human_Breast_Cancer_Rep2/Xenium_FFPE_Human_ +Breast_Cancer_Rep2_outs.zip} } \usage{ data(rep2_clusters) diff --git a/man/rep2_neg.Rd b/man/rep2_neg.Rd index b49a948..498d970 100644 --- a/man/rep2_neg.Rd +++ b/man/rep2_neg.Rd @@ -15,7 +15,9 @@ A list of named matrices: } } \source{ -\url{https://cf.10xgenomics.com/samples/xenium/1.0.1/Xenium_FFPE_Human_Breast_Cancer_Rep2/Xenium_FFPE_Human_Breast_Cancer_Rep2_outs.zip} +\url{https://cf.10xgenomics.com/samples/xenium/1.0.1/ +Xenium_FFPE_Human_Breast_Cancer_Rep2/Xenium_FFPE_Human_Breast_ +Cancer_Rep2_outs.zip} } \usage{ data(rep2_neg) diff --git a/man/rep2_sub.Rd b/man/rep2_sub.Rd index e3d9b7a..c4826fd 100644 --- a/man/rep2_sub.Rd +++ b/man/rep2_sub.Rd @@ -13,7 +13,9 @@ A list of named matrices } } \source{ -\url{https://cf.10xgenomics.com/samples/xenium/1.0.1/Xenium_FFPE_Human_Breast_Cancer_Rep2/Xenium_FFPE_Human_Breast_Cancer_Rep2_outs.zip} +\url{https://cf.10xgenomics.com/samples/xenium/1.0.1/ +Xenium_FFPE_Human_Breast_Cancer_Rep2/Xenium_FFPE_Human_Breast_ +Cancer_Rep2_outs.zip} } \usage{ data(rep2_sub)