Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

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