Prepare a matrix with one row per sample and one column per region using a set of hypermutated regions.

get_ashm_count_matrix(
  regions_bed,
  maf_data,
  these_samples_metadata,
  seq_type,
  from_indexed_flatfile = TRUE
)

Arguments

regions_bed

A bed file with one row for each region.

maf_data

Optionally provide a data frame in the MAF format, otherwise the database will be used.

these_samples_metadata

This is used to complete your matrix. All GAMBL samples will be used by default. Provide a data frame with at least sample_id for all samples if you are using non-GAMBL data.

seq_type

The seq type to return results for.

from_indexed_flatfile

Boolean parameter set to TRUE per default.

Value

A matrix.

Details

Values are the number of mutations in that patient in the region.

Examples

regions_bed = dplyr::mutate(GAMBLR.data::somatic_hypermutation_locations_GRCh37_v_latest, name = paste(gene, region, sep = "_"))

matrix = get_ashm_count_matrix(regions_bed = regions_bed,
                               seq_type = "genome")
#>   [1] "chr1:6661482-6662702"      "chr1:23885584-23885835"   
#>   [3] "chr1:150550814-150552135"  "chr1:203274698-203275778" 
#>   [5] "chr1:226864857-226873452"  "chr1:226920563-226927885" 
#>   [7] "chr1:226921088-226927982"  "chr2:60773789-60783486"   
#>   [9] "chr2:96808901-96811913"    "chr2:111874854-111882174" 
#>  [11] "chr2:136874728-136875461"  "chr3:16546433-16556786"   
#>  [13] "chr3:32020518-32024930"    "chr3:71104986-71119518"   
#>  [15] "chr3:71176427-71180960"    "chr3:71350633-71357665"   
#>  [17] "chr3:71503103-71504870"    "chr3:71550753-71551478"   
#>  [19] "chr3:71626341-71635648"    "chr3:101546669-101547704" 
#>  [21] "chr3:101568239-101569274"  "chr3:183269360-183274139" 
#>  [23] "chr3:186739628-186740875"  "chr3:186782522-186784438" 
#>  [25] "chr3:187458526-187464632"  "chr3:187771678-187801626" 
#>  [27] "chr3:187801627-187813568"  "chr3:187813569-187955254" 
#>  [29] "chr3:187955255-187969220"  "chr3:188377178-188401951" 
#>  [31] "chr3:188401952-188461879"  "chr3:188461880-188474683" 
#>  [33] "chr3:188474684-188491248"  "chr4:40193105-40204231"   
#>  [35] "chr5:88131209-88174373"    "chr5:88174374-88182243"   
#>  [37] "chr5:88182244-88206620"    "chr5:131823933-131826458" 
#>  [39] "chr5:149790977-149792349"  "chr5:158500476-158532769" 
#>  [41] "chr6:390572-394093"        "chr6:14118026-14120025"   
#>  [43] "chr6:31548325-31550717"    "chr6:37138104-37139804"   
#>  [45] "chr6:90981034-91016134"    "chr6:134487960-134499859" 
#>  [47] "chr6:159237903-159240216"  "chr7:5568297-5570856"     
#>  [49] "chr8:11347723-11355318"    "chr8:128748352-128749427" 
#>  [51] "chr9:37023396-37027663"    "chr9:37029849-37037154"   
#>  [53] "chr9:37192080-37207549"    "chr9:37275952-37306152"   
#>  [55] "chr9:37312655-37328260"    "chr9:37329706-37340398"   
#>  [57] "chr9:37369209-37372160"    "chr9:37382267-37385854"   
#>  [59] "chr9:37395932-37409239"    "chr9:37423010-37425279"   
#>  [61] "chr10:127578912-127591133" "chr11:9595246-9599502"    
#>  [63] "chr11:35156769-35164248"   "chr11:60223385-60225310"  
#>  [65] "chr11:65190369-65192380"   "chr11:65265237-65268359"  
#>  [67] "chr11:102188170-102190077" "chr11:111248078-111250224"
#>  [69] "chr11:128339774-128345731" "chr11:128388492-128394163"
#>  [71] "chr12:11796001-11812968"   "chr12:25204045-25213569"  
#>  [73] "chr12:92537999-92539598"   "chr12:113492311-113497546"
#>  [75] "chr12:122456912-122464036" "chr13:46957278-46963342"  
#>  [77] "chr14:69257848-69259739"   "chr14:94940587-94942549"  
#>  [79] "chr14:96179535-96180366"   "chr15:59658991-59671152"  
#>  [81] "chr16:10970795-10975465"   "chr16:11347512-11350007"  
#>  [83] "chr16:27322895-27329423"   "chr16:85931918-85933977"  
#>  [85] "chr17:3597616-3599572"     "chr17:56407732-56410140"  
#>  [87] "chr17:75424734-75440956"   "chr17:75443766-75451177"  
#>  [89] "chr17:75453203-75471471"   "chr17:79478289-79479959"  
#>  [91] "chr18:60796984-60814103"   "chr18:60982728-60988342"  
#>  [93] "chr19:10340142-10341764"   "chr19:16434978-16439011"  
#>  [95] "chr19:19279635-19281441"   "chr20:46128611-46138099"  
#>  [97] "chr20:49120482-49140477"   "chr21:26934372-26937651"  
#>  [99] "chr22:23229554-23232042"   "chrX:12993308-12994511"   
#> [101] "chrX:48774756-48776255"   
#> Joining with `by = join_by(sample_id, region_name)`