Commit a85ab430 authored by Lucy McNeill's avatar Lucy McNeill
Browse files

count_foci includes crisp criteria which user can set. No errors or warnings with BiocCheck()

parent fd5b3bb5
No preview for this file type
...@@ -12,6 +12,7 @@ importFrom(EBImage,computeFeatures.basic) ...@@ -12,6 +12,7 @@ importFrom(EBImage,computeFeatures.basic)
importFrom(EBImage,computeFeatures.moment) importFrom(EBImage,computeFeatures.moment)
importFrom(EBImage,computeFeatures.shape) importFrom(EBImage,computeFeatures.shape)
importFrom(EBImage,display) importFrom(EBImage,display)
importFrom(EBImage,distmap)
importFrom(EBImage,filter2) importFrom(EBImage,filter2)
importFrom(EBImage,makeBrush) importFrom(EBImage,makeBrush)
importFrom(EBImage,readImage) importFrom(EBImage,readImage)
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#' @importFrom EBImage bwlabel channel colorLabels computeFeatures #' @importFrom EBImage bwlabel channel colorLabels computeFeatures
#' computeFeatures.basic computeFeatures.moment computeFeatures.shape #' computeFeatures.basic computeFeatures.moment computeFeatures.shape
#' display filter2 makeBrush readImage rgbImage rmObjects rotate writeImage #' display filter2 makeBrush readImage rgbImage rmObjects rotate writeImage
#' distmap
#' watershed resize #' watershed resize
#' @importFrom graphics text #' @importFrom graphics text
#' @importFrom utils str #' @importFrom utils str
......
This diff is collapsed.
...@@ -12,7 +12,10 @@ annotate_foci_counting( ...@@ -12,7 +12,10 @@ annotate_foci_counting(
artificial_amp_factor, artificial_amp_factor,
strands, strands,
coincident_foci, coincident_foci,
foci_label foci_label,
alone_foci,
percent_px,
foci_per_cell
) )
} }
\arguments{ \arguments{
...@@ -31,6 +34,16 @@ annotate_foci_counting( ...@@ -31,6 +34,16 @@ annotate_foci_counting(
\item{coincident_foci}{mask of overlap between strand and foci channel} \item{coincident_foci}{mask of overlap between strand and foci channel}
\item{foci_label}{black and white mask of foci channel} \item{foci_label}{black and white mask of foci channel}
\item{alone_foci}{estimated number of foci that are NOT on a strand.}
\item{percent_px}{percentage of foci mask that coincides with strand channel
small number indicates potentially problematic image.}
\item{foci_per_cell}{number of foci counted per cell}
}
\value{
displays key steps from raw image to coincident foci count
} }
\description{ \description{
Contains all plotting routines for count foci annotation Contains all plotting routines for count foci annotation
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/count_foci.R
\name{annotate_foci_counting_adjusted}
\alias{annotate_foci_counting_adjusted}
\title{annotate_foci_counting_adjusted}
\usage{
annotate_foci_counting_adjusted(
img_file,
cell_count,
img_orig,
img_orig_foci,
artificial_amp_factor,
strands,
coincident_foci,
foci_label,
alone_foci,
percent_px,
foci_per_cell
)
}
\arguments{
\item{img_file}{cell's file name}
\item{cell_count}{unique cell counter}
\item{img_orig}{original strand crop}
\item{img_orig_foci}{cropped foci channel}
\item{artificial_amp_factor}{amplification factor}
\item{strands}{black white mask of strand channel}
\item{coincident_foci}{mask of overlap between strand and foci channel}
\item{foci_label}{black and white mask of foci channel}
\item{alone_foci}{estimated number of foci that are NOT on a strand.}
\item{percent_px}{percentage of foci mask that coincides with strand channel
small number indicates potentially problematic image.}
\item{foci_per_cell}{number of foci counted per cell}
}
\value{
displays key steps from raw image to coincident foci count
}
\description{
Contains all plotting routines for count foci annotation
}
...@@ -17,7 +17,9 @@ append_data_frame( ...@@ -17,7 +17,9 @@ append_data_frame(
foci_per_cell, foci_per_cell,
image_mat, image_mat,
percent_px, percent_px,
alone_foci alone_foci,
discrepant_category,
C1
) )
} }
\arguments{ \arguments{
...@@ -51,6 +53,13 @@ Defaults to -/-.} ...@@ -51,6 +53,13 @@ Defaults to -/-.}
small number indicates potentially problematic image.} small number indicates potentially problematic image.}
\item{alone_foci}{estimated number of foci that are NOT on a strand.} \item{alone_foci}{estimated number of foci that are NOT on a strand.}
\item{discrepant_category}{estimated number of foci that are NOT on a strand.}
\item{C1}{criteria}
}
\value{
data frame with new row
} }
\description{ \description{
applies new row to data frame applies new row to data frame
......
...@@ -27,7 +27,12 @@ count_foci( ...@@ -27,7 +27,12 @@ count_foci(
artificial_amp_factor = 1, artificial_amp_factor = 1,
strand_amp = 2, strand_amp = 2,
min_foci = -1, min_foci = -1,
disc_size = 51 disc_size = 51,
modify_problematic = "off",
disc_size_foci = 7,
C1 = 0.02,
C2 = 0.46,
C_weigh_foci_number = TRUE
) )
} }
\arguments{ \arguments{
...@@ -71,7 +76,7 @@ Defaults to -/-.} ...@@ -71,7 +76,7 @@ Defaults to -/-.}
\item{WT_out}{string in output csv in genotype column, for knockout. \item{WT_out}{string in output csv in genotype column, for knockout.
Defaults to +/+.} Defaults to +/+.}
\item{watershed_stop}{Turn off default watershed method with "off"} \item{watershed_stop}{Stop default watershed method with "on"}
\item{watershed_radius}{Radius (ext variable) in watershed method used \item{watershed_radius}{Radius (ext variable) in watershed method used
in foci channel. Defaults to 1 (small)} in foci channel. Defaults to 1 (small)}
...@@ -88,9 +93,22 @@ have foci > 100 or so.} ...@@ -88,9 +93,22 @@ have foci > 100 or so.}
\item{min_foci}{minimum pixel area for a foci. Depends on your dpi etc. Defaults to 4} \item{min_foci}{minimum pixel area for a foci. Depends on your dpi etc. Defaults to 4}
\item{disc_size}{size of disc for local background calculation in dna channel} \item{disc_size}{size of disc for local background calculation in dna channel}
\item{modify_problematic}{option for synapsis to try and "save" images which
have likely been counted incorrectly due to a number of reasons. Default
settings are optimized for mouse pachytene. Defaults to "off"}
\item{disc_size_foci}{size of disc for local background calculation in foci channel}
\item{C1}{Default crispness criteria = sd(foci_area)/(mean(foci_area)+1)}
\item{C2}{Alternative crisp criteria.}
\item{C_weigh_foci_number}{choose crispness criteria- defaults to TRUE to use
C1 (weighing with number). Otherwise set to FALSE to use C2}
} }
\value{ \value{
foci count per cell data frame with foci count per cell
} }
\description{ \description{
Calculates coincident foci in SC and foci channel, per cell Calculates coincident foci in SC and foci channel, per cell
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/count_foci.R
\name{get_C1}
\alias{get_C1}
\title{get_C1}
\usage{
get_C1(foci_areas, foci_per_cell, C_weigh_foci_number)
}
\arguments{
\item{foci_areas}{pixel area of each foci}
\item{foci_per_cell}{foci count for cell}
\item{C_weigh_foci_number}{choose crispness criteria- defaults to TRUE to use
C1 (weighing with number). Otherwise set to FALSE to use C2}
}
\value{
statistic to comapre to crisp_criteria
}
\description{
calculates the statistic to compare to crisp_criteria, which determines
whether the foci count will be reliable
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/count_foci.R
\name{get_coincident_foci}
\alias{get_coincident_foci}
\title{get_coincident_foci}
\usage{
get_coincident_foci(
offset_px,
offset_factor,
brush_size,
brush_sigma,
annotation,
watershed_stop,
watershed_radius,
watershed_tol,
crowded_foci,
artificial_amp_factor,
strand_amp,
disc_size,
disc_size_foci,
img_file,
cell_count,
img_orig,
img_orig_foci,
stage,
WT_str,
KO_str,
WT_out,
KO_out,
C1_search,
discrepant_category,
C1,
C2,
df_cells,
C_weigh_foci_number
)
}
\arguments{
\item{offset_px, }{Pixel value offset used in thresholding of dna channel}
\item{offset_factor, }{Pixel value offset used in thresholding of foci channel}
\item{brush_size, }{size of brush to smooth the foci channel. Should be small
to avoid erasing foci.}
\item{brush_sigma, }{sigma for Gaussian smooth of foci channel. Should be
small to avoid erasing foci.}
\item{annotation, }{Choice to output pipeline choices (recommended to knit)}
\item{watershed_stop}{Stop default watershed method with "on"}
\item{watershed_radius}{Radius (ext variable) in watershed method used
in foci channel. Defaults to 1 (small)}
\item{watershed_tol}{Intensity tolerance for watershed method. Defaults to 0.05.}
\item{crowded_foci}{TRUE or FALSE, defaults to FALSE. Set to TRUE if you
have foci > 100 or so.}
\item{artificial_amp_factor}{Amplification of foci channel, for annotation only.}
\item{strand_amp}{multiplication of strand channel to make masks}
\item{disc_size}{size of disc for local background calculation in dna channel}
\item{disc_size_foci}{size of disc for local background calculation in foci channel}
\item{stage, }{meiosis stage of interest. Currently count_foci determines
this with thresholding/ object properties in the dna channel. But will be
classified using ML model in future versions.}
\item{WT_str}{string in filename corresponding to wildtype genotype.
Defaults to ++.}
\item{KO_str}{string in filename corresponding to knockout genotype.
Defaults to --.}
\item{WT_out}{string in output csv in genotype column, for knockout.
Defaults to +/+.}
\item{KO_out}{string in output csv in genotype column, for knockout.
Defaults to -/-.}
\item{C1}{Default crispness criteria = sd(foci_area)/(mean(foci_area)+1)}
\item{C2}{Alternative crisp criteria.}
\item{C_weigh_foci_number}{choose crispness criteria- defaults to TRUE to use
C1 (weighing with number). Otherwise set to FALSE to use C2}
}
\value{
data frame with new row with most recent foci per cell appended
}
\description{
calculates the statistic to compare to crisp_criteria, which determines
whether the foci count will be reliable
}
...@@ -12,7 +12,6 @@ get_foci_per_cell( ...@@ -12,7 +12,6 @@ get_foci_per_cell(
watershed_stop, watershed_stop,
foci_label, foci_label,
annotation, annotation,
min_foci,
cell_count, cell_count,
img_orig, img_orig,
img_orig_foci, img_orig_foci,
...@@ -29,14 +28,12 @@ get_foci_per_cell( ...@@ -29,14 +28,12 @@ get_foci_per_cell(
\item{strands}{black white mask of strand channel} \item{strands}{black white mask of strand channel}
\item{watershed_stop}{Turn off default watershed method with "off"} \item{watershed_stop}{Stop default watershed method with "on"}
\item{foci_label}{black and white mask of foci channel} \item{foci_label}{black and white mask of foci channel}
\item{annotation, }{Choice to output pipeline choices (recommended to knit)} \item{annotation, }{Choice to output pipeline choices (recommended to knit)}
\item{min_foci}{minimum pixel area for a foci. Depends on your dpi etc. Defaults to 4}
\item{cell_count}{unique cell counter} \item{cell_count}{unique cell counter}
\item{img_orig}{original strand crop} \item{img_orig}{original strand crop}
...@@ -47,6 +44,9 @@ get_foci_per_cell( ...@@ -47,6 +44,9 @@ get_foci_per_cell(
\item{coincident_foci}{mask of coincident foci} \item{coincident_foci}{mask of coincident foci}
} }
\value{
number of foci per cell
}
\description{ \description{
creates mask for coincident foci creates mask for coincident foci
} }
...@@ -18,7 +18,7 @@ get_overlap_mask( ...@@ -18,7 +18,7 @@ get_overlap_mask(
\item{foci_label}{black and white mask of foci channel} \item{foci_label}{black and white mask of foci channel}
\item{watershed_stop}{Turn off default watershed method with "off"} \item{watershed_stop}{Stop default watershed method with "on"}
\item{img_orig_foci}{cropped foci channel} \item{img_orig_foci}{cropped foci channel}
...@@ -27,6 +27,9 @@ in foci channel. Defaults to 1 (small)} ...@@ -27,6 +27,9 @@ in foci channel. Defaults to 1 (small)}
\item{watershed_tol}{Intensity tolerance for watershed method. Defaults to 0.05.} \item{watershed_tol}{Intensity tolerance for watershed method. Defaults to 0.05.}
} }
\value{
mask with coincident foci on strands
}
\description{ \description{
creates mask for coincident foci creates mask for coincident foci
} }
...@@ -29,6 +29,9 @@ to avoid erasing foci.} ...@@ -29,6 +29,9 @@ to avoid erasing foci.}
\item{brush_sigma}{sigma for Gaussian smooth of foci channel. Should be \item{brush_sigma}{sigma for Gaussian smooth of foci channel. Should be
small to avoid erasing foci.} small to avoid erasing foci.}
} }
\value{
foci mask
}
\description{ \description{
creates foci mask for foci channel crop creates foci mask for foci channel crop
} }
...@@ -4,7 +4,14 @@ ...@@ -4,7 +4,14 @@
\alias{make_strand_mask} \alias{make_strand_mask}
\title{make_strand_mask} \title{make_strand_mask}
\usage{ \usage{
make_strand_mask(offset_px, stage, img_orig, disc_size) make_strand_mask(
offset_px,
stage,
img_orig,
disc_size,
brush_size,
brush_sigma
)
} }
\arguments{ \arguments{
\item{offset_px, }{Pixel value offset used in thresholding of dna channel} \item{offset_px, }{Pixel value offset used in thresholding of dna channel}
...@@ -14,6 +21,15 @@ make_strand_mask(offset_px, stage, img_orig, disc_size) ...@@ -14,6 +21,15 @@ make_strand_mask(offset_px, stage, img_orig, disc_size)
\item{img_orig}{original strand crop} \item{img_orig}{original strand crop}
\item{disc_size}{size of disc for local background calculation in dna channel} \item{disc_size}{size of disc for local background calculation in dna channel}
\item{brush_size, }{size of brush to smooth the foci channel. Should be small
to avoid erasing foci.}
\item{brush_sigma, }{sigma for Gaussian smooth of foci channel. Should be
small to avoid erasing foci.}
}
\value{
strand mask
} }
\description{ \description{
creates strand mask for strand channel crop creates strand mask for strand channel crop
......
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