Score differential expression, assess significance,
and smooth scores along the chromosome
Description
This function computes for all genes on one chromosome the regularized
t-statistic to score differential gene expression for two given groups
of samples. Additionally these scores are computed for a number of
permutations to assess significance. Afterwards these scores are smoothed
with a given kernel along the chromosome to give scores for chromosomal
regions.
Gene expression data in the MACAT list format. See data(stjude)
for an example.
class
Which of the given class labels is to be analyzed
chromosome
Chromosome to be analyzed
nperms
Number of permutations
permute
Method to do permutations. Default 'labels' does permutations
of the class labels, which is the common and faster way to assess
significance of differential expression. The altenative 'locations'
does permutations of gene locations, is much slower and right
now should be considered preliminary at best.
pcompute
Method to determine the p-value for differential
expression of each gene. Is only evaluated if the argument
permute='labels' and in that case passed on to the function
scoring
subset
If a subset of samples is to be used, give vector of column-
indices of these samples in the original matrix here.
newlabels
If other labels than the ones in the MACAT-list-structure
are to be used, give them as character vector/factor here. Make sure
argument 'class' is one of them.
kernel
Choose kernel to smooth scores along the chromose. Available
are 'kNN' for k-Nearest-Neighbors, 'rbf' for radial-basis-function
(Gaussian), 'basePairDistance' for a kernel, which averages over
all genes within a given range of base pairs around a position.
kernelparams
Additional parameters for the kernel as list, e.g.,
kernelparams=list(k=5) for taking the 5 nearest neighbours in the
kNN-kernel. If NULL some defaults are set within the function.
cross.validate
Logical. Should the paramter settings for the kernel
function be optimized by a cross-validation?
paramMultipliers
Numeric vector. If you do cross-validation of the
kernel parameters, specify the multipliers of the given (standard)
parameters to search over for the optimal one.
ncross
Integer. If you do cross-validation, specify how many folds.
step.width
Defines the resolution of smoothed scores on the
chromosome, is in fact the distance in base pairs between 2
positions, for which smoothed scores are to be calculated.
memory.limit
If you have a computer with lots of RAM,
setting this to FALSE will increase speed of computations.
verbose
logical; should function's progress be reported to
STDOUT ?; default: TRUE.
Details
Please see the package vignette for more details on this function.
Value
List of class 'MACATevalScoring' with 11 components:
original.geneid
Gene IDs of the genes on the chosen chromosome, sorted
according to their position on the chromosome
original.loc
Location of genes on chromosome in base pairs from 5'end
original.score
Regularized t-score of genes on chromosome
original.pvalue
Empirical p-value of genes on chromosome. How often
was a higher score observed than this one with random permutations?
In other words, how significant seems this score to be?
steps
Positions on the chromosome in bp from 5', for which smoothed
scores have been computed.
sliding.value
Smoothed regularized t-scores at step-positions.
lower.permuted.border
Smoothed scores from permutations, lower
significance border, currently 2.5%-quantile of permutation scores.
upper.permuted.border
Smoothed scores from permutations, upper
significance border, currently 97.5%-quantile of permutation scores.
chromosome
Chromosome, which has been analyzed
class
Class, which has been analyzed
chip
Identifier for used microarray
Author(s)
MACAT development team
See Also
scoring,plot.MACATevalScoring,
getResults
Examples
data(stjd) # load example data
# if you have the data package 'stjudem' installed,
# you should work on the full data therein, of which
# the provided example data, is just a piece
#loaddatapkg("stjudem")
#data(stjude)
# T-lymphocyte versus B-lymphocyte on chromosome 1,
# smoothed with k-Nearest-Neighbours kernel(k=15),
# few permutations for higher speed
chrom1Tknn <- evalScoring(stjd,"T",chromosome="1",permute="labels",
nperms=100,kernel=kNN,kernelparams=list(k=15),step.width=100000)
# plotting on x11:
if (interactive())
plot(chrom1Tknn)
# plotting on HTML:
if (interactive())
plot(chrom1Tknn,"html")
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(macat)
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")'.
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 objects are masked from 'package:base':
colMeans, colSums, expand.grid, rowMeans, rowSums
Loading required package: XML
Loading MicroArray Chromosome Analysis Tool...
Loading required packages...
Type 'demo(macatdemo)' for a quick tour...
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/macat/evalScoring.Rd_%03d_medium.png", width=480, height=480)
> ### Name: evalScoring
> ### Title: Score differential expression, assess significance, and smooth
> ### scores along the chromosome
> ### Aliases: evalScoring
> ### Keywords: manip
>
> ### ** Examples
>
> data(stjd) # load example data
>
> # if you have the data package 'stjudem' installed,
> # you should work on the full data therein, of which
> # the provided example data, is just a piece
> #loaddatapkg("stjudem")
> #data(stjude)
>
> # T-lymphocyte versus B-lymphocyte on chromosome 1,
> # smoothed with k-Nearest-Neighbours kernel(k=15),
> # few permutations for higher speed
> chrom1Tknn <- evalScoring(stjd,"T",chromosome="1",permute="labels",
+ nperms=100,kernel=kNN,kernelparams=list(k=15),step.width=100000)
Investigating 5 samples of class T ...
Compute observed test statistics...
Building permutation matrix...
Compute 100 permutation test statistics...
100 ...
Compute empirical p-values...
Compute quantiles of empirical distributions...Done.
Performing cross-validation to obtain optimal parameters...
Evaluating parameter k = 1 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...
Evaluating parameter k = 2 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...
Evaluating parameter k = 4 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...
Evaluating parameter k = 8 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...
Evaluating parameter k = 15 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...
Evaluating parameter k = 30 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...
Evaluating parameter k = 60 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...
Evaluating parameter k = 120 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...
Evaluating parameter k = 240 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...
Computing sliding values for scores...
Compute sliding values for permutations...
All done.
>
> # plotting on x11:
> # if (interactive())
> plot(chrom1Tknn)
Loading required package: hgu95av2.db
Loading required package: org.Hs.eg.db
>
> # plotting on HTML:
> # if (interactive())
> plot(chrom1Tknn,"html")
>
>
>
>
>
> dev.off()
null device
1
>