CoCalc Public Filespuma-affy.ipynb
Author: Harald Schilly
Views : 90
Compute Environment: Ubuntu 18.04 (Deprecated)

# CoCalc running Bioconductor's puma & affy

In [1]:
require(puma)

In [2]:
?puma::calculateLimma

 calculateLimma {puma} R Documentation

## Calculate differential expression between conditions using limma

### Description

Runs a default analysis using the limma package. Automatically creates design and contrast matrices if not specified. This function is useful for comparing limma results with those of other differential expression (DE) methods such as pumaDE.

### Usage

calculateLimma(
eset
,	design.matrix = createDesignMatrix(eset)
,	contrast.matrix = createContrastMatrix(eset)
)


### Arguments

 eset An object of class ExpressionSet design.matrix A design matrix contrast.matrix A contrast matrix

### Details

The eset argument must be supplied, and must be a valid ExpressionSet object. Design and contrast matrices can be supplied, but if not, default matrices will be used. These should usually be sufficient for most analyses.

### Value

An object of class DEResult.

### Author(s)

Richard D. Pearson

Related methods pumaDE, calculateTtest, calculateFC, createDesignMatrix and createContrastMatrix and class DEResult

### Examples

if (require(affydata)) {
data(Dilution)
eset_rma <- affy:::rma(Dilution)
#	Next line used so eset_rma only has information about the liver factor
#	The scanner factor will thus be ignored, and the two arrays of each level
#	of the liver factor will be treated as replicates
pData(eset_rma) <- pData(eset_rma)[,1, drop=FALSE]
limmaRes <- calculateLimma(eset_rma)
topGeneIDs(limmaRes,numberOfGenes=6)
plotErrorBars(eset_rma, topGenes(limmaRes))
}


[Package puma version 3.18.0 ]
In [3]:
require(affydata)
data(Dilution)
eset_rma <- affy:::rma(Dilution)
#	Next line used so eset_rma only has information about the liver factor
#	The scanner factor will thus be ignored, and the two arrays of each level
#	of the liver factor will be treated as replicates
pData(eset_rma) <- pData(eset_rma)[,1, drop=FALSE]
limmaRes <- calculateLimma(eset_rma)
topGeneIDs(limmaRes,numberOfGenes=6)
plotErrorBars(eset_rma, topGenes(limmaRes))

Loading required package: affydata Loading required package: affy Attaching package: ‘affy’ The following objects are masked from ‘package:oligo’: intensity, MAplot, mm, mm<-, mmindex, pm, pm<-, pmindex, probeNames, rma The following object is masked from ‘package:oligoClasses’: list.celfiles
Package LibPath Item [1,] "affydata" "/ext/sage/sage-8.0/local/lib/R/library" "Dilution" Title [1,] "AffyBatch instance Dilution"
Background correcting Normalizing Calculating Expression
Loading required package: limma Attaching package: ‘limma’ The following object is masked from ‘package:oligo’: backgroundCorrect The following object is masked from ‘package:BiocGenerics’: plotMA
1. 'AFFX-DapX-M_at'
2. '34103_at'
3. '31642_at'
4. 'AFFX-M27830_5_at'
5. '32934_i_at'
6. 'AFFX-HUMRGE/M10098_M_at'
In [4]:
require(affy)

In [5]:
?affy::plotDensity

 plotDensity {affy} R Documentation

## Plot Densities

### Description

Plots the non-parametric density estimates using values contained in the columns of a matrix.

### Usage

plotDensity(mat, ylab = "density", xlab="x", type="l", col=1:6,
na.rm = TRUE, ...)

plotDensity.AffyBatch(x, col = 1:6, log = TRUE,
which=c("pm","mm","both"),
ylab = "density",
xlab = NULL, ...)


### Arguments

 mat a matrix containing the values to make densities in the columns. x an object of class AffyBatch. log logical value. If TRUE the log of the intensities in the AffyBatch are plotted. which should a histogram of the PMs, MMs, or both be made? col the colors to use for the different arrays. ylab a title for the y axis. xlab a title for the x axis. type type for the plot. na.rm handling of NA values. ... graphical parameters can be given as arguments to plot.

### Details

The list returned can be convenient for plotting large input matrices with different colors/line types schemes (the computation of the densities can take some time).

To match other functions in base R, this function should probably be called matdensity, as it is sharing similarities with matplot and matlines.

### Value

It returns invisibly a list of two matrices ‘x’ and ‘y’.

### Examples

if (require(affydata)) {
data(Dilution)
plotDensity(exprs(Dilution), log="x")
}


[Package affy version 1.54.0 ]
In [7]:
require(affydata)
data(Dilution)
affy::plotDensity(exprs(Dilution), log="x")

In [ ]: