objects:
How to extract the DNA sequences in the genomes within R.
get sequences.
#read data in GenomicRanges
gr_muts = GenomicRanges::GRanges(mut$CHR, IRanges::IRanges(mut$POSITION,mut$POSITION))
S4Vectors::mcols(gr_muts) = dplyr::select(mut, ids)
#get sequences by BSgenome
library(BSgenome.Hsapiens.UCSC.hg19)
seqs = BSgenome::getSeq( Hsapiens , gr_muts)
网友评论