-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmutation.ts
36 lines (35 loc) · 1.21 KB
/
mutation.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { SingleTrack } from 'gosling.js/dist/src/gosling-schema';
import { TrackMode } from './index';
export default function mutation(
sampleId: string,
url: string,
indexUrl: string,
width: number,
height: number,
mode: TrackMode
): SingleTrack {
return {
id: `${sampleId}-${mode}-mutation`,
title: ' Point Mutation',
style: { background: '#FFFFFF', inlineLegend: true },
data: {
type: 'vcf',
url,
indexUrl,
sampleLength: 500
},
dataTransform: [{ field: 'DISTPREV', type: 'filter', oneOf: [0], not: true }],
mark: 'point',
x: { field: 'POS', type: 'genomic' },
color: { field: 'SUBTYPE', type: 'nominal', legend: true, domain: ['C>A', 'C>G', 'C>T', 'T>A', 'T>C', 'T>G'] },
y: { field: 'DISTPREVLOGE', type: 'quantitative', axis: 'right', range: [10, height - 10] },
opacity: { value: 0.9 },
tooltip: [
{ field: 'DISTPREV', type: 'nominal', format: 's1', alt: 'Distance To Previous Mutation (BP)' },
{ field: 'POS', type: 'genomic' },
{ field: 'SUBTYPE', type: 'nominal' }
],
width,
height
};
}