GRanges-converters {SomaticSignatures} | R Documentation |
A set of utilities functions to convert and extract data in 'GRanges' objects.
ncbi(x) ucsc(x) seqchar(x)
x |
A 'GRanges' object or one inheriting from the 'GRanges' class [required]. |
grangesExtracts only the 'GRanges' information by dropping the metadata columns of the object. The 'seqinfo' slot is kept.
ncbi, ucscShorthand for converting the seqnames notation to 'UCSC' (e.g. 'chr1', 'chrM') or 'NCBI' (e.g. '1', 'MT”) notation, respectively. This also sets the 'genome' slot in the 'seqinfo' field to 'NA'.
seqcharExtracts the 'seqnames' as a character vector.
For 'ncbi', 'ucsc': An object of the same class as the input.
For 'seqchar': A character vector with 'seqnames'.
mutect_path = system.file("examples", "mutect.tsv", package = "SomaticSignatures") vr1 = readMutect(mutect_path, strip = TRUE) ## extract the GRanges gr = granges(vr1) ## convert back and forth gr_ncbi = ncbi(gr) gr_ucsc = ucsc(gr_ncbi) identical(gr, gr_ucsc) ## extract the seqnames as a character vector seq_chars = seqchar(gr)