Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return () => {
tsv(data).then(d => {
// console.log(d);
this.data = d;
this.drawFromFile();
});
};
} else if (data.includes('.json')) {
export function launch(tableId, datasetId='gtex_v7', googleFuncDict=googleFunc(), urls=getGtexUrls()){
const promises = [
json(urls.tissue),
tsv(urls.rnaseqCram), // rnaseq cram file info
tsv(urls.wgsCram), // wgs cram file info
tsv(urls.sample), // GTEx sample TSV file: for better performance
];
Promise.all(promises)
.then(function(args){
let tissues = parseTissues(args[0]); // get GTEx tissue objects
const cram = {
rnaseq: args[1].reduce((a, d)=>{a[d.sample_id.toUpperCase()]=d; return a;}, {}),
wgs: args[2].reduce((a, d)=>{a[d.sample_id.toUpperCase()]=d; return a;}, {})
};
// parse Samples
let samples = args[3]
.filter((s)=>s.datasetId==datasetId)
.map((s)=>{
switch (s.dataType){
case "WGS": {
if (!cram.wgs.hasOwnProperty(s.sampleId)) throw s.sampleId + ' has no cram files';
export function launch(tableId, datasetId='gtex_v7', googleFuncDict=googleFunc(), urls=getGtexUrls()){
const promises = [
json(urls.tissue),
tsv(urls.rnaseqCram), // rnaseq cram file info
tsv(urls.wgsCram), // wgs cram file info
tsv(urls.sample), // GTEx sample TSV file: for better performance
];
Promise.all(promises)
.then(function(args){
let tissues = parseTissues(args[0]); // get GTEx tissue objects
const cram = {
rnaseq: args[1].reduce((a, d)=>{a[d.sample_id.toUpperCase()]=d; return a;}, {}),
wgs: args[2].reduce((a, d)=>{a[d.sample_id.toUpperCase()]=d; return a;}, {})
};
// parse Samples
let samples = args[3]
.filter((s)=>s.datasetId==datasetId)
.map((s)=>{
// find the right CRAM manifest file
switch (s.dataType){
export function launch(tableId, datasetId='gtex_v7', googleFuncDict=googleFunc(), urls=getGtexUrls()){
const promises = [
json(urls.tissue),
tsv(urls.rnaseqCram), // rnaseq cram file info
tsv(urls.wgsCram), // wgs cram file info
tsv(urls.sample), // GTEx sample TSV file: for better performance
];
Promise.all(promises)
.then(function(args){
let tissues = parseTissues(args[0]); // get GTEx tissue objects
const cram = {
rnaseq: args[1].reduce((a, d)=>{a[d.sample_id.toUpperCase()]=d; return a;}, {}),
wgs: args[2].reduce((a, d)=>{a[d.sample_id.toUpperCase()]=d; return a;}, {})
};
// parse Samples
let samples = args[3]
.filter((s)=>s.datasetId==datasetId)
.map((s)=>{
// find the right CRAM manifest file
switch (s.dataType){
case "WGS": {
return () => {
tsv(data).then(d => {
console.log(d);
this.data = d;
this.drawFromFile();
});
};
} else if (data.includes('.json')) {
return () => {
tsv(data).then(d => {
this.data = d;
this.drawFromFile();
});
};
}
return () => {
tsv(data).then(d => {
this.getTotal(d);
this.data = d;
this.drawFromFile();
});
};
}
return () => {
tsv(data).then(d => {
this.data = d;
this.drawFromFile();
});
};
}
that.load_preset_buttons = function () {
const presets = that.add_card_section('Some interesting locations', '', 'presets');
d3Fetch.tsv(`${base_dir}/presets.tsv`).then((dat) => {
const buttons = presets.selectAll('a').data(dat);
buttons.enter()
.append('a')
.attr('class', 'btn')
.text(d => d.label)
.on('click', (d) => {
that.zoom_to(d.z, d.x, d.y);
});
});
return that;
};