Public
Edited
Feb 22, 2023
Insert cell
Insert cell
TCGA_expression_two_gene.mRNASeq[10].tcga_participant_barcode
Insert cell
Insert cell
// modify richard's firehose TCGA example - now query for two genes
// http://firebrowse.org/api-docs/#!/Samples/mRNASeq
TCGA_expression_two_gene = {
let queryJSON = {
format: 'json',
gene: "GATA6,TP53",
page: 1,
page_size: 2000,
sort_by: 'tcga_participant_barcode',
cohort: "PAAD"
}
let hosturl = 'https://firebrowse.jonasalmeida.repl.co'
let endpointurl='http://firebrowse.org/api/v1/Samples/mRNASeq'
console.log(endpointurl +'?' + jq.param(queryJSON))
return (await fetch(hosturl +'?'+endpointurl +'?' + jq.param(queryJSON))).json()
}


Insert cell
// modify richard's firehose TCGA example - now query for significant mutations, all PAAD, just KRAS gene
// http://firebrowse.org/api-docs/#!/Analyses/SMG
TCGA_SMG = {
let queryJSON = {
format: 'json',
gene: 'KRAS',
page: 1,
page_size: 2000,
cohort: "PAAD"
}
let hosturl = 'https://firebrowse.jonasalmeida.repl.co'
let endpointurl='http://firebrowse.org/api/v1/Analyses/Mutation/SMG'
return (await fetch(hosturl +'?'+endpointurl +'?' + jq.param(queryJSON))).json()
}
Insert cell
jq = require("https://code.jquery.com/jquery-3.4.1.js")
Insert cell
topic = 20

Insert cell
10 + topic
Insert cell
res = { let a = 1;
var b = 2;
const c = 2.3
let d = "string";
return d; }
Insert cell
res_arr = { let sandwich = [["peanut butter", 1, "bread"], ["peanut butter", 1, "bread"]];
//sandwich[1] = "bob";
return sandwich;}
Insert cell
function functionName(word = "World!") {
return "Hello " + word;
}
Insert cell
functionName("Mom")
Insert cell
counter = {
mutable counterOne = 3
return 6;
}
Insert cell
mutable counterOne = 0
Insert cell
mutable counterTwo = 0
Insert cell
testArr = [1, 2, 3, 4, 5];
Insert cell
function nextInLine(arr, item) {
arr.push(item)
let first = arr.shift()
return first;
}
Insert cell
nextInLine(testArr,6)
Insert cell
testArr
Insert cell
function wrapper() {
let count = 0;
function cc(card) {
switch (card) {
case 2:
case 3:
case 4:
case 5:
case 6:
count += 1;
break;
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
count -= 1;
}
let ret_val = " Bet";
if (1 <= 0) {
ret_val = " Hold"
}
return count + ret_val;
}

return cc(2) + " ; " + cc(3) + " ; " + cc(7) + " ; " + cc('K') + " ; " + cc('A');
}
Insert cell
wrapper()
Insert cell
// READ These:
// https://observablehq.com/@observablehq/mutable
// https://observablehq.com/@alainro/counter-and-reset

// this is the datastructures for webgen
// https://docs.google.com/document/d/1-QKyv2fZRTnWmCV6z4av9rI5gM4eCm8B5jQlt8knjeM/edit#heading=h.fmuvlb2blmlo
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