Closed nickhir closed 11 months ago
I received an excellent answer on the Bioconductor forum and am currently using the following workaround: I would greatly appreciate if you can quickly have a look at it and tell me if this is correct:
cache <- new.env(parent = emptyenv())
# CodingVariants
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene::TxDb.Hsapiens.UCSC.hg19.knownGene
z <- cdsBy(txdb)
z <- z[lengths(z) > 0L]
cache[["cdsbytx"]] <- z
# IntronVariants
z <- intronsByTranscript(txdb)
z <- z[lengths(z) > 0L]
cache[["intbytx"]] <- z
# ThreeUTRVariants
z <- threeUTRsByTranscript(txdb)
z <- z[lengths(z) > 0L]
cache[["threeUTRbytx"]] <- z
# FiveUTRVariants
z <- fiveUTRsByTranscript(txdb)
z <- z[lengths(z) > 0L]
cache[["fiveUTRbytx"]] <- z
# IntergenicVariants
z <- transcriptsBy(txdb, "gene")
z <- z[lengths(z) > 0L]
cache[["txbygene"]] <- z
# SpliceSiteVariants
# no need to populate cache further ?
# PromoterVariants
z <- transcripts(txdb)
z <- z[lengths(z) > 0L]
cache[["tx"]] <- splitAsList(z, seq_len(length(z)))
names(cache[["tx"]]) <- z$tx_id
snp <- GRanges(seqnames = "chr22", ranges = 50301422)
locateVariants(snp, txdb, AllVariants(), cache = cache)
(I have also posted this issue on the Bioconductor Forum but was not sure if it is monitored by the authors, so I am reposting it here)
Hi all,
I am using
VariantAnnotation::locateVariants
to get the location (i.e. intron, intergeneic, ...) of a list of SNPs. I have noticed however, that the results returned by wrong, when I manually look them up in the UCSC genome browser. Here is one such example (I am using R.4.2.2, TxDb.Hsapiens.UCSC.hg19.knownGene 3.2.2 and VariantAnnotation 1.44.1):returns the following result:
Gene ID 5825 corresponds to the ABCD3 gene and gene id 150365 corresponds to the MEI1 gene. However, if I go to the position of the SNP in the UCSC genome browser, it shows me that I am in an intronic region of ELAPOR1 (see image below).
Furthermore, if I use txdb to look up the chromosome on which these genes are located I get the following results:
leads to:
I would very much appreciate any insights into what is happening here, because it seems like the tool is just completely off in this case.