Creates a new musica subsetted to only samples with enough variants

subset_musica_by_counts(musica, table_name, num_counts)

Arguments

musica

A musica object.

table_name

Name of table used for subsetting

num_counts

Minimum sum count value to drop samples

Value

Returns a new musica object with sample annotations, count tables, and variants subsetted to only contains samples with the specified minimum number of counts (column sums) in the specified table

Examples

data(musica_sbs96)
subset_musica_by_counts(musica_sbs96, "SBS96", 20)
#> An object of class "musica"
#> Slot "variants":
#>        chr     start       end ref alt                       sample
#>   1:  chr1  11020563  11020563   C   A TCGA-94-7557-01A-11D-2122-08
#>   2:  chr1  43430030  43430030   G   T TCGA-94-7557-01A-11D-2122-08
#>   3:  chr1  58682403  58682403   A   G TCGA-94-7557-01A-11D-2122-08
#>   4:  chr1 109508295 109508295   C   G TCGA-94-7557-01A-11D-2122-08
#>   5:  chr1 156384826 156384826   A   C TCGA-94-7557-01A-11D-2122-08
#>  ---                                                               
#> 869: chr19  54885292  54885292   G   A TCGA-ER-A19O-06A-11D-A197-08
#> 870: chr20  49374328  49374328   A   T TCGA-ER-A19O-06A-11D-A197-08
#> 871:  chrX  73213768  73213768   T   G TCGA-ER-A19O-06A-11D-A197-08
#> 872:  chrX 101292834 101292834   G   A TCGA-ER-A19O-06A-11D-A197-08
#> 873:  chrX 107526690 107526690   C   T TCGA-ER-A19O-06A-11D-A197-08
#>      Variant_Type
#>   1:          SBS
#>   2:          SBS
#>   3:          SBS
#>   4:          SBS
#>   5:          SBS
#>  ---             
#> 869:          SBS
#> 870:          SBS
#> 871:          SBS
#> 872:          SBS
#> 873:          SBS
#> 
#> Slot "count_tables":
#> $SBS96
#> Count_Table:  SBS96 
#> Motifs: 96 
#> Samples: 6 
#>  
#> **Annotations: 
#>            motif mutation context
#> C>A_ACA C>A_ACA      C>A     ACA
#> C>A_ACC C>A_ACC      C>A     ACC
#> C>A_ACG C>A_ACG      C>A     ACG
#> C>A_ACT C>A_ACT      C>A     ACT
#> C>A_CCA C>A_CCA      C>A     CCA
#> C>A_CCC C>A_CCC      C>A     CCC
#> 7           ...      ...     ... 
#> 
#> **Features: 
#>    mutation
#> 1  C>A_TCA
#> 2  C>A_ACT
#> 3  T>C_ATT
#> 4  C>G_TCT
#> 5  T>G_CTC
#> 6  C>G_CCC
#> 7      ... 
#> 
#> **Types: 
#>  SBS
#>  
#> **Color Variable: 
#>  mutation
#>  
#> **Color Mapping: 
#>  #5ABCEBFF
#>  #050708FF
#>  #D33C32FF
#>  #CBCACBFF
#>  #ABCD72FF
#>  #E7C9C6FF
#>  
#> **Descriptions: 
#>  Single Base Substitution table with one base upstream and downstream
#> 
#> 
#> Slot "sample_annotations":
#> Null data.table (0 rows and 0 cols)
#>