-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcoverage.ts
35 lines (34 loc) · 1.01 KB
/
coverage.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
import { SingleTrack } from 'gosling.js/dist/src/core/gosling.schema';
import { SpecOption } from '../main-spec';
export default function coverage(option: SpecOption, isLeft: boolean): Partial<SingleTrack> {
const { id, bam, bai, width, svReads, crossChr, bpIntervals } = option;
return {
id: `${id}-bottom-${isLeft ? 'left' : 'right'}-coverage`,
title: 'Coverage',
data: {
type: 'bam',
url: bam,
indexUrl: bai
},
dataTransform: [
{
type: 'coverage',
startField: 'start',
endField: 'end'
}
],
mark: 'bar',
x: { field: 'start', type: 'genomic' },
xe: { field: 'end', type: 'genomic' },
y: {
field: 'coverage',
type: 'quantitative',
axis: 'right',
grid: true
},
color: { value: 'lightgray' },
stroke: { value: 'gray' },
width,
height: 80
};
}