Last data update: 2014.03.03

R: Function used to segment all spots for a well
segmentAllSpotsR Documentation

Function used to segment all spots for a well

Description

segmentAllSpots is called by the imageHTS function segmentWells to segment the images of the screen

Usage

segmentAllSpots(x, uname, p, access)

Arguments

x

A imageHTS object.

uname

A character vector, containing the well names to segment. See getUnames for details.

p

List of parameters which are read from the file specified in segmentationPar of the segmentWells function.

access

A character string indicating how to access the data. Valid values are 'local', 'server' and 'cache', the default. See fileHTS for details.

Value

Returns a list with the following items cal: calibrated RGB image of the different channels nseg: nuclear segmentation mask cseg: cell segmentation mask

Author(s)

Felix A. Klein, felix.klein@embl.de

See Also

imageHTS, segmentWells, fileHTS

Examples

## see section 2.1 Image processing on cluster for a working example
localPath = tempdir()
serverURL = system.file("extdata", package = "PGPC")

imageConfFile = file.path("conf", "imageconf.txt")

## circumvent memory problem on 32bit windows by segementing only spot 1.
if(.Platform$OS.type == "windows" & R.Version()$arch == "i386")
    imageConfFile = file.path("conf", "imageconf_windows32.txt")

x = parseImageConf(imageConfFile,
                   localPath=localPath,
                   serverURL=serverURL)


well = "045-01-C23"

## get segmentation parameter
p = readHTS(x, type = "file",
            filename = file.path("conf", "segmentationpar.txt"),
            format = "dcf")

segmentation = segmentAllSpots(x, well, p, access="cache")

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(PGPC)
Loading required package: EBImage
Loading required package: imageHTS
Loading required package: cellHTS2
Loading required package: RColorBrewer
Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.


Attaching package: 'Biobase'

The following object is masked from 'package:EBImage':

    channel

Loading required package: genefilter
Loading required package: splots
Loading required package: vsn
Loading required package: hwriter
Loading required package: locfit
locfit 1.5-9.1 	 2013-03-22
Loading required package: grid
Loading required package: SearchTrees
Loading required package: limma

Attaching package: 'limma'

The following object is masked from 'package:BiocGenerics':

    plotMA

Loading required package: gplots

Attaching package: 'gplots'

The following object is masked from 'package:stats':

    lowess

Loading required package: ggplot2

Attaching package: 'ggplot2'

The following object is masked from 'package:cellHTS2':

    annotate

Loading required package: geneplotter
Loading required package: lattice
Loading required package: annotate
Loading required package: AnnotationDbi
Loading required package: stats4
Loading required package: IRanges
Loading required package: S4Vectors

Attaching package: 'S4Vectors'

The following object is masked from 'package:gplots':

    space

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums


Attaching package: 'IRanges'

The following objects are masked from 'package:EBImage':

    resize, tile

Loading required package: XML
Loading required package: ChemmineR

Attaching package: 'ChemmineR'

The following object is masked from 'package:S4Vectors':

    fold

The following object is masked from 'package:limma':

    makeUnique

Loading required package: reshape2
Loading required package: plyr

Attaching package: 'plyr'

The following object is masked from 'package:IRanges':

    desc

The following object is masked from 'package:S4Vectors':

    rename

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/PGPC/segmentAllSpots.Rd_%03d_medium.png", width=480, height=480)
> ### Name: segmentAllSpots
> ### Title: Function used to segment all spots for a well
> ### Aliases: segmentAllSpots
> 
> ### ** Examples
> 
> ## see section 2.1 Image processing on cluster for a working example
> localPath = tempdir()
> serverURL = system.file("extdata", package = "PGPC")
> 
> imageConfFile = file.path("conf", "imageconf.txt")
> 
> ## circumvent memory problem on 32bit windows by segementing only spot 1.
> if(.Platform$OS.type == "windows" & R.Version()$arch == "i386")
+     imageConfFile = file.path("conf", "imageconf_windows32.txt")
> 
> x = parseImageConf(imageConfFile,
+                    localPath=localPath,
+                    serverURL=serverURL)
File "conf/imageconf.txt" read.
Number of plates= 48 
Number of replicates= 2 
Number of wells= 384 
Number of channels= 2 
Number of spots= 4 
> 
> 
> well = "045-01-C23"
> 
> ## get segmentation parameter
> p = readHTS(x, type = "file",
+             filename = file.path("conf", "segmentationpar.txt"),
+             format = "dcf")
> 
> segmentation = segmentAllSpots(x, well, p, access="cache")
segmentAllSpots 48 24 0.0007 0.00025 0.0001 0.005 100 3000 15000 150 724 1324 724 1324 400 TRUE TRUE TRUE TRUE 
read images 
smooth image 
computing nseg 
segmenting cells using Voronoi tesselation 
segmentation OK 
segmentAllSpots 48 24 0.0007 0.00025 0.0001 0.005 100 3000 15000 150 724 1324 724 1324 400 TRUE TRUE TRUE TRUE 
read images 
smooth image 
computing nseg 
segmenting cells using Voronoi tesselation 
segmentation OK 
segmentAllSpots 48 24 0.0007 0.00025 0.0001 0.005 100 3000 15000 150 724 1324 724 1324 400 TRUE TRUE TRUE TRUE 
read images 
smooth image 
computing nseg 
segmenting cells using Voronoi tesselation 
segmentation OK 
segmentAllSpots 48 24 0.0007 0.00025 0.0001 0.005 100 3000 15000 150 724 1324 724 1324 400 TRUE TRUE TRUE TRUE 
read images 
smooth image 
computing nseg 
segmenting cells using Voronoi tesselation 
segmentation OK 
 nbcells=10754Warning messages:
1: In readTIFF(x, all = all, ...) :
  TIFFReadDirectory: Unknown field with tag 65400 (0xff78) encountered
2: In readTIFF(x, all = all, ...) :
  TIFFReadDirectory: Unknown field with tag 65400 (0xff78) encountered
3: In readTIFF(x, all = all, ...) :
  TIFFReadDirectory: Unknown field with tag 65400 (0xff78) encountered
4: In readTIFF(x, all = all, ...) :
  TIFFReadDirectory: Unknown field with tag 65400 (0xff78) encountered
5: In readTIFF(x, all = all, ...) :
  TIFFReadDirectory: Unknown field with tag 65400 (0xff78) encountered
6: In readTIFF(x, all = all, ...) :
  TIFFReadDirectory: Unknown field with tag 65400 (0xff78) encountered
7: In readTIFF(x, all = all, ...) :
  TIFFReadDirectory: Unknown field with tag 65400 (0xff78) encountered
8: In readTIFF(x, all = all, ...) :
  TIFFReadDirectory: Unknown field with tag 65400 (0xff78) encountered
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>