Skip to content

Allow 'ANY' txdb, eg. EnsDb objects#74

Open
mschubert wants to merge 1 commit intoBioconductor:develfrom
mschubert:devel
Open

Allow 'ANY' txdb, eg. EnsDb objects#74
mschubert wants to merge 1 commit intoBioconductor:develfrom
mschubert:devel

Conversation

@mschubert
Copy link

Thank for for the VariantAnnotation package, it makes it very easy to annotate mutations found in VCF files!

There is, however, one limitation that I find unnecessarily restrictive: The predictCoding method expects a TxDb object as its second argument and will not be able to process gene and transcript annotations otherwise.

I propose that the limitation here should be any object that supports the cdsBy and transcriptsBy methods, e.g. an EnsDb object. As they do not share a common base class, I allow ANY type that will then error if the associated methods are not found.

In particular, the code that previously failed now works successfully:

ens106 = AnnotationHub::AnnotationHub()[["AH100643"]]
asm = BSgenome.Hsapiens.NCBI.GRCh38::BSgenome.Hsapiens.NCBI.GRCh38
fname = system.file("extdata", "chr22.vcf.gz", package="VariantAnnotation")
vr = VariantAnnotation::readVcfAsVRanges(fname)
res = predictCoding(vr, ens106, asm)
# Error in (function (classes, fdef, table)  :
#   unable to find an inherited method for 'predictCoding' for signature '"VRanges", "EnsDb", "BSgenome", "missing"'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant