a gene-by-sample (isoform-by-sample) matrix indicating the rescaled expression of genes/isoforms.
all values should be between [-1, 1].
qt,thre
Define a gene pair's linear score as
min(eta, pi-eta), in which eta is defined as phase shift mod pi.
A cluster will be flagged if the
qt th quantile of within-cluster linear score is less than thre.
qtincluster,qtinpermu
To define clusters with small within-cluster sine scores, for each cluster we generate
permuted data of these genes (different cell permutation for each gene).
We calculate the within-cluster sine scores within
the cluster of permuted genes, then infer whether the sine scores
in the cluster of interest are greater than those generated by the permuted genes.
A cluster will be flagged if its qtincluster th quantile in the original data is less than
its qtinpermu th quantile in permuted data.
Seed
seed
Value
Output: RemoveID: a vector of cluster numbers that are flagged;
SineCompreList: sine score and permuted sine score for each cluster; LinearList: linear score of each cluster
Author(s)
Ning Leng
Examples
aa <- sin(seq(0,1,.1))
bb <- sin(seq(0.5,1.5,.1))
cc <- sin(seq(0.9,1.9,.1))
tmp <- matrix(sin(rnorm(330)),ncol=11)
rownames(tmp) <- paste0("tmp",1:30)
Dat <- rbind(aa, bb, cc, tmp)
res1 <- OscopeSine(Dat)
res2 <- OscopeKM(res1, quan=.8, maxK=5)
res <- FlagCluster(res1, res2, Dat)
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(Oscope)
Loading required package: EBSeq
Loading required package: blockmodeling
Loading required package: gplots
Attaching package: 'gplots'
The following object is masked from 'package:stats':
lowess
Loading required package: testthat
Loading required package: cluster
Loading required package: BiocParallel
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/Oscope/FlagCluster.Rd_%03d_medium.png", width=480, height=480)
> ### Name: FlagCluster
> ### Title: Flag gene clusters with small within-cluster phase differences
> ### and/or small within-cluster sine scores
> ### Aliases: FlagCluster
>
> ### ** Examples
>
> aa <- sin(seq(0,1,.1))
> bb <- sin(seq(0.5,1.5,.1))
> cc <- sin(seq(0.9,1.9,.1))
> tmp <- matrix(sin(rnorm(330)),ncol=11)
> rownames(tmp) <- paste0("tmp",1:30)
> Dat <- rbind(aa, bb, cc, tmp)
> res1 <- OscopeSine(Dat)
> res2 <- OscopeKM(res1, quan=.8, maxK=5)
gene pairs above this threshold are considered:
-0.136822887719994
max number of clusters considered:5
optimal number of clusters:3
> res <- FlagCluster(res1, res2, Dat)
========= by sine score =========
cluster 1
0% 25% 50% 75% 100%
5.702331 5.781899 5.861467 6.477879 7.094291
cluster 1 permuted data
0% 25% 50% 75% 100%
-0.29636026 -0.16914036 -0.04192045 0.27140874 0.58473793
cluster 2
0% 25% 50% 75% 100%
-0.1083376 -0.1083376 -0.1083376 -0.1083376 -0.1083376
cluster 2 permuted data
0% 25% 50% 75% 100%
-0.2994891 -0.2994891 -0.2994891 -0.2994891 -0.2994891
cluster 3
0% 25% 50% 75% 100%
-0.1213132 -0.1213132 -0.1213132 -0.1213132 -0.1213132
cluster 3 permuted data
0% 25% 50% 75% 100%
-0.4562225 -0.4562225 -0.4562225 -0.4562225 -0.4562225
flagged cluster:
========= by phase shift =========
cluster 1
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.400 0.425 0.500 0.600 0.800 0.900
cluster 2
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.5325 0.5325 0.5325 0.5325 0.5325 0.5325
cluster 3
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.3411 0.3411 0.3411 0.3411 0.3411 0.3411
flagged cluster:23
>
>
>
>
>
> dev.off()
null device
1
>