Skip to content

Commit

Permalink
consistent format
Browse files Browse the repository at this point in the history
  • Loading branch information
fuerzhou committed Apr 26, 2022
1 parent dfd6fa4 commit 3afc583
Show file tree
Hide file tree
Showing 16 changed files with 85 additions and 60 deletions.
2 changes: 1 addition & 1 deletion R/multiple_background_images.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ multiple_background_images <- function(bg_sample = bg1,
idents = c("Tumour", "Immune","Others"),
props = list(rep(0.1, 9),
seq(0, 0.4, 0.05),
seq(0.9,0.5,-0.05)),
seq(0.9, 0.5, -0.05)),
plot_image = TRUE,
plot_colours = NULL){
## CHECK
Expand Down
5 changes: 2 additions & 3 deletions R/multiple_images_with_clusters.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@
#' @export
#' @examples
#' set.seed(610)
#' cluster_image_list <- multiple_images_with_clusters(bg_sample = bg1,
#' cluster_shape=2, prop_infiltration = c(0.1, 0.3), cluster_size = c(300,600),
#' cluster_image_list <- multiple_images_with_clusters(bg_sample=bg1,
#' cluster_shape=2, prop_infiltration=0.1, cluster_size = seq(200,1000,100),
#' cluster_loc_x = 0, cluster_loc_y = 0, plot_image = TRUE)

multiple_images_with_clusters <- function(bg_sample = bg1,
cluster_shape = 2,
prop_infiltration = 0.1,
Expand Down
3 changes: 1 addition & 2 deletions R/multiple_images_with_immune_rings.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@
#' set.seed(610)
#' ring_image_list <- multiple_images_with_immune_rings(bg_sample = bg1,
#' ring_shape = 1, prop_infiltration = 0, ring_width = seq(50,100,10),
#' cluster_size = 300, cluster_loc_x = 0, cluster_loc_y = 0,
#' cluster_size = 200, cluster_loc_x = 0, cluster_loc_y = 0,
#' prop_ring_infiltration = seq(0, 0.2,0.05), plot_image = TRUE)

multiple_images_with_immune_rings <- function(bg_sample = bg1,
cluster_size = 200,
ring_shape = 1,
Expand Down
12 changes: 6 additions & 6 deletions R/simulate_clusters.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@
#' @examples
#' set.seed(610)
#' cluster_image <- simulate_clusters(bg_sample = bg1,
#' n_clusters = 1, cluster_properties= list(C1 = list(
#' name_of_cluster_cell = "Tumour", size = 300, shape = "Oval", centre_loc =
#' data.frame("x" = 500, "y" = 500), infiltration_types = c("Immune1", "Others"),
#' infiltration_proportions = c(0.1, 0.05))))

#' n_clusters=2, cluster_properties=list(C1=list(name_of_cluster_cell="Tumour",
#' size=300, shape="Oval", centre_loc=data.frame("x"=500, "y"=500),
#' infiltration_types=c("Immune1", "Others"), infiltration_proportions=c(0.1, 0.05)),
#' C2=list(name_of_cluster_cell="Immune1", size=500, shape="Irregular",
#' centre_loc=data.frame("x"=1500,"y"=500), infiltration_types=c("Immune2", "Others"),
#' infiltration_proportions=c(0.1, 0.05))))
simulate_clusters <- function(bg_sample = bg1,
n_clusters = 2,
bg_type = "Others",
Expand All @@ -68,7 +69,6 @@ simulate_clusters <- function(bg_sample = bg1,
plot_categories = NULL,
plot_colours = NULL
){

## CHECK
if (!is.data.frame(bg_sample) & !methods::is(bg_sample, "SingleCellExperiment")) {
stop("`bg_sample` should be either a data.frame or a SingleCellExperiment object!")
Expand Down
4 changes: 2 additions & 2 deletions R/simulate_double_rings.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ simulate_double_rings <- function(bg_sample = bg1,
n_dr = 2,
win = NULL,
dr_properties = list(
I1 = list(
D1 = list(
name_of_cluster_cell = "Tumour",
size = 300,
shape = "Circle",
Expand All @@ -81,7 +81,7 @@ simulate_double_rings <- function(bg_sample = bg1,
double_ring_infiltration_types = c("Others"),
double_ring_infiltration_proportions = c(0.15)
),
I2 = list(
D2 = list(
name_of_cluster_cell = "Tumour",
size = 300,
shape = "Oval",
Expand Down
19 changes: 12 additions & 7 deletions R/simulate_immune_rings.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,19 @@
#' @examples
#' set.seed(610)
#' # manually define the properties of the immune ring
#' ir_properties <- list(I1 = list(name_of_cluster_cell = "Tumour",
#' size = 600,shape = "Circle",centre_loc = data.frame("x" = 930, "y" = 1000),
#' infiltration_types = c("Immune1", "Immune2", "Others"), infiltration_proportions
#' = c(0.15, 0.05, 0.05), name_of_ring_cell = "Immune1", immune_ring_width = 150,
#' immune_ring_infiltration_types = c("Others"), immune_ring_infiltration_proportions = c(0.15)))
#' ir_properties <- list(I1=list(name_of_cluster_cell="Tumour", size=600,
#' shape="Circle",centre_loc=data.frame("x"=930, "y"=1000),
#' infiltration_types=c("Immune1", "Immune2", "Others"), infiltration_proportions
#'=c(0.15, 0.05, 0.05), name_of_ring_cell="Immune1", immune_ring_width=150,
#' immune_ring_infiltration_types=c("Others"), immune_ring_infiltration_proportions=c(0.15)),
#' I2=list(name_of_cluster_cell="Tumour", size=500, shape="Oval",
#' centre_loc=data.frame("x"=1330, "y"=1100), infiltration_types=c("Immune1", "Immune2", "Others"),
#' infiltration_proportions=c(0.15, 0.05, 0.05), name_of_ring_cell="Immune1",
#' immune_ring_width=150, immune_ring_infiltration_types=c("Others"),
#' immune_ring_infiltration_proportions=c(0.15)))
#' # simulate immune rings (`n_ir` should match the length of `ir_properties`)
#' immune_ring_image <- simulate_immune_rings(bg_sample = bg1,
#' n_ir = 1, ir_properties = ir_properties)
#' immune_ring_image <- simulate_immune_rings(bg_sample=bg1,
#' n_ir=2, ir_properties=ir_properties)
#'
simulate_immune_rings <- function(bg_sample = bg1,
bg_type = "Others",
Expand Down
7 changes: 3 additions & 4 deletions R/simulate_mixing.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
#'
#' @examples
#' set.seed(610)
#' mix_background <- simulate_mixing(bg_sample = bg1,
#' idents = c("Tumour","Immune", "Others"), props = c(0.2, 0.4, 0.4))
#'

#' mix_background <- simulate_mixing(bg_sample=bg1,
#' idents=c("Tumour","Immune", "Others"), props=c(0.2, 0.4, 0.4),
#' plot_image=TRUE)
simulate_mixing <- function(bg_sample = bg1,
idents = c("Tumour", "Immune", "Others"),
props = c(0.2, 0.4, 0.4),
Expand Down
6 changes: 4 additions & 2 deletions man/TIS.Rd

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

3 changes: 2 additions & 1 deletion man/multiple_background_images.Rd

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

10 changes: 6 additions & 4 deletions man/multiple_images_with_clusters.Rd

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

8 changes: 5 additions & 3 deletions man/multiple_images_with_immune_rings.Rd

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

16 changes: 10 additions & 6 deletions man/simulate_clusters.Rd

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

10 changes: 6 additions & 4 deletions man/simulate_double_rings.Rd

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

25 changes: 16 additions & 9 deletions man/simulate_immune_rings.Rd

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

9 changes: 5 additions & 4 deletions man/simulate_mixing.Rd

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

6 changes: 4 additions & 2 deletions man/simulate_stripes.Rd

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

0 comments on commit 3afc583

Please sign in to comment.