4 Other signature types

4.1 Copy number signature (Wang et al)

4.1.1 Read data

The input requires absolute copy number profile with following information:

  • Segment chromosome.
  • Segment start.
  • Segment end.
  • Absolute copy number value for this segment: must be integer.
  • Sample ID.

The input data can be result from any software which provides information above.

Useful softwares are listed below:

Useful analysis reference:

The import work is done by read_copynumber(), which supports data.frame or file, and even result directory from ABSOLUTE.

Option sigminer.sex is used to control the processing of sex. If you don’t care the sex chromosomes (i.e. X and Y), you can ignore this setting after removing the X/Y segments, otherwise the summary in the result cn and tally process may be biased.

## Default is "female"
## You can ignore the setting if all samples are females
## But we recommend you set it
options(sigminer.sex = "male")
## For cohort contains both males and females,
## set a data.frame with two columns, i.e.
## options(sigminer.sex = sex_df),
## which
## sex_df = data.frame(sample = c("sample1", "sample2",
##                     sex = "female", "male"))
# Load toy dataset of absolute copynumber profile
load(system.file("extdata", "toy_segTab.RData",
  package = "sigminer", mustWork = TRUE
))
cn <- read_copynumber(segTabs,
  seg_cols = c("chromosome", "start", "end", "segVal"),
  genome_build = "hg19", complement = FALSE, verbose = TRUE
)
## ℹ [2021-12-04 23:51:19]: Started.
## ℹ [2021-12-04 23:51:19]: Genome build  : hg19.
## ℹ [2021-12-04 23:51:19]: Genome measure: called.
## ✓ [2021-12-04 23:51:19]: Chromosome size database for build obtained.
## ℹ [2021-12-04 23:51:19]: Reading input.
## ✓ [2021-12-04 23:51:19]: A data frame as input detected.
## ✓ [2021-12-04 23:51:19]: Column names checked.
## ✓ [2021-12-04 23:51:19]: Column order set.
## ✓ [2021-12-04 23:51:19]: Chromosomes unified.
## ✓ [2021-12-04 23:51:19]: Data imported.
## ℹ [2021-12-04 23:51:19]: Segments info:
## ℹ [2021-12-04 23:51:19]:     Keep - 467
## ℹ [2021-12-04 23:51:19]:     Drop - 0
## ✓ [2021-12-04 23:51:19]: Segments sorted.
## ℹ [2021-12-04 23:51:19]: Joining adjacent segments with same copy number value. Be patient...
## ✓ [2021-12-04 23:51:19]: 400 segments left after joining.
## ✓ [2021-12-04 23:51:19]: Segmental table cleaned.
## ℹ [2021-12-04 23:51:19]: Annotating.
## ✓ [2021-12-04 23:51:19]: Annotation done.
## ℹ [2021-12-04 23:51:19]: Summarizing per sample.
## ✓ [2021-12-04 23:51:19]: Summarized.
## ℹ [2021-12-04 23:51:19]: Generating CopyNumber object.
## ✓ [2021-12-04 23:51:19]: Generated.
## ℹ [2021-12-04 23:51:19]: Validating object.
## ✓ [2021-12-04 23:51:19]: Done.
## ℹ [2021-12-04 23:51:19]: 0.167 secs elapsed.
cn
## An object of class CopyNumber 
## =============================
##                           sample n_of_seg n_of_cnv n_of_amp n_of_del n_of_vchr
##  1: TCGA-DF-A2KN-01A-11D-A17U-01       33        6        5        1         4
##  2: TCGA-19-2621-01B-01D-0911-01       33        8        5        3         5
##  3: TCGA-B6-A0X5-01A-21D-A107-01       28        8        4        4         2
##  4: TCGA-A8-A07S-01A-11D-A036-01       38       11        2        9         4
##  5: TCGA-26-6174-01A-21D-1842-01       43       13        8        5         8
##  6: TCGA-CV-7432-01A-11D-2128-01       40       16        7        9         9
##  7: TCGA-06-0644-01A-02D-0310-01       46       19        5       14         8
##  8: TCGA-A5-A0G2-01A-11D-A042-01       39       21        5       16        10
##  9: TCGA-99-7458-01A-11D-2035-01       48       26       10       16        13
## 10: TCGA-05-4417-01A-22D-1854-01       52       37       33        4        17
##     cna_burden
##  1:      0.000
##  2:      0.099
##  3:      0.087
##  4:      0.112
##  5:      0.119
##  6:      0.198
##  7:      0.165
##  8:      0.393
##  9:      0.318
## 10:      0.654

Currently, you can refer to extract_facets_cnv() and extract_seqz_cnv() in https://github.com/ShixiangWang/prad_signature/blob/master/analysis/src/99-functions.R to see how to get tidy data from a result directory of FACETS or Sequenza. ## Tally Components

Currently, there are two methods for generating sample-by-component matrix.

Option sigminer.copynumber.max is used to control the processing of max copy number values. Run ?sig_tally to see more.

## Even you set max_copynumber = 20 in read_copynumber(),
## the segmental copy number may be greater than 20
## because for male samples, the X/Y segmental copy number
## values will be doubled in tally process.
## This setting will make copy number values of all segments
## not greater than 20.
options(sigminer.copynumber.max = 20)
# Load copy number object
load(system.file("extdata", "toy_copynumber.RData",
  package = "sigminer", mustWork = TRUE
))
# Use method designed by Wang, Shixiang et al.
cn_tally_W <- sig_tally(cn, method = "W")

You can set options(sigminer.sex = "male", sigminer.copynumber.max = 20) at the top of your code to avoid setting them in two places.

Of note, the sigminer.copynumber.max option only has effect on sig_tally() with method “W”, the sigminer.sex option has effects on read_copynumber() and sig_tally() with method “W”.

This step return a list containing information about copy number features, components and matrix for NMF etc.

4.1.2 Extract signatures

When you get the matrix, you can just do the signature extraction as SBS etc. signatures. So here we won’t talk much.

cn_tally_W$nmf_matrix[1:5, 1:5]
##                              BP10MB[0] BP10MB[1] BP10MB[2] BP10MB[3] BP10MB[4]
## TCGA-05-4417-01A-22D-1854-01       275        20         5         0         0
## TCGA-06-0644-01A-02D-0310-01       289         5         4         0         1
## TCGA-19-2621-01B-01D-0911-01       294         2         3         1         0
## TCGA-26-6174-01A-21D-1842-01       288         4         7         1         0
## TCGA-99-7458-01A-11D-2035-01       284         9         5         1         1
# library(NMF)
sig_w <- sig_extract(cn_tally_W$nmf_matrix, n_sig = 2)

4.2 Allele specific copy number signature (Steele et al)

Previously described steps can be also applied to allele specific copy number profile with Steele et al approach. There are two catalog methods provided by Steele et al: 40 catalogs and 48 catalogs. In current stage, 48 catalog is recommended as ~20 reference signatures have been built on ~10,000 TCGA tumors. reference example is given below:

# Generate example data
load(system.file("extdata", "toy_segTab.RData",
  package = "sigminer", mustWork = TRUE
))
set.seed(1234)
# Make sure minor_cn is provided
segTabs$minor_cn <- sample(c(0, 1), size = nrow(segTabs), replace = TRUE)
cn2 <- read_copynumber(segTabs,
  seg_cols = c("chromosome", "start", "end", "segVal"),
  genome_measure = "wg", complement = TRUE, add_loh = TRUE
)
## ℹ [2022-08-29 11:59:13]: Started.
## ℹ [2022-08-29 11:59:13]: Genome build  : hg19.
## ℹ [2022-08-29 11:59:13]: Genome measure: wg.
## ℹ [2022-08-29 11:59:13]: When add_loh is TRUE, use_all is forced to TRUE.
## Please drop columns you don't want to keep before reading.
## ✔ [2022-08-29 11:59:13]: Chromosome size database for build obtained.
## ℹ [2022-08-29 11:59:13]: Reading input.
## ✔ [2022-08-29 11:59:13]: A data frame as input detected.
## ✔ [2022-08-29 11:59:13]: Column names checked.
## ✔ [2022-08-29 11:59:13]: Column order set.
## ✔ [2022-08-29 11:59:13]: Chromosomes unified.
## ✔ [2022-08-29 11:59:13]: Value 2 (normal copy) filled to uncalled chromosomes.
## ✔ [2022-08-29 11:59:13]: Data imported.
## ℹ [2022-08-29 11:59:13]: Segments info:
## ℹ [2022-08-29 11:59:13]:     Keep - 477
## ℹ [2022-08-29 11:59:13]:     Drop - 0
## ✔ [2022-08-29 11:59:13]: Segments sorted.
## ℹ [2022-08-29 11:59:13]: Adding LOH labels...
## ℹ [2022-08-29 11:59:13]: Joining adjacent segments with same copy number value. Be patient...
## ✔ [2022-08-29 11:59:13]: 410 segments left after joining.
## ✔ [2022-08-29 11:59:13]: Segmental table cleaned.
## ℹ [2022-08-29 11:59:13]: Annotating.
## ✔ [2022-08-29 11:59:13]: Annotation done.
## ℹ [2022-08-29 11:59:13]: Summarizing per sample.
## ✔ [2022-08-29 11:59:13]: Summarized.
## ℹ [2022-08-29 11:59:13]: Generating CopyNumber object.
## ✔ [2022-08-29 11:59:13]: Generated.
## ℹ [2022-08-29 11:59:13]: Validating object.
## ✔ [2022-08-29 11:59:13]: Done.
## ℹ [2022-08-29 11:59:13]: 0.454 secs elapsed.

# Use tally method "S" (Steele et al.)
tally_s2 <- sig_tally(cn2, method = "S")
## ℹ [2022-08-29 11:59:13]: Started.
## ℹ [2022-08-29 11:59:13]: When you use method 'S', please make sure you have set 'join_adj_seg' to FALSE and 'add_loh' to TRUE in 'read_copynumber() in the previous step!
## ✔ [2022-08-29 11:59:13]: Matrix generated.
## ℹ [2022-08-29 11:59:13]: 0.05 secs elapsed.

cn_sig2 <- sig_extract(tally_s2$all_matrices$CN_48, n_sig = 2)
## NMF algorithm: 'brunet'
## Multiple runs: 10
## Mode: sequential [foreach:doParallelMC]
## 
Runs: |                                                        
Runs: |                                                  |   0%
Runs: |                                                        
Runs: |=====                                             |   9%
Runs: |                                                        
Runs: |=========                                         |  18%
Runs: |                                                        
Runs: |==============                                    |  27%
Runs: |                                                        
Runs: |==================                                |  36%
Runs: |                                                        
Runs: |=======================                           |  45%
Runs: |                                                        
Runs: |===========================                       |  55%
Runs: |                                                        
Runs: |================================                  |  64%
Runs: |                                                        
Runs: |====================================              |  73%
Runs: |                                                        
Runs: |=========================================         |  82%
Runs: |                                                        
Runs: |=============================================     |  91%
Runs: |                                                        
Runs: |==================================================| 100%
## System time:
##    user  system elapsed 
##   9.021   0.119   9.163
get_sig_similarity(cn_sig2, sig_db = "CNS_TCGA")
## -Comparing against COSMIC signatures
## ------------------------------------
## --Found Sig1 most similar to CN1
##    Aetiology: See https://cancer.sanger.ac.uk/signatures/cn/ [similarity: 0.728]
## --Found Sig2 most similar to CN2
##    Aetiology: See https://cancer.sanger.ac.uk/signatures/cn/ [similarity: 0.668]
## ------------------------------------
## Return result invisiblely.

4.3 Rearrangement signature

Similarity, once you know how to generate matrix for genome rearrangement signature, you can easily apply the signature extraction or signature fitting.

sv <- readRDS(system.file("extdata", "toy_sv.rds", package = "sigminer", mustWork = TRUE))
rs <- read_sv_as_rs(sv)
## succesfully read RS!
# svclass is optional
rs2 <- read_sv_as_rs(sv[, setdiff(colnames(sv), "svclass")])
## succesfully read RS!
identical(rs, rs2)
## [1] TRUE

tally_rs <- sig_tally(rs)
## ℹ [2022-08-29 11:59:24]: Started.
## ✔ [2022-08-29 11:59:24]: Successfully get RS list!
## 
## Attaching package: 'purrr'
## The following objects are masked from 'package:foreach':
## 
##     accumulate, when
## The following object is masked from 'package:XVector':
## 
##     compact
## The following object is masked from 'package:GenomicRanges':
## 
##     reduce
## The following object is masked from 'package:IRanges':
## 
##     reduce
## [1] "Getting clustered info..."
## pcf finished for chromosome arm 1p 
## pcf finished for chromosome arm 10p 
## pcf finished for chromosome arm 10q 
## pcf finished for chromosome arm 11p 
## pcf finished for chromosome arm 11q 
## pcf finished for chromosome arm 12p 
## pcf finished for chromosome arm 12q 
## pcf finished for chromosome arm 13q 
## pcf finished for chromosome arm 14q 
## pcf finished for chromosome arm 16q 
## pcf finished for chromosome arm 17p 
## pcf finished for chromosome arm 17q 
## pcf finished for chromosome arm 18p 
## pcf finished for chromosome arm 18q 
## pcf finished for chromosome arm 19p 
## pcf finished for chromosome arm 19q 
## pcf finished for chromosome arm 2p 
## pcf finished for chromosome arm 2q 
## pcf finished for chromosome arm 20p 
## pcf finished for chromosome arm 20q 
## pcf finished for chromosome arm 22q 
## pcf finished for chromosome arm 3p 
## pcf finished for chromosome arm 3q 
## pcf finished for chromosome arm 4p 
## pcf finished for chromosome arm 4q 
## pcf finished for chromosome arm 5p 
## pcf finished for chromosome arm 5q 
## pcf finished for chromosome arm 6p 
## pcf finished for chromosome arm 6q 
## pcf finished for chromosome arm 7p 
## pcf finished for chromosome arm 7q 
## pcf finished for chromosome arm 8p 
## pcf finished for chromosome arm 8q 
## pcf finished for chromosome arm 9p 
## pcf finished for chromosome arm 9q 
## pcf finished for chromosome arm Xp 
## pcf finished for chromosome arm Xq 
## pcf finished for chromosome arm 21q 
## pcf finished for chromosome arm 1p 
## pcf finished for chromosome arm 1q 
## pcf finished for chromosome arm 10p 
## pcf finished for chromosome arm 10q 
## pcf finished for chromosome arm 11q 
## pcf finished for chromosome arm 12p 
## pcf finished for chromosome arm 12q 
## pcf finished for chromosome arm 13q 
## pcf finished for chromosome arm 14q 
## pcf finished for chromosome arm 15q 
## pcf finished for chromosome arm 16p 
## pcf finished for chromosome arm 16q 
## pcf finished for chromosome arm 17p 
## pcf finished for chromosome arm 17q 
## pcf finished for chromosome arm 18q 
## pcf finished for chromosome arm 19q 
## pcf finished for chromosome arm 2p 
## pcf finished for chromosome arm 2q 
## pcf finished for chromosome arm 20q 
## pcf finished for chromosome arm 21p 
## pcf finished for chromosome arm 21q 
## pcf finished for chromosome arm 22q 
## pcf finished for chromosome arm 3p 
## pcf finished for chromosome arm 3q 
## pcf finished for chromosome arm 4p 
## pcf finished for chromosome arm 4q 
## pcf finished for chromosome arm 5p 
## pcf finished for chromosome arm 5q 
## pcf finished for chromosome arm 6p 
## pcf finished for chromosome arm 7q 
## pcf finished for chromosome arm 8p 
## pcf finished for chromosome arm 8q 
## pcf finished for chromosome arm 9p 
## pcf finished for chromosome arm 9q 
## pcf finished for chromosome arm Xp 
## pcf finished for chromosome arm Xq 
## pcf finished for chromosome arm 1p 
## pcf finished for chromosome arm 1q 
## pcf finished for chromosome arm 10q 
## pcf finished for chromosome arm 11p 
## pcf finished for chromosome arm 11q 
## pcf finished for chromosome arm 12p 
## pcf finished for chromosome arm 13q 
## pcf finished for chromosome arm 14q 
## pcf finished for chromosome arm 15q 
## pcf finished for chromosome arm 16p 
## pcf finished for chromosome arm 17p 
## pcf finished for chromosome arm 17q 
## pcf finished for chromosome arm 18p 
## pcf finished for chromosome arm 18q 
## pcf finished for chromosome arm 19p 
## pcf finished for chromosome arm 19q 
## pcf finished for chromosome arm 2p 
## pcf finished for chromosome arm 2q 
## pcf finished for chromosome arm 20p 
## pcf finished for chromosome arm 20q 
## pcf finished for chromosome arm 21q 
## pcf finished for chromosome arm 3p 
## pcf finished for chromosome arm 3q 
## pcf finished for chromosome arm 4p 
## pcf finished for chromosome arm 5q 
## pcf finished for chromosome arm 6p 
## pcf finished for chromosome arm 6q 
## pcf finished for chromosome arm 7q 
## pcf finished for chromosome arm 8p 
## pcf finished for chromosome arm 8q 
## pcf finished for chromosome arm 9p 
## pcf finished for chromosome arm 9q 
## pcf finished for chromosome arm Xq 
## pcf finished for chromosome arm 22q 
## pcf finished for chromosome arm 1p 
## pcf finished for chromosome arm 1q 
## pcf finished for chromosome arm 10q 
## pcf finished for chromosome arm 11p 
## pcf finished for chromosome arm 11q 
## pcf finished for chromosome arm 12p 
## pcf finished for chromosome arm 12q 
## pcf finished for chromosome arm 14q 
## pcf finished for chromosome arm 15q 
## pcf finished for chromosome arm 16p 
## pcf finished for chromosome arm 16q 
## pcf finished for chromosome arm 17p 
## pcf finished for chromosome arm 17q 
## pcf finished for chromosome arm 18q 
## pcf finished for chromosome arm 2p 
## pcf finished for chromosome arm 2q 
## pcf finished for chromosome arm 20p 
## pcf finished for chromosome arm 20q 
## pcf finished for chromosome arm 21q 
## pcf finished for chromosome arm 3p 
## pcf finished for chromosome arm 3q 
## pcf finished for chromosome arm 4p 
## pcf finished for chromosome arm 4q 
## pcf finished for chromosome arm 5p 
## pcf finished for chromosome arm 5q 
## pcf finished for chromosome arm 6p 
## pcf finished for chromosome arm 6q 
## pcf finished for chromosome arm 7p 
## pcf finished for chromosome arm 7q 
## pcf finished for chromosome arm 8p 
## pcf finished for chromosome arm 8q 
## pcf finished for chromosome arm 9p 
## pcf finished for chromosome arm 22q 
## pcf finished for chromosome arm Xq 
## pcf finished for chromosome arm 13q 
## pcf finished for chromosome arm 1p 
## pcf finished for chromosome arm 1q 
## pcf finished for chromosome arm 10p 
## pcf finished for chromosome arm 11p 
## pcf finished for chromosome arm 11q 
## pcf finished for chromosome arm 12p 
## pcf finished for chromosome arm 13q 
## pcf finished for chromosome arm 14q 
## pcf finished for chromosome arm 15q 
## pcf finished for chromosome arm 16q 
## pcf finished for chromosome arm 17p 
## pcf finished for chromosome arm 17q 
## pcf finished for chromosome arm 2p 
## pcf finished for chromosome arm 2q 
## pcf finished for chromosome arm 20q 
## pcf finished for chromosome arm 4q 
## pcf finished for chromosome arm 5p 
## pcf finished for chromosome arm 5q 
## pcf finished for chromosome arm 6p 
## pcf finished for chromosome arm 6q 
## pcf finished for chromosome arm 7p 
## pcf finished for chromosome arm 8p 
## pcf finished for chromosome arm 8q 
## pcf finished for chromosome arm 9q 
## pcf finished for chromosome arm Xp 
## pcf finished for chromosome arm Xq 
## pcf finished for chromosome arm 21p 
## pcf finished for chromosome arm 22q 
## pcf finished for chromosome arm 1p 
## pcf finished for chromosome arm 1q 
## pcf finished for chromosome arm 10p 
## pcf finished for chromosome arm 10q 
## pcf finished for chromosome arm 11p 
## pcf finished for chromosome arm 11q 
## pcf finished for chromosome arm 12p 
## pcf finished for chromosome arm 12q 
## pcf finished for chromosome arm 13q 
## pcf finished for chromosome arm 14q 
## pcf finished for chromosome arm 15q 
## pcf finished for chromosome arm 16p 
## pcf finished for chromosome arm 16q 
## pcf finished for chromosome arm 17p 
## pcf finished for chromosome arm 17q 
## pcf finished for chromosome arm 18p 
## pcf finished for chromosome arm 18q 
## pcf finished for chromosome arm 19p 
## pcf finished for chromosome arm 2p 
## pcf finished for chromosome arm 2q 
## pcf finished for chromosome arm 22q 
## pcf finished for chromosome arm 3p 
## pcf finished for chromosome arm 3q 
## pcf finished for chromosome arm 4p 
## pcf finished for chromosome arm 4q 
## pcf finished for chromosome arm 5p 
## pcf finished for chromosome arm 5q 
## pcf finished for chromosome arm 6p 
## pcf finished for chromosome arm 6q 
## pcf finished for chromosome arm 7p 
## pcf finished for chromosome arm 7q 
## pcf finished for chromosome arm 8p 
## pcf finished for chromosome arm 8q 
## pcf finished for chromosome arm 9p 
## pcf finished for chromosome arm 9q 
## pcf finished for chromosome arm Xp 
## pcf finished for chromosome arm Xq 
## pcf finished for chromosome arm 20q 
## pcf finished for chromosome arm 1p 
## pcf finished for chromosome arm 1q 
## pcf finished for chromosome arm 10p 
## pcf finished for chromosome arm 10q 
## pcf finished for chromosome arm 11p 
## pcf finished for chromosome arm 11q 
## pcf finished for chromosome arm 12p 
## pcf finished for chromosome arm 12q 
## pcf finished for chromosome arm 13q 
## pcf finished for chromosome arm 14q 
## pcf finished for chromosome arm 15q 
## pcf finished for chromosome arm 16p 
## pcf finished for chromosome arm 16q 
## pcf finished for chromosome arm 17p 
## pcf finished for chromosome arm 17q 
## pcf finished for chromosome arm 18q 
## pcf finished for chromosome arm 19p 
## pcf finished for chromosome arm 19q 
## pcf finished for chromosome arm 2p 
## pcf finished for chromosome arm 2q 
## pcf finished for chromosome arm 20p 
## pcf finished for chromosome arm 20q 
## pcf finished for chromosome arm 21q 
## pcf finished for chromosome arm 22q 
## pcf finished for chromosome arm 3p 
## pcf finished for chromosome arm 4p 
## pcf finished for chromosome arm 4q 
## pcf finished for chromosome arm 5p 
## pcf finished for chromosome arm 5q 
## pcf finished for chromosome arm 6p 
## pcf finished for chromosome arm 6q 
## pcf finished for chromosome arm 7p 
## pcf finished for chromosome arm 7q 
## pcf finished for chromosome arm 8p 
## pcf finished for chromosome arm 8q 
## pcf finished for chromosome arm 9p 
## pcf finished for chromosome arm 9q 
## pcf finished for chromosome arm Xp 
## pcf finished for chromosome arm Xq 
## pcf finished for chromosome arm Yq 
## pcf finished for chromosome arm 1p 
## pcf finished for chromosome arm 1q 
## pcf finished for chromosome arm 10p 
## pcf finished for chromosome arm 10q 
## pcf finished for chromosome arm 11p 
## pcf finished for chromosome arm 11q 
## pcf finished for chromosome arm 12p 
## pcf finished for chromosome arm 12q 
## pcf finished for chromosome arm 13q 
## pcf finished for chromosome arm 14q 
## pcf finished for chromosome arm 15q 
## pcf finished for chromosome arm 16p 
## pcf finished for chromosome arm 16q 
## pcf finished for chromosome arm 17p 
## pcf finished for chromosome arm 17q 
## pcf finished for chromosome arm 18p 
## pcf finished for chromosome arm 18q 
## pcf finished for chromosome arm 19p 
## pcf finished for chromosome arm 19q 
## pcf finished for chromosome arm 2p 
## pcf finished for chromosome arm 2q 
## pcf finished for chromosome arm 20p 
## pcf finished for chromosome arm 20q 
## pcf finished for chromosome arm 21q 
## pcf finished for chromosome arm 22q 
## pcf finished for chromosome arm 3p 
## pcf finished for chromosome arm 4p 
## pcf finished for chromosome arm 4q 
## pcf finished for chromosome arm 5p 
## pcf finished for chromosome arm 5q 
## pcf finished for chromosome arm 6p 
## pcf finished for chromosome arm 6q 
## pcf finished for chromosome arm 7p 
## pcf finished for chromosome arm 7q 
## pcf finished for chromosome arm 8p 
## pcf finished for chromosome arm 8q 
## pcf finished for chromosome arm 9p 
## pcf finished for chromosome arm 9q 
## pcf finished for chromosome arm Xp 
## pcf finished for chromosome arm Xq 
## pcf finished for chromosome arm 1p 
## pcf finished for chromosome arm 10q 
## pcf finished for chromosome arm 11q 
## pcf finished for chromosome arm 12p 
## pcf finished for chromosome arm 12q 
## pcf finished for chromosome arm 13q 
## pcf finished for chromosome arm 15q 
## pcf finished for chromosome arm 16q 
## pcf finished for chromosome arm 17p 
## pcf finished for chromosome arm 19p 
## pcf finished for chromosome arm 19q 
## pcf finished for chromosome arm 2p 
## pcf finished for chromosome arm 22q 
## pcf finished for chromosome arm 3q 
## pcf finished for chromosome arm 5p 
## pcf finished for chromosome arm 5q 
## pcf finished for chromosome arm 6q 
## pcf finished for chromosome arm 7p 
## pcf finished for chromosome arm 7q 
## pcf finished for chromosome arm 9p 
## pcf finished for chromosome arm 9q 
## pcf finished for chromosome arm Xq 
## pcf finished for chromosome arm 1p 
## pcf finished for chromosome arm 11q 
## pcf finished for chromosome arm 13q 
## pcf finished for chromosome arm 14q 
## pcf finished for chromosome arm 15q 
## pcf finished for chromosome arm 16p 
## pcf finished for chromosome arm 16q 
## pcf finished for chromosome arm 17p 
## pcf finished for chromosome arm 17q 
## pcf finished for chromosome arm 18p 
## pcf finished for chromosome arm 18q 
## pcf finished for chromosome arm 19p 
## pcf finished for chromosome arm 19q 
## pcf finished for chromosome arm 2p 
## pcf finished for chromosome arm 2q 
## pcf finished for chromosome arm 20p 
## pcf finished for chromosome arm 20q 
## pcf finished for chromosome arm 21p 
## pcf finished for chromosome arm 21q 
## pcf finished for chromosome arm 22q 
## pcf finished for chromosome arm 3p 
## pcf finished for chromosome arm 3q 
## pcf finished for chromosome arm 4p 
## pcf finished for chromosome arm 4q 
## pcf finished for chromosome arm 5p 
## pcf finished for chromosome arm 5q 
## pcf finished for chromosome arm 6p 
## pcf finished for chromosome arm 6q 
## pcf finished for chromosome arm 7p 
## pcf finished for chromosome arm 7q 
## pcf finished for chromosome arm 8p 
## pcf finished for chromosome arm 8q 
## pcf finished for chromosome arm 9p 
## pcf finished for chromosome arm 9q 
## pcf finished for chromosome arm Xp 
## pcf finished for chromosome arm Xq 
## pcf finished for chromosome arm Yp 
## pcf finished for chromosome arm Yq 
## [1] "Getting type of segment ..."
## [1] "Getting distance of two rearrange segments ..."
## ✔ [2022-08-29 11:59:28]: Successfully get RS features!
## ✔ [2022-08-29 11:59:28]: Successfully get RS component!
## ✔ [2022-08-29 11:59:28]: Successfully get RS matrix!
## ℹ [2022-08-29 11:59:28]: 3.937 secs elapsed.
str(tally_rs)
## List of 4
##  $ features    :List of 3
##   ..$ clustered:Classes 'data.table' and 'data.frame':   4220 obs. of  3 variables:
##   .. ..$ sample: chr [1:4220] "PD26861a" "PD26861a" "PD26861a" "PD26861a" ...
##   .. ..$ value : chr [1:4220] "non-clustered" "non-clustered" "non-clustered" "non-clustered" ...
##   .. ..$ Index : int [1:4220] 1 2 3 4 5 6 7 8 9 10 ...
##   .. ..- attr(*, ".internal.selfref")=<externalptr> 
##   ..$ type     :Classes 'data.table' and 'data.frame':   4220 obs. of  3 variables:
##   .. ..$ sample: chr [1:4220] "PD26861a" "PD26861a" "PD26861a" "PD26861a" ...
##   .. ..$ value : chr [1:4220] "inv" "inv" "del" "del" ...
##   .. ..$ Index : int [1:4220] 1 2 3 4 5 6 7 8 9 10 ...
##   .. ..- attr(*, ".internal.selfref")=<externalptr> 
##   ..$ size     :Classes 'data.table' and 'data.frame':   4220 obs. of  3 variables:
##   .. ..$ sample: chr [1:4220] "PD26861a" "PD26861a" "PD26861a" "PD26861a" ...
##   .. ..$ value : chr [1:4220] ">10Mb" "1Mb-10Mb" ">10Mb" "100Kb-1Mb" ...
##   .. ..$ Index : int [1:4220] 1 2 3 4 5 6 7 8 9 10 ...
##   .. ..- attr(*, ".internal.selfref")=<externalptr> 
##  $ components  :List of 3
##   ..$ clustered:Classes 'data.table' and 'data.frame':   4220 obs. of  3 variables:
##   .. ..$ sample     : chr [1:4220] "PD26861a" "PD26861a" "PD26861a" "PD26861a" ...
##   .. ..$ Index      : int [1:4220] 1 2 3 4 5 6 7 8 9 10 ...
##   .. ..$ C_clustered: Factor w/ 2 levels "clustered","non-clustered": 2 2 2 2 2 2 2 2 2 2 ...
##   .. ..- attr(*, ".internal.selfref")=<externalptr> 
##   ..$ type     :Classes 'data.table' and 'data.frame':   4220 obs. of  3 variables:
##   .. ..$ sample: chr [1:4220] "PD26861a" "PD26861a" "PD26861a" "PD26861a" ...
##   .. ..$ Index : int [1:4220] 1 2 3 4 5 6 7 8 9 10 ...
##   .. ..$ C_type: Factor w/ 4 levels "del","inv","tds",..: 2 2 1 1 2 2 1 1 2 3 ...
##   .. ..- attr(*, ".internal.selfref")=<externalptr> 
##   ..$ size     :Classes 'data.table' and 'data.frame':   4220 obs. of  3 variables:
##   .. ..$ sample: chr [1:4220] "PD26861a" "PD26861a" "PD26861a" "PD26861a" ...
##   .. ..$ Index : int [1:4220] 1 2 3 4 5 6 7 8 9 10 ...
##   .. ..$ C_size: Factor w/ 6 levels "<1Kb",">10Mb",..: 2 6 2 5 2 2 6 5 5 5 ...
##   .. ..- attr(*, ".internal.selfref")=<externalptr> 
##  $ nmf_matrix  : int [1:10, 1:32] 13 3 2 0 1 3 2 11 5 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:10] "PD26861a" "PD26862a" "PD26864a" "PD26865a" ...
##   .. ..$ : chr [1:32] "clustered:del:>10Mb" "clustered:del:1-10Kb" "clustered:del:10-100Kb" "clustered:del:100Kb-1Mb" ...
##  $ all_matrices:List of 2
##   ..$ RS_32: int [1:10, 1:32] 13 3 2 0 1 3 2 11 5 1 ...
##   .. ..- attr(*, "dimnames")=List of 2
##   .. .. ..$ : chr [1:10] "PD26861a" "PD26862a" "PD26864a" "PD26865a" ...
##   .. .. ..$ : chr [1:32] "clustered:del:>10Mb" "clustered:del:1-10Kb" "clustered:del:10-100Kb" "clustered:del:100Kb-1Mb" ...
##   ..$ RS_38: int [1:10, 1:38] 0 0 0 0 0 0 0 0 0 0 ...
##   .. ..- attr(*, "dimnames")=List of 2
##   .. .. ..$ : chr [1:10] "PD26861a" "PD26862a" "PD26864a" "PD26865a" ...
##   .. .. ..$ : chr [1:38] "clustered:del:<1Kb" "clustered:del:>10Mb" "clustered:del:1-10Kb" "clustered:del:10-100Kb" ...