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

NCBI ftp: download fails #59

Open
tghazanchyan opened this issue Aug 8, 2024 · 3 comments
Open

NCBI ftp: download fails #59

tghazanchyan opened this issue Aug 8, 2024 · 3 comments

Comments

@tghazanchyan
Copy link

In certain environments, access to external resources via the insecure FTP protocol is entirely blocked.
Could you kindly provide an option to switch to the HTTP protocol for downloading data from NCBI?
NCBI offers symmetrical access to the same data over both FTP and HTTP.

@hpages
Copy link
Contributor

hpages commented Aug 11, 2024

Please show the code that fails as well as your sessionInfo()

@jmacdon
Copy link
Collaborator

jmacdon commented Aug 12, 2024

I believe OP is talking about this:

.downloadData <- function(file, tax_id, NCBIFilesDir, rebuildCache, verbose)
{
    if (verbose)
        message("getting data for ", names(file))

    ## NCBI connection
    if (is.null(NCBIFilesDir)) {
        NCBIcon <- dbConnect(SQLite(), dbname = tempfile())
        tmp <- tempfile()
    } else {
        NCBIcon <- dbConnect(SQLite(),
                             dbname = file.path(NCBIFilesDir, "NCBI.sqlite"))
        tmp <- file.path(NCBIFilesDir, names(file))
    }
    tableName <- sub(".gz","",names(file))

    ## download
    if (rebuildCache) {
        if(names(file) == "gene2unigene"){
            url <- paste0("ftp://ftp.ncbi.nlm.nih.gov/gene/DATA/ARCHIVE/", names(file))
        }else{
            url <- paste0("ftp://ftp.ncbi.nlm.nih.gov/gene/DATA/", names(file))
        }

@tghazanchyan
Copy link
Author

Thanks @jmacdon !
Yes, I was referring to the hardcoded FTP links.
It would be great to have a parameter that allows for selecting between FTP and HTTP.

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

No branches or pull requests

3 participants