报错
>ref_genome <- "BSgenome.Hsapiens.UCSC.hg38.masked"
> library(ref_genome, character.only = T)
> curr.granges <- makeGRangesFromDataFrame(curr,
seqnames.field = "Chr",
start.field= "Start",
end.field = "End",
keep.extra.columns = T)
>curr.granges$trinucleotide <- mut_context(curr.granges, ref_genome)
Error: The input GRanges (your vcf data) and the ref_genome do not have the same genome name.
This problem is known to occur when you use an outside function to read in vcfs.
The input GRanges has the genome name: 'NA'
The ref_genome has the genome name: 'hg38'
With `GenomeInfoDb::genome(your input GRanges) = 'hg38'`
you can view and change the genome name of your data to that of the ref_genome.
解决方案:
>GenomeInfoDb::genome(curr.granges)='hg38'
>curr.granges$trinucleotide <- mut_context(curr.granges, ref_genome)
>
ok,可以正常运行