-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathoncokb.test.js
57 lines (47 loc) · 1.69 KB
/
oncokb.test.js
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const { parseVariantName } = require('../src/oncokb');
describe('oncokb', () => {
describe('parseVariantName', () => {
test.todo('parses exon mutations');
test.todo('kinase domain duplication');
test.todo('amplification');
test.todo('wildtype');
test('adds p prefix for protein changes', () => {
const parsed = parseVariantName('V600_K601insFGLAT', { reference1: 'braf' });
expect(parsed).toEqual({
type: 'p.v600_k601insfglat',
});
});
test('fusion', () => {
const parsed = parseVariantName('BCR-ABL1 Fusion');
expect(parsed).toEqual({
flipped: false,
reference2: 'abl1',
type: 'fusion',
});
});
test('fusion with gene given', () => {
const parsed = parseVariantName('BCR-ABL1 Fusion', { reference1: 'ABL1' });
expect(parsed).toEqual({
flipped: true,
reference2: 'bcr',
type: 'fusion',
});
});
test('case insensitive fusion parsing', () => {
const parsed = parseVariantName('RAD51C-ATXN7', { reference1: 'atxn7' });
expect(parsed).toEqual({
flipped: true,
reference2: 'rad51c',
type: 'fusion',
});
});
test('unicode dash character', () => {
const parsed = parseVariantName('GOPC–ROS1 Fusion', { reference1: 'ros1' });
expect(parsed).toEqual({
flipped: true,
reference2: 'gopc',
type: 'fusion',
});
});
});
});