Create GRanges object out of mutations

mut_to_gr(mut)

Arguments

mut

A data.frame like object with all mutations and patients of the cohort of interest. Should have the following columns:

  • patient_id

  • mut_id

  • chr

  • start or pos

  • end or pos

Examples

data(mut_toy)
mut_to_gr(mut_toy)
#> GRanges object with 9 ranges and 1 metadata column:
#>       seqnames    ranges strand |        name
#>          <Rle> <IRanges>  <Rle> | <character>
#>   [1]        1      1000      * |         m01
#>   [2]        1      2000      * |         m02
#>   [3]        2      3000      * |         m03
#>   [4]        1      1000      * |         m01
#>   [5]        2      4000      * |         m04
#>   [6]        3      5000      * |         m05
#>   [7]        1      2000      * |         m02
#>   [8]        2      4000      * |         m04
#>   [9]        2      6000      * |         m06
#>   -------
#>   seqinfo: 3 sequences from an unspecified genome; no seqlengths