Skip to content

Commit

Permalink
Remove limit on number of genomes/reads downloaded
Browse files Browse the repository at this point in the history
resolves nf-core#84
  • Loading branch information
zachary-foster committed Jul 17, 2024
1 parent 96bbefa commit 1908574
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bin/check_samplesheet.R
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,11 @@ get_ncbi_sra_runs <- function(query) {
if (query == '') {
return(NULL)
}
search_result <- rentrez::entrez_search(db = 'sra', query, retmax = 300)
summary_result <- rentrez::entrez_summary(db = 'sra', search_result$ids, retmax = 300)
search_result <- rentrez::entrez_search(db = 'sra', query, retmax = 10000, use_history = TRUE)
starts <- seq(from = 1 , to = length(search_result$ids), by = 500)
summary_result <- unlist(recursive = FALSE, lapply(starts, function(start) {
rentrez::entrez_summary(db = 'sra', retmax = 500, retstart = start, web_history = search_result$web_history)
}))
if (length(search_result$ids) == 1) {
summary_result <- list(summary_result)
}
Expand Down Expand Up @@ -439,8 +442,11 @@ metadata_samp <- rbind(

# Convert NCBI reference queries to a list of assembly accessions
get_ncbi_genomes <- function(query) {
search_result <- rentrez::entrez_search(db = 'assembly', query, retmax = 300)
summary_result <- rentrez::entrez_summary(db = 'assembly', search_result$ids, retmax = 300)
search_result <- rentrez::entrez_search(db = 'assembly', query, retmax = 10000, use_history = TRUE)
starts <- seq(from = 1 , to = length(search_result$ids), by = 500)
summary_result <- unlist(recursive = FALSE, lapply(starts, function(start) {
rentrez::entrez_summary(db = 'assembly', retmax = 500, retstart = start, web_history = search_result$web_history)
}))
if (length(search_result$ids) == 1) {
summary_result <- list(summary_result)
}
Expand Down

0 comments on commit 1908574

Please sign in to comment.