FlashQC: Flash QuantumClone

Description Usage Arguments Value See Also Examples

View source: R/FlashQC.R

Description

Fast method to find clones without filtering for multiple states

Usage

1
FlashQC(Cells, conta, Nclus, model.selection = "tree")

Arguments

Cells

Input for QuantumClone with genotype required

conta

vector with contamination fraction in each sample

Nclus

vector with the number of clusters to test (alternatively only min and max values)

model.selection

One of "tree", "AIC", "BIC" or numeric. "tree" will use "ccc","ch" and "gap" methods from NbClust to determine the number of clusters. "BIC","AIC" or numeric values will use methods from QuantumClone.

Value

returns a list with:

similarityMatrix

The matrix of probabilities

distance

The dissimilarity matrix

tree

The tree obtained by hierachical clustering of the dissimilarity matrix using "ward.D2" method

cluster

attributed cluster for each variant

See Also

QuantumClone

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
set.seed(123)
#1: Cluster data
In<-QuantumClone::Input_Example
FQC<-FlashQC(In,conta = c(0,0),Nclus = 2:10)

#2: Get order variants by clones:
ord<-order(In[[1]]$Chr)
#3: Visualize clustering:
image(
 1:nrow(In[[1]]),
 1:nrow(In[[1]]),
 FQC$similarity[ord,ord], 
 xlab="", ylab="")
#4: add limit of real clusters:
abline(h = cumsum(table(In[[1]]$Chr[ord]))+1)
abline(v = cumsum(table(In[[1]]$Chr[ord]))+1)

#5: alternatively add clusters found:
ord<-order(FQC$cluster)
image(
 1:nrow(In[[1]]),
 1:nrow(In[[1]]),
 FQC$similarity[ord,ord], 
 xlab="", ylab="")
abline(h = cumsum(table(FQC$cluster[ord]))+1)
abline(v = cumsum(table(FQC$cluster[ord]))+1)
# Show clustering quality:
NMI_cutree( FQC$cluster,chr = In[[1]]$Chr)

DeveauP/QuantumClone documentation built on Oct. 29, 2021, 8:56 a.m.