Skip to content
Prev 19549 / 21312 Next

[Bioc-devel] httr::GET() problem downloading a ExperimentHub resource

good catch, but really enigmatic, BAI files work, but BAM don't:

dat <- 
read.csv("https://raw.githubusercontent.com/functionalgenomics/gDNAinRNAseqData/devel/inst/extdata/metadata_LiYu22subsetBAMfiles.csv")
rdatapath <- strsplit(dat$RDataPath, ":")
bamfiles <- unlist(rdatapath)[seq(1, 18, 2)]
baifiles <- unlist(rdatapath)[seq(2, 18, 2)]

bamurls <- paste0(dat$Location_Prefix, bamfiles)
baiurls <- paste0(dat$Location_Prefix, baifiles)

## BAM files give error
for (bf in bamurls) {
 ? cat(sprintf("%s\n", basename(bf)))
 ? tryCatch({
 ??? curl::curl_fetch_disk(bf, tempfile())
 ? }, error=function(e) message(paste0(e, "\n")))
}

## BAI files do not give error
for (bf in baiurls) {
 ? cat(sprintf("%s\n", basename(bf)))
 ? tryCatch({
 ??? curl::curl_fetch_disk(bf, tempfile())
 ? }, error=function(e) message(paste0(e, "\n")))
}

any further idea??

robert.
On 29/3/23 21:10, Martin Morgan wrote: