🌲 An easy-to-use and scalable toolkit for genomic alteration signature (a.k.a. mutational signature) analysis and visualization in R https://shixiangwang.github.io/sigminer/reference/index.html
Basically, when running sig_tally on a rearrangement dataset with only a single sample, numeric vectors are output instead of a matrix with sample names as rownames, the latter being the standard way all other sig_tally outputs are returned. Note that this problem is specific to the RS_32 tally results. The RS_38 matrix works fine. Also, if you run sig_tally on an RS dataset with multiple samples, the output is as expected.
Reprex is below:
library(sigminer)
#> Registered S3 method overwritten by 'sigminer':
#> method from
#> print.bytes Rcpp
#> sigminer version 2.3.1
#> - Star me at https://github.com/ShixiangWang/sigminer
#> - Run hello() to see usage and citation.
# Prepare two rearrangement datasets, one with a single sample, and one with 10 samples
sv <- readRDS(system.file("extdata", "toy_sv.rds", package = "sigminer", mustWork = TRUE))
rs_ten_samples <- read_sv_as_rs(sv)
#> succesfully read RS!
rs_single_sample <- subset(rs_ten_samples, sample == "PD26861a")
# Run Sig-Tally on Both Datasets
tally_rs_ten_samples <- sig_tally(rs_ten_samples)
#> ℹ [2024-08-02 16:45:27.200449]: Started.
#> ✔ [2024-08-02 16:45:27.206209]: Successfully get RS list!
#> [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 ..."
#> Warning: pcf is not run for sample 1 on chromosome arm 22q because all
#> observations are missing. NA is returned.
#> Warning: pcf is not run for sample 1 on chromosome arm 22q because all
#> observations are missing. NA is returned.
#> Warning in .merge_two_Seqinfo_objects(x, y): Each of the 2 combined objects has sequence levels not in the other:
#> - in 'x': 1, 10, 12, 15, 16, 17, 2, 20, 21, 3, 4, 6, 7, 8, 9
#> - in 'y': X
#> Make sure to always combine/compare objects based on the same reference
#> genome (use suppressWarnings() to suppress this warning).
#> Warning: pcf is not run for sample 1 on chromosome arm 21p because all
#> observations are missing. NA is returned.
#> Warning: pcf is not run for sample 1 on chromosome arm 22q because all
#> observations are missing. NA is returned.
#> Warning: pcf is not run for sample 1 on chromosome arm 19p because all
#> observations are missing. NA is returned.
#> Warning: pcf is not run for sample 1 on chromosome arm 17q because all
#> observations are missing. NA is returned.
#> Warning: pcf is not run for sample 1 on chromosome arm 18q because all
#> observations are missing. NA is returned.
#> Warning in .merge_two_Seqinfo_objects(x, y): Each of the 2 combined objects has sequence levels not in the other:
#> - in 'x': 10, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22, 4, 5, 6, 7, 8, 9
#> - in 'y': Y
#> Make sure to always combine/compare objects based on the same reference
#> genome (use suppressWarnings() to suppress this warning).
#> Warning: pcf is not run for sample 1 on chromosome arm Xp because all
#> observations are missing. NA is returned.
#> Warning: pcf is not run for sample 1 on chromosome arm 3q because all
#> observations are missing. NA is returned.
#> ✔ [2024-08-02 16:45:28.787414]: Successfully get RS features!
#> ✔ [2024-08-02 16:45:28.788606]: Successfully get RS component!
#> ✔ [2024-08-02 16:45:28.797972]: Successfully get RS matrix!
#> ℹ [2024-08-02 16:45:28.798707]: 1.598 secs elapsed.
tally_rs_single_sample <- sig_tally(rs_single_sample)
#> ℹ [2024-08-02 16:45:28.799606]: Started.
#> ✔ [2024-08-02 16:45:28.800475]: Successfully get RS list!
#> [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
#> [1] "Getting type of segment ..."
#> [1] "Getting distance of two rearrange segments ..."
#> ✔ [2024-08-02 16:45:28.896701]: Successfully get RS features!
#> ✔ [2024-08-02 16:45:28.897559]: Successfully get RS component!
#> ✔ [2024-08-02 16:45:28.901168]: Successfully get RS matrix!
#> ℹ [2024-08-02 16:45:28.901739]: 0.102 secs elapsed.
# The format of multi-sample datasets is as expected (matrix with sample IDs as rownames)
tally_rs_ten_samples$all_matrices$RS_32 |> class()
#> [1] "matrix" "array"
# The format of single-sample datasets (RS32 only) is different (returns vector instead of a matrix with sample IDs as rownames)
tally_rs_single_sample$all_matrices$RS_38 |> class() # Returns a matrix with rownames = sample
#> [1] "matrix" "array"
tally_rs_single_sample$all_matrices$RS_32 |> class() # Should be a matrix like all the other versions
#> [1] "integer"
Hi, identical issue to https://github.com/ShixiangWang/sigminer/issues/453 but this time for RS_32 matrix for single sample rearrangement analysis.
Basically, when running sig_tally on a rearrangement dataset with only a single sample, numeric vectors are output instead of a matrix with sample names as rownames, the latter being the standard way all other sig_tally outputs are returned. Note that this problem is specific to the RS_32 tally results. The RS_38 matrix works fine. Also, if you run sig_tally on an RS dataset with multiple samples, the output is as expected.
Reprex is below:
Created on 2024-08-02 with reprex v2.1.0