Skip to content

Instantly share code, notes, and snippets.

@BenLangmead
Last active January 22, 2024 20:26
Show Gist options
  • Save BenLangmead/545634578b6a80e5bba0e31843923e7a to your computer and use it in GitHub Desktop.
Save BenLangmead/545634578b6a80e5bba0e31843923e7a to your computer and use it in GitHub Desktop.
SRA growth calc
system('curl https://trace.ncbi.nlm.nih.gov/Traces/sra/sra_stat.cgi > /tmp/stats.csv')
st <- read.table('/tmp/stats.csv', sep=',', header=T)
st$date <- as.Date(st$date, format='%m/%d/%Y')
i <- min(which(st$bases >= 0.5625e16))
id1 <- i
id2 <- min(which(st$bases >= 1.125e16))
id3 <- min(which(st$bases >= 2.25e16))
id4 <- min(which(st$bases >= 4.5e16))
id5 <- min(which(st$bases >= 8.95e16))
plot(st$date[id1:id5], log10(st$bases[id1:id5]), type='l', xlab="Date", ylab="log10(Total SRA bases)")
lines(st$date[id1:id2], log10(st$bases[id1:id2]), lwd=3, col='blue')
lines(st$date[id2:id3], log10(st$bases[id2:id3]), lwd=3, col='red')
lines(st$date[id3:id4], log10(st$bases[id3:id4]), lwd=3, col='blue')
lines(st$date[id4:id5], log10(st$bases[id4:id5]), lwd=3, col='red')
points(c(st$date[id1], st$date[id2], st$date[id3], st$date[id4], st$date[id5]),
+ log10(c(st$bases[id1], st$bases[id2], st$bases[id3], st$bases[id4], st$bases[id5])), pch=16)
# 2016-10-12
text(c(as.Date('2017-7-18')), c(15.85), "5.6 to 11.3 PB\nin ~9.5 months", col='blue', cex=0.8)
# 2017-07-01
text(c(as.Date('2017-02-15')), c(16.23), "11.3 to 22.5 PB\nin ~19 months", col='red', cex=0.8)
# 2019-02-13
text(c(as.Date('2019-09-13')), c(16.28), "22.5 to 45 PB\nin ~22 months", col='blue', cex=0.8)
# 2021-01-22
text(c(as.Date('2021-09-18')), c(16.62), "45 to 89.5 PB\nin ~40 months", col='red', cex=0.8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment