Package 'flowCHIC'

Title: Analyze flow cytometric data using histogram information
Description: A package to analyze flow cytometric data of complex microbial communities based on histogram images
Authors: Joachim Schumann <[email protected]>, Christin Koch <[email protected]>, Ingo Fetzer <[email protected]>, Susann Müller <[email protected]>
Maintainer: Author: Joachim Schumann <[email protected]>
License: GPL-2
Version: 1.39.0
Built: 2024-06-30 04:57:58 UTC
Source: https://github.com/bioc/flowCHIC

Help Index


Analyze flow cytometric data using histogram information

Description

A package to analyze flow cytometric data of complex microbial communities based on histogram images.

Details

Package: flowCHIC
Type: Package
Version: 1.0.1
Date: 2014-11-26
License: GPL-2

abiotic_incol fcs_to_img flowCHIC img_sub calculate_overlaps_xor plot_nmds Results_xor_mix Results_xor_incol Results_overlaps_mix Results_overlaps_incol

Author(s)

Joachim Schumann [email protected], Christin Koch [email protected], Ingo Fetzer [email protected], Susann Müller [email protected]

References

Christin Koch, Ingo Fetzer, Hauke Harms, and Susann Müller. CHIC - An Automated Approach for the Detection of Dynamic Variations in Complex Microbial Communities. Cytometry Part A, 2013.

See Also

flowCore,flowViz,flowCyBar


Dataset with abiotic data

Description

Example dataset containing abiotic parameters used for the NMDS plot of the second downloadable dataset (see manual).

Usage

data(abiotic_incol)

Format

Data frame with 17 observations of 6 variables.

Value

Abiotic data of the second downloadable dataset.


Calculate overlap and XOR images

Description

Calculate overlap and XOR images for each combination of every subset histogram image.

Usage

## S4 method for signature 'character'
calculate_overlaps_xor(subsets,verbose=FALSE)

Arguments

subsets

List of the subset image files. All files have to be in one folder. See the manual for more information about creating the list.

verbose

logical (default=FALSE). Change to TRUE to print the calculated values to two new files called "Results_overlaps.txt" and "Results_xor.txt" to the working directory.

Details

After saving a list containing the filenames of the subset histogram images this method calculates the XOR and overlap images/values for each combination of every image, returns the values and is able to write the values to two new files called "Results_overlaps.txt" and "Results_xor.txt" (see example section). See reference Koch et al. 2013 for more information about the calculation.

Value

The calculate_overlaps_xor() method calculates the overlap and XOR images and returns a list with two data frames containing the calculated data.

Author(s)

Joachim Schumann [email protected], Christin Koch [email protected], Ingo Fetzer [email protected], Susann Müller [email protected]

References

Christin Koch, Ingo Fetzer, Hauke Harms, and Susann Müller. CHIC - An Automated Approach for the Detection of Dynamic Variations in Complex Microbial Communities. Cytometry Part A, 2013.

Examples

require(EBImage)

## Calculate the overlap and XOR images
## Save the returned values as a list

# Get a list of the filenames of the FCS files
files <- list.files(system.file("extdata",package="flowCHIC"),
full=TRUE,pattern="*.fcs")
# Create histogram images and save them
fcs_to_img(files)
# Create subsets
img_sub(files,x_start=200,x_end=3500,y_start=1000,y_end=3000,maxv=160)
# Get a list of the filenames of the PNG files
subsets <- list.files(path=paste(getwd(),"chic_subset",sep="/"),full=TRUE,pattern="*.png")
# Calculate and save values as a list
results<-calculate_overlaps_xor(subsets)

## Calculate the overlap and XOR images
## Two new files called "Results_overlaps.txt" and
## "Results_xor.txt" are written to the working directory

# Get a list of the filenames of the FCS files
files <- list.files(system.file("extdata",package="flowCHIC"),
full=TRUE,pattern="*.fcs")
# Create histogram images and save them
fcs_to_img(files)
# Create subsets
img_sub(files,x_start=200,x_end=3500,y_start=1000,y_end=3000,maxv=160)
# Get a list of the filenames of the PNG files
subsets <- list.files(path=paste(getwd(),"chic_subset",sep="/"),full=TRUE,pattern="*.png")
# Calculate
calculate_overlaps_xor(subsets,verbose=TRUE)

FCS files to images

Description

Create histogram images of FCS files.

Usage

## S4 method for signature 'character'
fcs_to_img(files,transformation=FALSE,ch1="FS.Log",ch2="FL.4.Log",width=300,height=300,...)

Arguments

files

List of all .fcs files. All files have to be in one folder. See the manual for more information about creating the list.

transformation

Character string to define the type of data transformation (default=FALSE). Fore more details type "?read.FCS" into R command line.

ch1

Character string indicating the first channel of the histogram (x-axis) (default="FS.Log"). See the manual for more details.

ch2

Character string indicating the second channel of the histogram (y-axis) (default="FL.4.Log"). See the manual for more details.

width

Width (pixel) of the resulting histogram image (default=300).

height

Height (pixel) of the resulting histogram image (default=300).

...

Additional parameters used for reading the FCS files, for creating the PNG images and for creating the plots. Fore more details type "?read.FCS", "?png" or "??ggplot2" into R command line.

Details

This method creates histogram images of FCS files using the ggplot method of the package "ggplot2" (see reference Wickham 2009). After creating a list containing the names of the FCS files a new folder called "chic_images" is created in the working directory that contains the histogram images. Choose the two channels that are used for plotting on the x/y-axis.

Value

The fcs_to_img() method creates histogram images of FCS files.

Author(s)

Joachim Schumann [email protected], Christin Koch [email protected], Ingo Fetzer [email protected], Susann Müller [email protected]

References

H. Wickham. ggplot2: elegant graphics for data analysis. Springer New York,2009.

Examples

require(flowCore)
require(ggplot2)

## Write the histogram images of the FCS files that are included 
## to the package in a new subfolder of the working directory
## called "chic_images"

# Get a list of the filenames of the FCS files
files <- list.files(system.file("extdata",package="flowCHIC"),
full=TRUE,pattern="*.fcs")
# Create histogram images and save them
fcs_to_img(files)

Create image subsets

Description

Create subsets of FCS files and the resulting histogram images.

Usage

## S4 method for signature 'character'
img_sub(files,transformation=FALSE,ch1="FS.Log",ch2="FL.4.Log",x_start=0,x_end=4095,y_start=0,y_end=4095,xbin=128,maxv=200,width=300,height=300,...)

Arguments

files

Character list of .fcs files. All files have to be in one folder. See the manual for more information about creating the list.

transformation

Character string to define the type of data transformation (default=FALSE). Fore more details type "?read.FCS" into R command line.

ch1

Character string indicating the first channel of the histogram (x-axis) (default="FS.Log"). See the manual for more details.

ch2

Character string indicating the second channel of the histogram (y-axis) (default="FL.4.Log"). See the manual for more details.

x_start

Start of the rectangle gate on the x-axis (default=0). See the manual for more details.

x_end

End of the rectangle gate on the x-axis (default=4095). See the manual for more details.

y_start

Start of the rectangle gate on the y-axis (default=0). See the manual for more details.

y_end

End of the rectangle gate on the y-axis (default=4095). See the manual for more details.

xbin

Number of bins within the histogram (default=128).

maxv

Maximal value of the expressions within the histogram that is set to the highest color value (black) (default=200). See the manual for more details.

width

Width (pixel) of the resulting histogram image (default=300).

height

Height(pixel) of the resulting histogram image (default=300).

...

Additional parameters used for reading the FCS files, creating the PNG images and for plotting. For more details type "?read.FCS", "?png" or "??ggplot2" into R command line.

Details

This method creates subsets of FCS files and the resulting histogram images using the ggplot method of the package "ggplot2" (see reference Wickham 2009). After creating a list containing the names of the FCS files a new folder called "chic_subset" is created in the working directory that contains the subset histogram images. Choose the two channels that are used for plotting on the x/y-axis. Define the start and the end of the rectangle gate of both axes. See the manual for more details.

Value

The img_sub() method creates subsets of the histogram images.

Author(s)

Joachim Schumann [email protected], Christin Koch [email protected], Ingo Fetzer [email protected], Susann Müller [email protected]

References

H. Wickham. ggplot2: elegant graphics for data analysis. Springer New York,2009.

Examples

require(flowCore)
require(ggplot2)

## Write the subset histogram images of the FCS files that are included 
## to the package in a new subfolder of the working directory
## called "chic_subset"

# Get a list of the filenames of the FCS files
files <- list.files(system.file("extdata",package="flowCHIC"),
full=TRUE,pattern="*.fcs")
# Create subsets
img_sub(files,x_start=200,x_end=3500,y_start=1000,y_end=3000,maxv=160)

NMDS plot of samples

Description

NMDS plot of samples based on the calculated XOR and overlap values

Usage

## S4 method for signature 'data.frame,data.frame'
plot_nmds(x,y,show_cluster=FALSE,type="p",main="",col_nmds="black",cex=0.6,pos=1,
group,legend_pos="topleft",abiotic,p.max=0.05,col_abiotic="magenta",verbose=FALSE,...)

Arguments

x

Table with calculated overlap data.

y

Table with calculated XOR data.

show_cluster

logical (default=FALSE). Change to TRUE if cluster dendrogram shall be plotted.

type

Type of the plot (default="p"). The "p" indicates points without connecting lines within the plot. Only used if group=FALSE. For more details type "?points" into R command line.

main

Character string used as title of the NMDS plot (default="").

col_nmds

Color used for the plotted data points if group=FALSE (default="black").

cex

numeric (default=0.6). Character expansion factor. Used for the final size of the characters.

pos

Position of the text (default=2). Values of 1, 2, 3 and 4, respectively indicate positions below, to the left of, above and to the right of the specified coordinates.

group

Data frame containing group assignments. The order and the number of these groups has to be identical to the order and the number of the samples printed in R. Use only integer values in the range from 1 to 25. See the manual for more details.

legend_pos

Position of the legend (default="topleft") if group=TRUE. For more details type "?legend" into R command line.

abiotic

Table with abiotic data. Should be a tab-delimited text file using '.' as decimal delimiter. Use one row for one sample and one column for one abiotic or experimental parameter. Use the first column for the first parameter and the first line as header. The order and the number of the lines has to be identical to the order and the number of the samples printed in R.

p.max

Decimal number defining the significance level of the abiotic parameters (default=0.05) if abiotic=TRUE. Only parameters less/equal this value are plotted.

col_abiotic

Color used for the plotted abiotic parameters (default="magenta").

verbose

logical (default=FALSE). Do not print additional information. Change to TRUE to print results of the metaMDS method and the p-values of the abiotic parameters.

...

Additional parameters used for plotting the data points if group=FALSE. For more details type "?points" into R command line.

Details

This method is used for calculating the similarities found in the histogram images of cytometric data. A dissimilarity matrix is generated from the pairwise comparison of histogram images based on the values returned by the method calculate_overlaps_xor or saved in the files "Results_overlaps.txt" and "Results_xor.txt". See reference Koch et al. 2013 for more details. Ensuing from this matrix nonmetric multidimensional scaling (NMDS) is performed to show the results. The NMDS plot is calculated using the metaMDS method of the package "vegan" (see reference Warnes et al. 2013). In addition, a cluster analysis can be performed to reveal samples with high similarities.

Value

The plot_nmds() method calculates a NMDS plot of the samples and an additional cluster dendrogram.

Author(s)

Joachim Schumann [email protected], Christin Koch [email protected], Ingo Fetzer [email protected], Susann Müller [email protected]

References

Christin Koch, Ingo Fetzer, Hauke Harms, and Susann Müller. CHIC - An Automated Approach for the Detection of Dynamic Variations in Complex Microbial Communities. Cytometry Part A, 2013.

Jari Oksanen, F. Guillaume Blanchet, Roeland Kindt, Pierre Legendre, Peter R. Minchin, R. B. O'Hara, Gavin L. Simpson, Peter Solymos, M. Henry H. Stevens and Helene Wagner (2013). vegan: Community Ecology Package. R package version 2.0-10. http://CRAN.R-project.org/package=vegan

Examples

require(vegan)

## Show the NMDS plot of the sample files
## included to the package

# Get a list of the filenames of the FCS files
files <- list.files(system.file("extdata",package="flowCHIC"),
full=TRUE,pattern="*.fcs")
# Create histogram images
fcs_to_img(files)
# Create subsets
img_sub(files,x_start=200,x_end=3500,y_start=1000,y_end=3000,maxv=160)
# Get a list of the filenames of the subset PNG files
subsets <- list.files(path=paste(getwd(),"chic_subset",sep="/"),full=TRUE,pattern="*.png")
# Calculate
results<-calculate_overlaps_xor(subsets)
# Show NMDS plot ensuing from the returned values
plot_nmds(x=results$overlap,y=results$xor)


## Show the NMDS plot of the dataset "mix""

data(Results_overlaps_mix)
data(Results_xor_mix)
plot_nmds(Results_overlaps_mix,Results_xor_mix)

## Show the NMDS plot of the dataset "incol""

data(Results_overlaps_incol)
data(Results_xor_incol)
plot_nmds(Results_overlaps_incol,Results_xor_incol)

## Show the NMDS plot of the dataset "incol"" with group assignment
## and abiotic data
## Print results of the metaMDS method and the p-values of the abiotic parameters
## Show a cluster dendrogram

data(Results_overlaps_incol)
data(Results_xor_incol)
groups<-data.frame("groups"=c(15,19,19,19,15,22,19,15,22,15,15,22,22,22,22,19,19))
data(abiotic_incol)
plot_nmds(Results_overlaps_incol,Results_xor_incol,show_cluster=TRUE,group=groups,abiotic=abiotic_incol[,-1],verbose=TRUE)

Dataset with labels and sums of informative pixels within the overlap area of the FCS files included to the package

Description

Example dataset containing labels and areas of each image pair of the FCS files included to the package.

Usage

data(Results_overlaps)

Format

Data frame with 3 observations of 2 variables.

Value

Results of the method calculate_overlaps_xor() on the FCS files included to the package.


Dataset with labels and sums of informative pixels within the overlap area of the second downloadable dataset

Description

Example dataset containing labels and areas of each image pair of the second downloadable dataset (see manual).

Usage

data(Results_overlaps_incol)

Format

Data frame with 136 observations of 2 variables.

Value

Results of the method calculate_overlaps_xor() on the subsets of the second downloadable dataset.


Dataset with labels and sums of informative pixels within the overlap area of the first downloadable dataset

Description

Example dataset containing labels and areas of each image pair of the first downloadable dataset (see manual).

Usage

data(Results_overlaps_mix)

Format

Data frame with 4005 observations of 2 variables.

Value

Results of the method calculate_overlaps_xor() on the subsets of the first downloadable dataset.


Dataset with labels and intensity values of the FCS files included to the package

Description

Example dataset containing labels and intensity values of each image pair of the FCS files included to the package.

Usage

data(Results_xor)

Format

Data frame with 3 observations of 2 variables.

Value

Results of the method calculate_overlaps_xor() on the FCS files included to the package.


Dataset with labels and intensity values of the second downloadable dataset

Description

Example dataset containing labels and intensity values of each image pair of the second downloadable dataset (see manual).

Usage

data(Results_xor_incol)

Format

Data frame with 136 observations of 2 variables.

Value

Results of the method calculate_overlaps_xor() on the subsets of the second downloadable dataset.


Dataset with labels and intensity values of the first downloadable dataset

Description

Example dataset containing labels and intensity values of each image pair of the first downloadable dataset (see manual).

Usage

data(Results_xor_mix)

Format

Data frame with 4005 observations of 2 variables.

Value

Results of the method calculate_overlaps_xor() on the subsets of the first downloadable dataset.