Considering that the analysis requires a larger number of cells for support, we used the combined data from 9 samples for the presentation. The data used in this analysis can be downloaded here.

load("eccDNAscope_example/share_eccDNA_data/eccDNA_frame.Rdata")
load("eccDNAscope_example/share_eccDNA_data/cell_type.Rdata")
sort(rowSums(eccDNA_frame>0),decreasing = T)[1:10] # The candidate genes of shared_eccDNA_analysis
## LOC124907970       EEF1B2         PTMA       TUBA4A       CACYBP      TMEM198 
##          150          142          128          112          109          103 
##       CCNYL1     METTL21A       MIR933 LOC105373880 
##          100           92           90           86


Cluster cells based on shared specific eccDNA genes

Perform hierarchical clustering on cells with amplification of a single eccDNA-related gene

single_eccDNA_clone_result <- single_eccDNA_clone_cluster(eccDNA_frame=eccDNA_frame,
                                                        cell_type=cell_type,
                                                        eccDNA.gene="EEF1B2",
                                                        cluster.num=10)
single_eccDNA_clone_result$p_heatmap

single_eccDNA_clone_result$p_ggtree



Calculate the shared eccDNA gene number between cells

shared_eccDNA <- shared_eccDNA_num_between_cells(clone_matrix=single_eccDNA_clone_result$clone_matrix,
                                               cell_type=cell_type)

# You can then visualize the number of shared eccDNA between different cell types in Cytoscape.
head(shared_eccDNA$cyto_frame)
##                        cell1                      cell2 shared_eccDNA
## 1 Normal3_GAAATGAGTTCGGGAA-1 Normal3_GAAATGAGTTCGGGAA-1           10
## 2 Normal3_GAAATGAGTTCGGGAA-1 Normal3_GTGTGATAGCTCCATA-1            3
## 3 Normal3_GAAATGAGTTCGGGAA-1 Normal3_CCTCCCTTCACTTACT-1            2
## 4 Normal3_GAAATGAGTTCGGGAA-1 Normal3_TCCGACTTCAAGTTGC-1            5
## 5 Normal3_GAAATGAGTTCGGGAA-1 Normal3_ATCCAGATCCTGAAAC-1            2
## 6 Normal3_GAAATGAGTTCGGGAA-1 Normal3_TAGCGGCGTTTAAGGA-1            5
head(shared_eccDNA$cell_info)
##                         name cell_type
## 1 Normal3_GAAATGAGTTCGGGAA-1     basal
## 2 Normal3_GTGTGATAGCTCCATA-1     basal
## 3 Normal3_CCTCCCTTCACTTACT-1     basal
## 4 Normal3_TCCGACTTCAAGTTGC-1     basal
## 5 Normal3_ATCCAGATCCTGAAAC-1  spinosum
## 6 Normal3_TAGCGGCGTTTAAGGA-1     basal


Validate the similarity between clone clusters through chromatin accessibility similarities.

Compare the similarity between and within groups of cells based on the transcription start site (TSS) enrichment scores of genes in single_eccDNA_clone_cluster

combined_atac_all_samples <- readRDS("eccDNAscope_example/share_eccDNA_data/combined_atac_final.rds")
p_cor <- cor_single_eccDNA_clone_cluster(eccDNA.object=combined_atac_all_samples,
                                        clone_matrix=single_eccDNA_clone_result$clone_matrix,
                                        hc=single_eccDNA_clone_result$hc,
                                        cluster.num=3,
                                        min.cell=4)
p_cor