Hello! Could you help me please.
I use predictCoding() to get information about nucleotide substitutions:
> nonsyn <- predictCoding(vcf_mod, txdb, Hsapiens)
Then I need to overlap the GRanges I've got from predictCoding() with the positition in
the SNPloc package:
Get the locations and alleles of all SNPs on chromosomes 1:
> ch1snps <- getSNPlocs("ch1") > ch1gr <-getSNPlocs("ch1", as.GRanges=TRUE)
Overlap the snps with my ranges from predictCoding():
> mysnps <- GRanges("ch1", IRanges(865692:249150116, width=1))
When 865692 is the first start position for chr1 , 249150116 is the last start position for chr1.
> hits <- findOverlaps(mysnps, ch1gr) > hits Hits of length 1418032 queryLength: 242470673 subjectLength: 1422439 Pull out the snp that was hit: > ch1gr[subjectHits(hits),]
GRanges with 1418032 ranges and 2 metadata columns
I don't understand which input is used for GRanges?I want to apply GRanges to my nonsyn.
my nonsyn table contains 20859 rows for all chromosomes.
i need to overlap only ranges for chr2 in nonsyn (2294 rows), but hits contain too many overlaps.
I know how overlap 1 range:
> mysnps <- GRanges("ch1", IRanges(865692, width=1))
but how overlape all ranges for chr1 from nonsyn?