Make trinucleotides counts matrix from input data for a given reference genome.

import.trinucleotides.counts(data, reference = NULL)

Arguments

data

a data.frame with variants having 6 columns: sample name, chromosome, start position, end position, ref, alt.

reference

a BSgenome object with the reference genome to be used to retrieve flanking bases.

Value

A matrix with trinucleotides counts per patient.

Examples

data(ssm560_reduced)
library("BSgenome.Hsapiens.1000genomes.hs37d5")
#> Loading required package: BSgenome
#> Loading required package: S4Vectors
#> Loading required package: stats4
#> 
#> Attaching package: ‘S4Vectors’
#> The following object is masked from ‘package:NMF’:
#> 
#>     nrun
#> The following object is masked from ‘package:utils’:
#> 
#>     findMatches
#> The following objects are masked from ‘package:base’:
#> 
#>     I, expand.grid, unname
#> Loading required package: IRanges
#> Loading required package: GenomeInfoDb
#> Loading required package: GenomicRanges
#> Loading required package: Biostrings
#> Loading required package: XVector
#> 
#> Attaching package: ‘Biostrings’
#> The following object is masked from ‘package:base’:
#> 
#>     strsplit
#> Loading required package: BiocIO
#> Loading required package: rtracklayer
#> 
#> Attaching package: ‘rtracklayer’
#> The following object is masked from ‘package:BiocIO’:
#> 
#>     FileForFormat
trinucleotides_counts = import.trinucleotides.counts(data=ssm560_reduced, 
     reference=BSgenome.Hsapiens.1000genomes.hs37d5)