Published
Edited
Apr 15, 2022
1 fork
Insert cell
# firebrowse
<link href="https://episphere.github.io/gps/obs.css" rel="stylesheet">
Insert cell
url = "http://firebrowse.org/api/v1/Samples/mRNASeq?format=json&gene=EGFR&cohort=BRCA&protocol=RSEM&page=1&page_size=25&sort_by=cohort"
Insert cell
Insert cell
fb = require('https://episphere.github.io/firebrowse/firebrowse.js')
//fb=require('http://localhost:8000/firebrowse/firebrowse.js')
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
fetchFirestore(
"http://firebrowse.org/api/v1/Analyses/Mutation/MAF?format=json&cohort=BRCA&tool=MutSig2CV",
1,
10
)
Insert cell
Let's create a new fetcher that will take an array of pages
Insert cell
Insert cell
Insert cell
pp = fetchFirestoreArray(
"http://firebrowse.org/api/v1/Analyses/Mutation/MAF?format=json&cohort=BRCA&tool=MutSig2CV",
[1, 2, 3, 4],
10
)
Insert cell
res = Promise.all(pp)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
async function mFetch(urlArray = urls, n = nPages) {
const m = urlArray.length;
let resArray = []; // initializing results array
for (let i = 0; i < m; i++) {
// I think it is the await that forces the for loop not to be treated as a paralell .forEach():
resArray[i] = await fetchFirestore(urlArray[i]);
console.log(i, resArray[i]);
console.log(Date());
console.log(urlArray[i]);
}
return resArray;
}
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more