@@ -38,48 +38,92 @@ const getDataTitle = (date: string, version: string) => {
38
38
return `${ getNewsTitle ( date ) } (${ version } )` ;
39
39
} ;
40
40
41
+ function getMajorVersion ( versionString : string ) : number | undefined {
42
+ const match = versionString . match ( / ^ v ( \d + ) \. / ) ;
43
+
44
+ return match ? parseInt ( match [ 1 ] , 10 ) : undefined ;
45
+ }
46
+ function getMinorVersion ( versionString : string ) : number | undefined {
47
+ const match = versionString . match ( / ^ v ( \d + ) \. ( \d + ) / ) ;
48
+
49
+ return match ? parseInt ( match [ 2 ] , 10 ) : undefined ;
50
+ }
51
+
41
52
const BUTTON_CLASS_NAME = 'mr-2 my-1' ;
42
53
const DownloadButtonGroups : React . FunctionComponent < {
43
54
data : DownloadAvailabilityWithDate ;
44
55
} > = props => {
56
+ const majorVersion = getMajorVersion ( props . data . version ) ?? 0 ;
57
+ const minorVersion = getMinorVersion ( props . data . version ) ?? 0 ;
58
+ const versionIsLessThan4 = majorVersion < 4 ;
45
59
return (
46
60
< >
47
61
{ props . data . hasAllCuratedGenes ? (
48
62
< AuthDownloadButton
49
63
className = { BUTTON_CLASS_NAME }
50
64
fileName = { `all_curated_genes_${ props . data . version } .tsv` }
51
- getDownloadData = { ( ) =>
52
- oncokbClient . utilsAllCuratedGenesTxtGetUsingGET ( {
65
+ getDownloadData = { ( ) => {
66
+ return oncokbClient . utilsAllCuratedGenesTxtGetUsingGET ( {
53
67
version : props . data . version ,
54
- } )
55
- }
68
+ } ) ;
69
+ } }
56
70
buttonText = "All Curated Genes"
57
71
/>
58
72
) : null }
59
73
{ props . data . hasCancerGeneList ? (
60
74
< AuthDownloadButton
61
75
className = { BUTTON_CLASS_NAME }
62
76
fileName = { `cancer_gene_list_${ props . data . version } .tsv` }
63
- getDownloadData = { ( ) =>
64
- oncokbClient . utilsCancerGeneListTxtGetUsingGET ( {
77
+ getDownloadData = { ( ) => {
78
+ return oncokbClient . utilsCancerGeneListTxtGetUsingGET ( {
65
79
version : props . data . version ,
66
- } )
67
- }
80
+ } ) ;
81
+ } }
68
82
buttonText = "Cancer Gene List"
69
83
/>
70
84
) : null }
71
85
{ props . data . hasAllActionableVariants ? (
72
- < AuthDownloadButton
73
- className = { BUTTON_CLASS_NAME }
74
- fileName = { `oncokb_${ props . data . version . replace ( '.' , '_' ) } .sql.gz` }
75
- getDownloadData = { async ( ) => {
76
- const data = await oncokbPrivateClient . utilDataSqlDumpGetUsingGET ( {
77
- version : props . data . version ,
78
- } ) ;
79
- return data ;
80
- } }
81
- buttonText = "Data Dump"
82
- />
86
+ < >
87
+ < AuthDownloadButton
88
+ className = { BUTTON_CLASS_NAME }
89
+ fileName = { `oncokb_${ props . data . version . replace ( '.' , '_' ) } .sql.gz` }
90
+ getDownloadData = { async ( ) => {
91
+ const data = await oncokbPrivateClient . utilDataSqlDumpGetUsingGET (
92
+ {
93
+ version : props . data . version ,
94
+ }
95
+ ) ;
96
+ return data ;
97
+ } }
98
+ buttonText = "Data Dump"
99
+ />
100
+ < AuthDownloadButton
101
+ disabled = { versionIsLessThan4 }
102
+ title = {
103
+ versionIsLessThan4
104
+ ? 'Not available for versions below 4.0'
105
+ : undefined
106
+ }
107
+ className = { BUTTON_CLASS_NAME }
108
+ fileName = { `oncokb_transcript_${ props . data . version . replace (
109
+ '.' ,
110
+ '_'
111
+ ) } .sql.gz`}
112
+ getDownloadData = { async ( ) => {
113
+ const version =
114
+ majorVersion === 4 && minorVersion < 23
115
+ ? 'v4.23'
116
+ : props . data . version ;
117
+ const data = await oncokbPrivateClient . utilDataTranscriptSqlDumpUsingGET (
118
+ {
119
+ version,
120
+ }
121
+ ) ;
122
+ return data ;
123
+ } }
124
+ buttonText = "Transcript Data"
125
+ />
126
+ </ >
83
127
) : null }
84
128
</ >
85
129
) ;
@@ -224,6 +268,12 @@ export default class APIAccessPage extends React.Component<{
224
268
) }
225
269
, the latest
226
270
</ h6 >
271
+ < p className = "rounded" >
272
+ The transcript database serves OncoKB metadata
273
+ included gene, transcript, sequence, etc. Only
274
+ required for local installations that will utilize the
275
+ /byGenomicChange and /byHGVSg endpoints
276
+ </ p >
227
277
< DownloadButtonGroups
228
278
data = { this . dataAvailability . result [ 0 ] }
229
279
/>
0 commit comments