diff --git a/frontend/src/components/TextTrack.js b/frontend/src/components/TextTrack.js index 5b8c3dea..e2b8dcd1 100644 --- a/frontend/src/components/TextTrack.js +++ b/frontend/src/components/TextTrack.js @@ -77,6 +77,20 @@ chr1 791044 793910 chr8:248210-251154,2 7 .` "chr5:1270279-1272416<->SV40:5172-5243" TRUE FALSE NA 35 37.2369416773403 "chr8:128109053-128110360<->chr8:129534833-129536039" FALSE FALSE 1425729.5 100 34.8639202860754 "chr20:49345639-49354229<->chr20:50511129-50512012" FALSE FALSE 1161636.5 129 30.5556940820741` + }, + callingcard: { + label: 'callingcard', + desc: 'Text file in CCF format, comprising 4-6 columns: chrom, start, end, value; and, optionally, strand and annotation', + example: `chr1 51441754 51441758 1 - CTAGAGACTGGC +chr1 51441754 51441758 21 - CTTTCCTCCCCA +chr1 51982564 51982568 3 + CGCGATCGCGAC +chr1 52196476 52196480 1 + AGAATATCTTCA +chr1 52341019 52341023 1 + TACGAAACACTA +chr1 59951043 59951047 1 + ACAAGACCCCAA +chr1 59951043 59951047 1 + ACAAGAGAGACT +chr1 61106283 61106287 1 - ATGCACTACTTC +chr1 61106283 61106287 7 - CGTTTTTCACCT +chr1 61542006 61542010 1 - CTGAGAGACTGG` } }; diff --git a/frontend/src/components/trackConfig/CallingCardTrackConfig.ts b/frontend/src/components/trackConfig/CallingCardTrackConfig.ts index a5dabd4c..96d68027 100644 --- a/frontend/src/components/trackConfig/CallingCardTrackConfig.ts +++ b/frontend/src/components/trackConfig/CallingCardTrackConfig.ts @@ -6,6 +6,7 @@ import { BedWorker } from '../../dataSources/WorkerTSHook'; import LocalBedSource from '../../dataSources/LocalBedSource'; import CallingCard from '../../model/CallingCard'; import BedRecord from '../../dataSources/bed/BedRecord'; +import BedTextSource from "../../dataSources/BedTextSource"; import HeightConfig from '../trackContextMenu/HeightConfig'; import YscaleConfig from '../trackContextMenu/YscaleConfig'; import LogScaleConfig from '../trackContextMenu/LogScaleConfig'; @@ -22,10 +23,18 @@ export class CallingCardTrackConfig extends TrackConfig { } initDataSource() { - if (this.trackModel.files.length > 0) { - return new LocalBedSource(this.trackModel.files); + if (this.trackModel.isText) { + return new BedTextSource({ + url: this.trackModel.url, + blob: this.trackModel.fileObj, + textConfig: this.trackModel.textConfig + }); } else { - return new WorkerSource(BedWorker, this.trackModel.url); + if (this.trackModel.files.length > 0) { + return new LocalBedSource(this.trackModel.files); + } else { + return new WorkerSource(BedWorker, this.trackModel.url); + } } }