grimbough / biomaRt

R package providing query functionality to BioMart instances like Ensembl
https://bioconductor.org/packages/biomaRt/
34 stars 13 forks source link

Conflict with getBM and the progress package #13

Closed lubianat closed 5 years ago

lubianat commented 5 years ago

Hello,

I saw that you use the package progress in the getBM function as in the following code snippet:

resultList <- list() if(length(filterXmlList) > 1) { pb <- progress_bar$new(total = length(filterXmlList), width = options()$width - 10, format = "Batch submitting query [:bar] :percent eta: :eta") pb$tick(0) }

It is an excellent feature to have. The problem is that the name of the progress bar variable ("pb") is the same as the tutorial of the progress package. And if I run the tutorial, there is a conflict that blocks the getBM function.

I guess the pb objects are, in the end, loaded to the same scope. Changing the names in the getBM function would probably do the job to fix it, I will change the names from "pb" to "pb_biomaRt" and send a pull request if it is the same to you.

Of course, we can discuss it further.

Best, Tiago

grimbough commented 5 years ago

Thanks for the report & pull request. I think that a safer solution would be to remove the call to exists() completely, as this will still fail if for some reason there's a pb_biomaRt defined in the global environment (unlikely, but possible).

Since an internal version of bp will exist if length(filterXmlList) > 1 it seems safest to use that same logic to check before calling the tick increment.