@@ -3,111 +3,107 @@ import { parseGeneticInput } from './OncoprinterGeneticUtils';
3
3
4
4
describe ( 'OncoprinterGeneticUtils' , ( ) => {
5
5
describe ( 'parseGeneticInput' , ( ) => {
6
- it ( 'skips header line' , ( ) => {
7
- assert . deepEqual (
8
- parseGeneticInput (
9
- 'sample gene alteration type\nsample_id TP53 FUSION FUSION\n'
10
- ) ,
11
- {
12
- parseSuccess : true ,
13
- result : [
14
- {
15
- sampleId : 'sample_id' ,
16
- hugoGeneSymbol : 'TP53' ,
17
- alteration : 'structuralVariant' ,
18
- eventInfo : 'FUSION' ,
19
- trackName : undefined ,
20
- } ,
21
- ] ,
22
- error : undefined ,
23
- }
6
+ it ( 'skips header line' , async ( ) => {
7
+ const parsed = await parseGeneticInput (
8
+ 'sample gene alteration type\nsample_id TP53 FUSION FUSION\n'
24
9
) ;
10
+ assert . deepEqual ( parsed , {
11
+ parseSuccess : true ,
12
+ result : [
13
+ {
14
+ sampleId : 'sample_id' ,
15
+ hugoGeneSymbol : 'TP53' ,
16
+ alteration : 'structuralVariant' ,
17
+ eventInfo : 'FUSION' ,
18
+ trackName : undefined ,
19
+ } ,
20
+ ] ,
21
+ error : undefined ,
22
+ } ) ;
25
23
} ) ;
26
- it ( 'parses fusion command correctly' , ( ) => {
27
- assert . deepEqual (
28
- parseGeneticInput ( 'sample_id TP53 FUSION FUSION' ) ,
29
- {
30
- parseSuccess : true ,
31
- result : [
32
- {
33
- sampleId : 'sample_id' ,
34
- hugoGeneSymbol : 'TP53' ,
35
- alteration : 'structuralVariant' ,
36
- eventInfo : 'FUSION' ,
37
- trackName : undefined ,
38
- } ,
39
- ] ,
40
- error : undefined ,
41
- }
24
+ it ( 'parses fusion command correctly' , async ( ) => {
25
+ const parsed = await parseGeneticInput (
26
+ 'sample_id TP53 FUSION FUSION'
42
27
) ;
28
+ assert . deepEqual ( parsed , {
29
+ parseSuccess : true ,
30
+ result : [
31
+ {
32
+ sampleId : 'sample_id' ,
33
+ hugoGeneSymbol : 'TP53' ,
34
+ alteration : 'structuralVariant' ,
35
+ eventInfo : 'FUSION' ,
36
+ trackName : undefined ,
37
+ } ,
38
+ ] ,
39
+ error : undefined ,
40
+ } ) ;
43
41
} ) ;
44
- it ( 'throws an error if fusion is not specified correctly' , ( ) => {
42
+ it ( 'throws an error if fusion is not specified correctly' , async ( ) => {
45
43
try {
46
- const parsed = parseGeneticInput (
44
+ const parsed = await parseGeneticInput (
47
45
'sample_id TP53 FUSION apsoidjfpaos'
48
46
) ;
49
47
assert ( false ) ;
50
48
} catch ( e ) { }
51
49
} ) ;
52
- it ( 'parses germline mutation correctly' , ( ) => {
53
- assert . deepEqual (
54
- parseGeneticInput ( 'sampleid BRCA1 Q1538A MISSENSE_GERMLINE' ) ,
55
- {
56
- parseSuccess : true ,
57
- result : [
58
- {
59
- sampleId : 'sampleid' ,
60
- hugoGeneSymbol : 'BRCA1' ,
61
- alteration : 'missense' ,
62
- proteinChange : 'Q1538A' ,
63
- isGermline : true ,
64
- trackName : undefined ,
65
- } ,
66
- ] ,
67
- error : undefined ,
68
- }
50
+ it ( 'parses germline mutation correctly' , async ( ) => {
51
+ const parsed = await parseGeneticInput (
52
+ 'sampleid BRCA1 Q1538A MISSENSE_GERMLINE'
69
53
) ;
54
+ assert . deepEqual ( parsed , {
55
+ parseSuccess : true ,
56
+ result : [
57
+ {
58
+ sampleId : 'sampleid' ,
59
+ hugoGeneSymbol : 'BRCA1' ,
60
+ alteration : 'missense' ,
61
+ proteinChange : 'Q1538A' ,
62
+ isGermline : true ,
63
+ trackName : undefined ,
64
+ } ,
65
+ ] ,
66
+ error : undefined ,
67
+ } ) ;
70
68
} ) ;
71
- it ( 'parses driver mutation correctly' , ( ) => {
72
- assert . deepEqual (
73
- parseGeneticInput ( 'sampleid BRCA1 Q1538A TRUNC_DRIVER' ) ,
74
- {
75
- parseSuccess : true ,
76
- result : [
77
- {
78
- sampleId : 'sampleid' ,
79
- hugoGeneSymbol : 'BRCA1' ,
80
- alteration : 'trunc' ,
81
- proteinChange : 'Q1538A' ,
82
- isCustomDriver : true ,
83
- trackName : undefined ,
84
- } ,
85
- ] ,
86
- error : undefined ,
87
- }
69
+ it ( 'parses driver mutation correctly' , async ( ) => {
70
+ const parsed = await parseGeneticInput (
71
+ 'sampleid BRCA1 Q1538A TRUNC_DRIVER'
88
72
) ;
73
+ assert . deepEqual ( parsed , {
74
+ parseSuccess : true ,
75
+ result : [
76
+ {
77
+ sampleId : 'sampleid' ,
78
+ hugoGeneSymbol : 'BRCA1' ,
79
+ alteration : 'trunc' ,
80
+ proteinChange : 'Q1538A' ,
81
+ isCustomDriver : true ,
82
+ trackName : undefined ,
83
+ } ,
84
+ ] ,
85
+ error : undefined ,
86
+ } ) ;
89
87
} ) ;
90
- it ( 'parses germline & driver mutation correctly' , ( ) => {
91
- assert . deepEqual (
92
- parseGeneticInput (
93
- 'sampleid BRCA1 Q1538A MISSENSE_GERMLINE_DRIVER'
94
- ) ,
95
- {
96
- parseSuccess : true ,
97
- result : [
98
- {
99
- sampleId : 'sampleid' ,
100
- hugoGeneSymbol : 'BRCA1' ,
101
- alteration : 'missense' ,
102
- proteinChange : 'Q1538A' ,
103
- isGermline : true ,
104
- isCustomDriver : true ,
105
- trackName : undefined ,
106
- } ,
107
- ] ,
108
- error : undefined ,
109
- }
88
+ it ( 'parses germline & driver mutation correctly' , async ( ) => {
89
+ const parsed = await parseGeneticInput (
90
+ 'sampleid BRCA1 Q1538A MISSENSE_GERMLINE_DRIVER'
110
91
) ;
92
+ assert . deepEqual ( parsed , {
93
+ parseSuccess : true ,
94
+ result : [
95
+ {
96
+ sampleId : 'sampleid' ,
97
+ hugoGeneSymbol : 'BRCA1' ,
98
+ alteration : 'missense' ,
99
+ proteinChange : 'Q1538A' ,
100
+ isGermline : true ,
101
+ isCustomDriver : true ,
102
+ trackName : undefined ,
103
+ } ,
104
+ ] ,
105
+ error : undefined ,
106
+ } ) ;
111
107
} ) ;
112
108
it ( 'throws an error for an invalid mutation modifier' , ( ) => {
113
109
try {
@@ -117,27 +113,25 @@ describe('OncoprinterGeneticUtils', () => {
117
113
assert ( false ) ;
118
114
} catch ( e ) { }
119
115
} ) ;
120
- it ( 'parses a line with a given track name correctly' , ( ) => {
121
- assert . deepEqual (
122
- parseGeneticInput (
123
- 'sampleid BRCA1 Q1538A MISSENSE_GERMLINE_DRIVER testTrackName'
124
- ) ,
125
- {
126
- parseSuccess : true ,
127
- result : [
128
- {
129
- sampleId : 'sampleid' ,
130
- hugoGeneSymbol : 'BRCA1' ,
131
- alteration : 'missense' ,
132
- proteinChange : 'Q1538A' ,
133
- isGermline : true ,
134
- isCustomDriver : true ,
135
- trackName : 'testTrackName' ,
136
- } ,
137
- ] ,
138
- error : undefined ,
139
- }
116
+ it ( 'parses a line with a given track name correctly' , async ( ) => {
117
+ const parsed = await parseGeneticInput (
118
+ 'sampleid BRCA1 Q1538A MISSENSE_GERMLINE_DRIVER testTrackName'
140
119
) ;
120
+ assert . deepEqual ( parsed , {
121
+ parseSuccess : true ,
122
+ result : [
123
+ {
124
+ sampleId : 'sampleid' ,
125
+ hugoGeneSymbol : 'BRCA1' ,
126
+ alteration : 'missense' ,
127
+ proteinChange : 'Q1538A' ,
128
+ isGermline : true ,
129
+ isCustomDriver : true ,
130
+ trackName : 'testTrackName' ,
131
+ } ,
132
+ ] ,
133
+ error : undefined ,
134
+ } ) ;
141
135
} ) ;
142
136
} ) ;
143
137
} ) ;
0 commit comments