Package 'codelink'

Title: Manipulation of Codelink microarray data
Description: This package facilitates reading, preprocessing and manipulating Codelink microarray data. The raw data must be exported as text file using the Codelink software.
Authors: Diego Diez
Maintainer: Diego Diez <[email protected]>
License: GPL-2
Version: 1.73.0
Built: 2024-07-03 05:17:37 UTC
Source: https://github.com/bioc/codelink

Help Index


Create a new x11 device

Description

Create a new x11 device with dimensions suited to be used with imageCodelink().

Usage

arrayNew(f=2, chip="rwgcod")

Arguments

chip

character; Codelink chip to be used in imageCodelink.

f

numerical; scaling factor.

Author(s)

Diego Diez

Examples

## Not run: 
    data(codelink.example)
    arrayNew()
    imageCodelink(codelink.example)

## End(Not run)

Determine the size of the array

Description

When loading Codelink arrays in text format (as exported from the Codelink software) this function retrieves the correct size of the array. This is useful beacuse those files contain and indetermined number of empty lines at the end. Thus, reading the entire data matrix don't works.

Note

Not meant to be used directly.

Author(s)

Diego Diez


averageProbes

Description

Takes a CodelinkSet object and computes the average (mean) and sd of duplicated probes.

Usage

averageProbes(object, parallel = FALSE)

Arguments

object

an object of class "CodelinkSet".

parallel

whether to use a parallel version (requires package multicore).

Details

This function will compute the mean() and sd() on each duplicated probe (i.e. identical probe id as for probeNames(). CodelinkSet objects use the per-array index to enable unique identifiers needed for ExpressionSet derived objects. Although the method probeNames() provides access to Codelink probe ids, this is inconvenient when dealing with other packages that make use of featureNames() to obtain probe ids and feed them to the corresponding annotation package.

In such cases CodelinkSet objects are not compatible with methods working on ExpressionSet objects. To avoid this limitation it is possible to construct a CodelinkSet object containing unique identifiers (CodelinkSetUnique class) by averaging the intensities of all replicated probes. This is done by computing the mean(). The sd() is also computed and stored in the slot sd.

The current implementation takes a lot of time so a parallelized version of lapply() may be used through the package 'multicore'. This is controlled by the argument 'parallel' which is FALSE by default.

According to the authors it is not actually possible to use 'multicore' in a GUI environment like the R.app Cocoa application in R, because this interferes with the events loop. Therefore it is adviced to use option 'parallel=TRUE' in an R session running in a shell.

Author(s)

Diego Diez

Examples

## Not run: 
    data(codelink.example)
	foo <- averageProbes(codelink.example)

## End(Not run)

Background correction of intensity values.

Description

Takes a CodelinkSet or Codelink object with Spot mean and Bkgd median values and performes background correction using one of the methods available.

Usage

bkgdCorrect(object, method = "half", preserve = FALSE, verbose = FALSE, offset = 0)

## S4 method for signature 'CodelinkSet'
codCorrect(object, method = "half", normexp.method="saddle", offset=0)

Arguments

object

an object of class CodelinkSet or Codelink.

method

the correction method to use, one of "none", "subtract", "half" and "normexp".

preserve

logical; if Smean and Bmedian slots should be preserved.

verbose

logical; if TRUE print some information with method normexp.

normexp.method

method used with normexp correction.

offset

numeric; value to add to intensities.

Details

Available methods are: . none: left intensities untouched. . subtract: simple subtraction of Bkgd median from Spot mean. . half: the same as above but aboid negative values setting all intensity values below zero to 0.5. . normexp: apply normexp background adjustment from package limma.

Value

An object of class Codelink with corrected intensity values, that is Ri slot.

Author(s)

Diego Diez

Examples

data(codset)
    codset <- codCorrect(codset, method = "half")

Dataset of class 'Codelink'

Description

Dataset from a h20kcod (Codelink Human UniSet I 20k) array containing 2 samples and ~20000 probes.

Usage

data(codelink.example)

Format

A Codelink object containing 20469 probes and 2 samples.

Author(s)

Diego Diez


Class CodelinkSet

Description

This is the storage class for Codelink data

Objects from the Class

Object are created after reading text codelink files with readCodelinkSet()

Description

CodelinkSet objects are derived from ExpressionSet and therefore inherits all their methods. Additional methods are defined to extract information:

Old Codelink-class objects can be converted into CodelinkSet instances using the function Codelink2CodelinkSet.

Extends

Directly extends class ExpressionSet.

Methods

Class-specific methods:

getWeight

Get the matrix of weights.

Author(s)

Diego Diez

Examples

## Not run: 
    data(codset)

## End(Not run)

Class CodelinkSetUnique

Description

This is the storage class for Codelink data– with unique probes

Objects from the Class

Object are created after applying averageProbes() on an object of the class CodelinkSet

Description

CodelinkSetUnique objects are derived from ExpressionSet and therefore inherits all the methods.

Note

More details are in the package vignette

Author(s)

Diego Diez

Examples

## Not run: 
    data(codelink.exprs)
    foo <- averageProbes(codelink.exprs)

## End(Not run)

Diagnostic plots for CodelinkSet object.

Description

This function performs several types of diagnostic plots using information from CodelinkSet objects.

Usage

codPlot(object, array, what = "ma", ...)

Arguments

object

a CodelinkSet object.

array

The array to use for plotting (by default array=1).

what

the type of plot (by default ma).

...

additional arguments passed to the appropriate functions.

Details

Plot types:

scatter

Scatter plot of the selected array intensities vs. the median array, or a second array if specified.

ma

MA plot of the selected array intensities vs. the median array, or a second array if specified. In the x-axis the value of A (mean abundance; A = Array1 + Array2) is plotted. In the y-axis the value of M (difference; M = Array1 - Array2) is plotted.

density

The distribution of intensities for each array in the dataset is plotted as a kernel density.

image

If the logical position of the probes in the array are available, this plot produces a pseudoimage of the array. The values of the "intensity", "bg" or "snr" can be selected with the 'signal' parameter (default signal="bg"). Color range can be controled with 'high' and 'low' parameters.

Author(s)

Diego Diez


Dataset of class 'CodelinkSet'

Description

Dataset from a h20kcod (Codelink Human UniSet I 20k) array containing 4 samples and ~20000 probes.

Usage

data(codelink.example)

Format

A Codelink object containing 20469 probes and 4 samples.

Author(s)

Diego Diez


Create weight for Codelink chips

Description

Create a weight matrix based on probe type and flags.

Usage

createWeights(object, type.weights = NULL, flag.weights = NULL)

Arguments

object

an object of class "Codelink" or "CodelinkSet".

type.weights

named character vector of type weights used.

flag.weights

named character vector of flag weights used.

Author(s)

Diego Diez

Examples

data(codset)
    w <- createWeights(codset)

Calculate cutoff based in CV.

Description

Takes a Codelink object and calculate cutoff based in CV.

Usage

cutCV(object, subset=c(1:dim(object)[2]))

Arguments

object

an object of class "Codelink".

subset

subset of arrays to calculate cutoff with

Details

First it computes the median of CV for each gene over all arrays. Then it computes the mean and sd of all medians. Finally:

cutoff = mean + 3 * sd

Author(s)

Diego Diez

Examples

## Not run: 
    # data: Normalized Codelink object merged.
    cutoff <- cutCV(data)

## End(Not run)

Determine decimal type of Codelink files

Description

Determine decimal type of Codelink files.

Usage

decDetect(file, nlines)

Arguments

file

the file to be read.

nlines

number of lines to skip.

Value

Decimal type.

Author(s)

Diego Diez


Select probes based on fold change calculation

Description

Takes a Codelink object and calculate fold changes (M) between two conditions (samples). Then select genes based on those who pass the passed cutoff.

Usage

fc2Cond(object, cond1=NULL, cond2=NULL, fc=1.0, verbose=FALSE)

Arguments

object

an object of class "Codelink".

cond1

numeric or character; First condition to compute M.

cond2

numeric or character; Second condition to compute M.

fc

value of the fold change cutoff

verbose

logical; if some information is printed on the console.

Details

Conditions can be passed as characters or as numeric index from the sample slot. The intensities are internally transformed to log2 if needed. The M value is computed as:

M = cond1 - cond2

Value

A logical vector indicating which genes pass the cutoff

Author(s)

Diego Diez


Merge Codelink Bioarrays Data

Description

Merge data in a Codelink Object corresponding to same samples. Need a vector indicating the classes and an optional vector indicating the labels of the mer- ged samples.

Usage

mergeArray(object, class, names=NULL, method="mean",
             log.it=FALSE, merge.snr=TRUE)

Arguments

object

an object of class "Codelink".

class

a numeric vector indicating the classes.

names

an optional character vector indicating labels for each class.

method

the method used to summarize. Currently only "mean" supported.

log.it

logical; a logical indicating if log2 values should be returned.

merge.snr

logical; a logical indicating if SNR values should be merged.

Value

An object of class "Codelink".

Author(s)

Diego Diez

Examples

## Not run: 
	data(codelink.example)
	codelink.example <- bkgdCorrect(codelink.example)
	codelink.example <- normalize(codelink.example, log.it = FALSE)
	codelink.example <- mergeArray(codelink.example, class = c(1,1),
					names = "SAMPLE", log.it = TRUE)

## End(Not run)

Set NAs to FALSE

Description

Takes a logical vector as input and set all NAs to FALSE. This may happens when comparison is done on NA values.

Usage

na2false(x)

Arguments

x

a logical vector.

Value

A logical vector without NAs.

Author(s)

Diego Diez

Examples

## Not run: 
    a <- c(1, 2, 3, NA, 5)
    b <- c(5, 4, NA, 2, 1)
    sel <- a > b
    sel <- na2false(sel)

## End(Not run)

Normalization wrapper for Codelink/CodelinkSet objects.

Description

Takes a CodelinkSet or Codelink object and applies normalization to intensity values.

Usage

## S4 method for signature 'Codelink'
normalize(object, method="quantiles", log.it=TRUE, preserve=FALSE, weights=NULL, loess.method="fast")
	
## S4 method for signature 'CodelinkSet'
normalize(object, method="quantile", log.it=TRUE, weights=NULL, loess.method="fast")
    
## S4 method for signature 'CodelinkSet'
codNormalize(object, method="quantile", log.it=TRUE, weights=NULL, loess.method="fast")

Arguments

object

an object of class CodelinkSet or Codelink.

method

method to use in normalization.

log.it

logical; if data should be log2.

preserve

logical; if Ri slot should be preserved.

weights

weights for method CyclicLoess.

loess.method

loess method to be used, default to 'fast'.

Details

Currently supported methods include "median", "quantile" and "loess". Normalization functions are borrowed from the limma package.

If a matrix of weights is passed for CyclicLoess normalization, a vector is constructed taking the lowest weight for each probe.

Value

A CodelinkSet or Codelink object with normalized intensity values.

Author(s)

Diego Diez

Examples

data(codset)
	# Background correction.
	codset <- codCorrect(codset, method = "half")
	# Normalization.
	codset <- normalize(codset, method = "quantile")

Plot correlation scatterplot between two arrays

Description

Takes a Codelink object as argument and plot Correlation scatterplot of two arrays.

Usage

plotCorrelation(object, x=1, y=2, cutoff=FALSE, label="type", title=NULL, xlim=NULL, ylim=NULL)

Arguments

object

an object of class "Codelink".

x

array to be used in x axis.

y

array to be used in y axis.

cutoff

cutoff used to show fold change.

label

labels to shown.

title

The title of the plot.

xlim

range for the X axis.

ylim

range for the Y axis.

Author(s)

Diego Diez

See Also

plot

Examples

## Not run: 
    data(codelink.example)
    plotCorrelation(codelink.example)

## End(Not run)

Plot of CV

Description

Takes a Codelink object and plot de distribution of CV after applying mergeCodelink.

Usage

plotCV(object, subset=c(1:dim(object)[2]), cutoff=NULL, title=NULL, legend.cex=1)

Arguments

object

an object of class "Codelink".

subset

subset of arrays to plot

cutoff

cutoff of CV to be shown.

title

title of the plot.

legend.cex

factor to apply to the fonts in the legend to fit.

Author(s)

Diego Diez


Plot Densities

Description

Takes a Codelink object and plot the distributions of intensities.

Usage

plotDensities(object, what = NULL, title = NULL, col = NULL, 
	legend.title = NULL, legend.cex=1, ...)

Arguments

object

an object of class "Codelink"

what

what data to plot, one of "bg", "smean", "snr", "ri" or "ni"

title

title of the plot

col

vector of colors

legend.title

if provided, a title for the legend

legend.cex

font factor use in legend

...

further arguments to be passed to plot() and line() functions (e.g. lwd, etc.)

Author(s)

Diego Diez

Examples

## Not run: 
    data(codelink.example)
    plotDensities(codelink.example)

## End(Not run)

MA plot

Description

Takes a Codelink object and plot M vs A.

Usage

plotMA(object, array1 = 1, array2 = NULL, cutoff = c(-1, 1), label = NULL,
    type = NULL, high.list = NULL, high.col = "blue", high.pch = 21,
	high.bg = "cyan",	snr = NULL, snr.cutoff = 1, legend.x = NULL, pch = ".", 
	subset = NULL, title = NULL, xlim = NULL, ylim = NULL)

Arguments

object

an object of class "Codelink" or "MAarrayLM".

array1

first array to be used.

array2

second array to be used.

cutoff

cutoff to be used as fold change markeer.

label

type of labeling used in legend.

type

spot type information.

high.list

list of genes highlighted.

high.col

color used for high genes.

high.pch

pch used for high genes.

high.bg

background color used for high genes.

snr

vector with SNR values, usually, taking rowMeans() from a SNR matrix.

snr.cutoff

SNR cutoff used for label spots.

legend.x

relative position of the legend.

pch

pch style used to main spots.

subset

subset of spots used to plot based on 'type' slot.

title

title of the plot.

xlim

range for the X axis.

ylim

range for the Y axis.

Details

This function has suffered recent re-working, to increase the usability and to clean a little bit the code.

If array2 is NULL a median array is computed using all available arrays. Then the values of M and A are computed using the following formula:

M = array2 - array1

A = (array2 + array1) / 2

If type information is available in the Codelink object, or provided throught the 'type' argument, spots are colored based on that. DISCOVERY spots are plotted black with pch = "." whereas the other classes are plotted with different background colors, using gray as border to increase contrasts. For that pch = 21 is used. If snr is specified as label option, the SNR is used to label spots, if available in the Codelink object. In this case, the mean SNR across all arrays is used when array2 = NULL.

Some parameters may not be working right now, as the new function is using a different method to labels spots.

The legend is 'automagically' located, but this can be overrided with the legend.x argument.

In addition, a subset of the spots can be plotted based on type information when available. This allows, for example, to plot only DISCOVERY spots.

Author(s)

Diego Diez

Examples

## Not run: 
    data(codelink.example)
    plotMA(codelink.example)

## End(Not run)

Print briefly a Codelink object

Description

Takes a Codelink object and print a summary information of the data estored. It is based on printHead() from package limma.

Usage

printHead(x)

Arguments

x

an object of class "Codelink".

Author(s)

Diego Diez


Read Header from Codelink Bioarrays Files

Description

Read the header of Codelink files and obtein usefull information.

Usage

readHeader(file, dec=FALSE)

Arguments

file

File to read.

dec

logical; If TRUE determine decimal point.

Value

A list with header and other usefull information.

Author(s)

Diego Diez

Examples

## Not run: 
    files <- list.files(pattern = "TXT")
    head <- readHeader(files[1])

## End(Not run)

Read Header from XLS exported Codelink Bioarrays Files

Description

Read the header of Codelink files and obtain useful information.

Usage

readHeaderXLS(file, dec=FALSE)

Arguments

file

File to read.

dec

logical; If TRUE determine decimal point.

Details

This function is not meant to be used by normal users.

Value

A list with header and other usefull information.

Author(s)

Diego Diez

Examples

## Not run: 
    files <- list.files(pattern = "TXT")
    head <- readHeaderHeader(files[1])

## End(Not run)

Select based on CV cutoff.

Description

Takes a Codelink object and select genes based on CV cutoff.

Usage

selCV(object, cutoff)

Arguments

object

an object of class "Codelink".

cutoff

cutoff normaly calculated with cutCV()

Value

A logical vector.

Author(s)

Diego Diez


Calculate SNR

Description

Compute SNR inside read.Codelink.

Usage

SNR(Smean, Bmedian, Bstdev)

Arguments

Smean

matrix of Smean intensities.

Bmedian

matrix of background median intensities.

Bstdev

matrix of background standard deviation.

Author(s)

Diego Diez