var vcfSource = (name, path) => ({ name: name, viz: pileup.viz.variants(), data: pileup.formats.vcf({ url: path }) });
var bamSource = (name, cssClass, path, chunks) => { var data = pileup.formats.bam({ url: path, indexUrl: path + '.bai', indexChunks: chunks }); return [ { name, cssClass, data, viz: pileup.viz.coverage() }, { name, cssClass, data, viz: pileup.viz.pileup() } ]; };
lazilyCreateDalliance: function() { if (this.browser) return; var vcfSource = (name, path) => ({ name: name, viz: pileup.viz.variants(), data: pileup.formats.vcf({ url: path }) }); var bamSource = (name, cssClass, path, chunks) => { var data = pileup.formats.bam({ url: path, indexUrl: path + '.bai', indexChunks: chunks }); return [ { name, cssClass, data, viz: pileup.viz.coverage() }, { name, cssClass, data, viz: pileup.viz.pileup() } ]; }; var sources = [ { name: 'Genome', viz: pileup.viz.genome(), isReference: true, data: pileup.formats.twoBit({ url: 'http://www.biodalliance.org/datasets/hg19.2bit' }) }, { name: 'Scale', viz: pileup.viz.scale() }, { name: 'Location', viz: pileup.viz.location() } ]; // See https://github.com/hammerlab/cycledash/issues/525 if (this.canDisplayPath(this.props.vcfPath)) { sources.push(vcfSource('Run VCF', this.props.vcfPath)); } if (this.canDisplayPath(this.props.truthVcfPath)) { sources.push(vcfSource('Truth VCF', this.props.truthVcfPath)); } if (this.props.normalBamPath) { sources = sources.concat(bamSource('Normal', 'normal', this.props.normalBamPath, this.state.normalBaiChunks)); } if (this.props.tumorBamPath) { sources = sources.concat(bamSource('Tumor', 'tumor', this.props.tumorBamPath, this.state.tumorBaiChunks)); } var pileupEl = this.refs.pileupElement; this.browser = pileup.create(pileupEl, { range: this.rangeForRecord(this.props.selectedRecord), tracks: sources }); },