FlagCluster: Flag gene clusters with small within-cluster phase...

Description Usage Arguments Value Author(s) Examples

View source: R/FlagCluster.R

Description

Flag gene clusters with small within-cluster phase differences and/or small within-cluster sine scores

Usage

1
FlagCluster(SineRes, KMRes, Data, qt, thre=pi/4, qtincluster=.5, qtinpermu=.9 ,Seed=1)

Arguments

SineRes

output of OscopeSine() function

KMRes

output of KMRes() function

Data

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

1
2
3
4
5
6
7
8
9
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)

Example output

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
gene pairs above this threshold are considered:
-0.135024869344538
max number of clusters considered:5
optimal number of clusters:3
========= 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.46286130 -0.27045703 -0.07805275 -0.07080798 -0.06356322 
cluster 2 permuted data 
        0%        25%        50%        75%       100% 
-0.5474625 -0.5079312 -0.4684000 -0.4543987 -0.4403974 
cluster 3
        0%        25%        50%        75%       100% 
-0.1350249 -0.1350249 -0.1350249 -0.1350249 -0.1350249 
cluster 3 permuted data 
        0%        25%        50%        75%       100% 
-0.7051852 -0.7051852 -0.7051852 -0.7051852 -0.7051852 

 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.5372  0.5544  0.6061  0.7313  0.9394  1.0505 
cluster 3
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 0.4595  0.4595  0.4595  0.4595  0.4595  0.4595 
flagged cluster:3

Oscope documentation built on Nov. 8, 2020, 7:12 p.m.