Skip to content

Commit

Permalink
update code format
Browse files Browse the repository at this point in the history
  • Loading branch information
MelodyJIN-Y committed Sep 10, 2024
1 parent d2dff1d commit 45fc9ee
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 19 deletions.
4 changes: 2 additions & 2 deletions R/create_genesets.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion R/get_vectors.R
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
24 changes: 18 additions & 6 deletions R/jazzpanda-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand All @@ -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.
Expand All @@ -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"


Expand All @@ -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"


Expand All @@ -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.
Expand All @@ -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"
2 changes: 1 addition & 1 deletion R/lasso_markers.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions inst/script/generate_vignette_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion man/rep1_clusters.Rd

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

4 changes: 3 additions & 1 deletion man/rep1_neg.Rd

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

4 changes: 3 additions & 1 deletion man/rep1_sub.Rd

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

4 changes: 3 additions & 1 deletion man/rep2_clusters.Rd

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

4 changes: 3 additions & 1 deletion man/rep2_neg.Rd

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

4 changes: 3 additions & 1 deletion man/rep2_sub.Rd

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

0 comments on commit 45fc9ee

Please sign in to comment.