Commit 2a5797c8 authored by Lucy McNeill's avatar Lucy McNeill
Browse files

add an inout parameter artificial_amp_factor in count_foci, which amplies the...

add an inout parameter artificial_amp_factor in count_foci, which amplies the foci channel for annotation purposes only. Defaults to 1
parent b66cfcac
No preview for this file type
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#' @param watershed_tol Intensity tolerance for watershed method. Defaults to 0.05. #' @param watershed_tol Intensity tolerance for watershed method. Defaults to 0.05.
#' @param crowded_foci TRUE or FALSE, defaults to FALSE. Set to TRUE if you #' @param crowded_foci TRUE or FALSE, defaults to FALSE. Set to TRUE if you
#' have foci > 100 or so. #' have foci > 100 or so.
#' @param artificial_amp_factor For annotation only.
#' @examples demo_path = paste0(system.file("extdata",package = "synapsis")) #' @examples demo_path = paste0(system.file("extdata",package = "synapsis"))
#' foci_counts <- count_foci(demo_path,offset_factor = 3, brush_size = 3, #' foci_counts <- count_foci(demo_path,offset_factor = 3, brush_size = 3,
#' brush_sigma = 3, annotation = "on",stage = "pachytene") #' brush_sigma = 3, annotation = "on",stage = "pachytene")
...@@ -51,7 +52,7 @@ ...@@ -51,7 +52,7 @@
#' @return foci count per cell #' @return foci count per cell
count_foci <- function(img_path, stage = "none", offset_px = 0.2, offset_factor = 2, brush_size = 3, brush_sigma = 3, foci_norm = 0.01, annotation = "off",channel2_string = "SYCP3", channel1_string = "MLH3",file_ext = "jpeg", KO_str = "--",WT_str = "++",KO_out = "-/-", WT_out = "+/+", watershed_stop = "off", watershed_radius = 1, watershed_tol = 0.05, crowded_foci = TRUE) count_foci <- function(img_path, stage = "none", offset_px = 0.2, offset_factor = 2, brush_size = 3, brush_sigma = 3, foci_norm = 0.01, annotation = "off",channel2_string = "SYCP3", channel1_string = "MLH3",file_ext = "jpeg", KO_str = "--",WT_str = "++",KO_out = "-/-", WT_out = "+/+", watershed_stop = "off", watershed_radius = 1, watershed_tol = 0.05, crowded_foci = TRUE, artificial_amp_factor = 1)
{ {
cell_count <- 0 cell_count <- 0
image_count <-0 image_count <-0
...@@ -147,7 +148,7 @@ count_foci <- function(img_path, stage = "none", offset_px = 0.2, offset_factor ...@@ -147,7 +148,7 @@ count_foci <- function(img_path, stage = "none", offset_px = 0.2, offset_factor
plot(0.5*new_img) plot(0.5*new_img)
plot(img_orig_foci) plot(img_orig_foci)
ch1 <-channel(0.5*new_img,"grey") ch1 <-channel(0.5*new_img,"grey")
ch2 <- channel(foci_mask_crop,"grey") ch2 <- channel(artificial_amp_factor*foci_mask_crop,"grey")
bluered <- rgbImage(ch1, ch2, 0*ch1) bluered <- rgbImage(ch1, ch2, 0*ch1)
cat("\n displaying resulting foci count plots. Overlay two channels:") cat("\n displaying resulting foci count plots. Overlay two channels:")
plot(rgbImage(ch1,ch2,0*foci_label)) plot(rgbImage(ch1,ch2,0*foci_label))
......
...@@ -23,7 +23,8 @@ count_foci( ...@@ -23,7 +23,8 @@ count_foci(
watershed_stop = "off", watershed_stop = "off",
watershed_radius = 1, watershed_radius = 1,
watershed_tol = 0.05, watershed_tol = 0.05,
crowded_foci = TRUE crowded_foci = TRUE,
artificial_amp_factor = 1
) )
} }
\arguments{ \arguments{
...@@ -76,6 +77,8 @@ in foci channel. Defaults to 1 (small)} ...@@ -76,6 +77,8 @@ in foci channel. Defaults to 1 (small)}
\item{crowded_foci}{TRUE or FALSE, defaults to FALSE. Set to TRUE if you \item{crowded_foci}{TRUE or FALSE, defaults to FALSE. Set to TRUE if you
have foci > 100 or so.} have foci > 100 or so.}
\item{artificial_amp_factor}{For annotation only.}
} }
\value{ \value{
foci count per cell foci count per cell
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment