CoCalc Shared Filespuma-affy.ipynbOpen in CoCalc with one click!
Author: Harald Schilly
Views : 23
In [1]:
require(puma)
Loading required package: puma Loading required package: oligo 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, sd, var, xtabs The following objects are masked from ‘package:base’: anyDuplicated, append, as.data.frame, cbind, colMeans, colnames, colSums, do.call, duplicated, eval, evalq, Filter, Find, get, grep, grepl, intersect, is.unsorted, lapply, lengths, Map, mapply, match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rowMeans, rownames, rowSums, sapply, setdiff, sort, table, tapply, union, unique, unsplit, which, which.max, which.min Loading required package: oligoClasses No methods found in "RSQLite" for requests: dbGetQuery Welcome to oligoClasses version 1.38.0 Loading required package: Biobase Welcome to Bioconductor Vignettes contain introductory material; view with 'browseVignettes()'. To cite Bioconductor, see 'citation("Biobase")', and for packages 'citation("pkgname")'. Loading required package: Biostrings Loading required package: S4Vectors Loading required package: stats4 Attaching package: ‘S4Vectors’ The following object is masked from ‘package:base’: expand.grid Loading required package: IRanges Loading required package: XVector Attaching package: ‘Biostrings’ The following object is masked from ‘package:base’: strsplit ================================================================================ Welcome to oligo version 1.40.2 ================================================================================ Loading required package: mclust Package 'mclust' version 5.3 Type 'citation("mclust")' for citing this R package in publications.
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

See Also

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"
Warning message: “replacing previous import ‘AnnotationDbi::tail’ by ‘utils::tail’ when loading ‘hgu95av2cdf’”Warning message: “replacing previous import ‘AnnotationDbi::head’ by ‘utils::head’ when loading ‘hgu95av2cdf’”
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’.

Author(s)

Ben Bolstad and Laurent Gautier

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 [ ]: