Bioconductor / VariantAnnotation

Annotation of Genetic Variants
https://bioconductor.org/packages/VariantAnnotation
26 stars 20 forks source link

suppressing 'select()' returned 1:1 mapping #10

Closed ChristofferFlensburg closed 6 years ago

ChristofferFlensburg commented 6 years ago

Hey!

Thanks for a great package! I'm currently replacing my VEP dependency with this and it seems like it's a fair bit faster, and I'm very happy to keep it in R.

A minor annoyance is that locateVariants() keep throwing informative little messages about how many mappings select() finds which is cluttering up the output. Like this:

'select()' returned many:1 mapping between keys and columns
.'select()' returned many:1 mapping between keys and columns
'select()' returned many:1 mapping between keys and columns
'select()' returned 1:1 mapping between keys and columns
'select()' returned many:1 mapping between keys and columns
'select()' returned 1:1 mapping between keys and columns
'select()' returned many:1 mapping between keys and columns

I been trying to chase down where the message come from and if there is a way to switch them off. There is a (, ...) slot in locateVariants, but the description is only that Additional arguments passed to methods and it's not clear to if I can put anything there to make it run quietly. I tried wrapping it in capture.output(locateVariants(...)) but the messages bypassed that as well.

These messages may originate from a dependency of VariantAnnotation, but maybe someone knows how to get rid of them anyway?

Cheers, /Christoffer

ChristofferFlensburg commented 6 years ago

Turns out suppressMessages does remove the output. capture.output() claims to capture the messages stream, but apparently it doesn't always. Oh well...

mtmorgan commented 6 years ago

capture.output() has an argument type=c("output", "message"); if unspecified then the output stream is captured, so you'd want (if you would want to capture the output, but I think you want to suppressMessages()) capture.output(locateVariants(...), type="message").

Closing this issue.