count_foci: count_foci

Description Usage Arguments Details Value Author(s) Examples

View source: R/count_foci.R

Description

Calculates coincident foci in synaptonemal complex and foci channel, per cell

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
count_foci(
  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,
  strand_amp = 2,
  min_foci = -1,
  disc_size = 51,
  modify_problematic = "off",
  disc_size_foci = 5,
  C1 = 0.02,
  C2 = 0.46,
  C_weigh_foci_number = TRUE
)

Arguments

img_path,

path containing crops to analyse

stage,

meiosis stage of interest. Currently count_foci determines this with thresholding/ object properties in the synaptonemal complex channel by previosly calling the get_pachytene function. Note that if using this option, the count_foci function requires that the input directory contains a folder called “pachytene” with the crops in it.

offset_px,

Pixel value offset used in thresholding of synaptonemal complex channel

offset_factor,

Pixel value offset used in thresholding of foci channel

brush_size,

size of brush to smooth the foci channel. Should be small to avoid erasing foci.

brush_sigma,

sigma for Gaussian smooth of foci channel. Should be small to avoid erasing foci.

foci_norm,

Mean intensity to normalise all foci channels to.

annotation,

Choice to output pipeline choices (recommended to knit)

channel2_string

String appended to the files showing the channel illuminating synaptonemal complexes. Defaults to SYCP3

channel1_string

String appended to the files showing the channel illuminating foci. Defaults to MLH3

file_ext

file extension of your images e.g. tiff jpeg or png.

KO_str

string in filename corresponding to knockout genotype. Defaults to –.

WT_str

string in filename corresponding to wildtype genotype. Defaults to ++.

KO_out

string in output csv in genotype column, for knockout. Defaults to -/-.

WT_out

string in output csv in genotype column, for knockout. Defaults to +/+.

watershed_stop

Stop default watershed method with "on"

watershed_radius

Radius (ext variable) in watershed method used in foci channel. Defaults to 1 (small)

watershed_tol

Intensity tolerance for watershed method. Defaults to 0.05.

crowded_foci

TRUE or FALSE, defaults to FALSE. Set to TRUE if you have foci > 100 or so.

artificial_amp_factor

Amplification of foci channel, for annotation only.

strand_amp

multiplication of strand channel to make masks

min_foci

minimum pixel area for a foci. Depends on your dpi etc. Defaults to 4

disc_size

size of disc for local background calculation in synaptonemal complex channel

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"

disc_size_foci

size of disc for local background calculation in foci channel

C1

Default crispness criteria = sd(foci_area)/(mean(foci_area)+1)

C2

Alternative crisp criteria.

C_weigh_foci_number

choose crispness criteria- defaults to TRUE to use C1 (weighing with number). Otherwise set to FALSE to use C2

Details

In this function, masks for the synaptonemal complex (SC) and foci channel are created from the saved crops of single/individual cells. These masks are computed using (optional) input parameters related to meiosis stage/ how well spread chromosomes are (for the former) and related to smoothing, thresholding and how "crowded" foci are for the latter. Finally, these two masks are multiplied, and the number of objects found with EBImage's computeFeatures are the colocalizing foci.

The file, cell number, foci count etc. are output as a data frame.

Value

data frame with foci count per cell

Author(s)

Lucy McNeill

Examples

1
2
3
demo_path = paste0(system.file("extdata",package = "synapsis"))
foci_counts <- count_foci(demo_path,offset_factor = 3, brush_size = 3,
brush_sigma = 3, annotation = "on",stage = "pachytene")

mcneilllucy/synapsis documentation built on Dec. 21, 2021, 3:59 p.m.