-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdisease-contributions.js
63 lines (60 loc) · 1.76 KB
/
disease-contributions.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
58
59
60
61
62
63
import React from 'react';
import { Component } from 'react';
import Chart from 'react-google-charts';
export class DiseaseContributions extends Component {
// display component
render() {
if (!this.props.disease || !this.props.diseasePrediction)
return <></>;
const geneName = (this.props.diseasePrediction || {}).gene_symbol || '';
const diseaseName = (this.props.disease || {}).disease_name || '';
return (
<div
className='app_section'
style={{ display: this.props.visible ? 'block' : 'none' }}
>
<hr />
<p className='left'>
Contributions for{' '}
<b>
<i>{geneName}</i>
</b>
</p>
<p className='small light left'>
This chart shows the contribution of each feature towards the overall
prediction, where the contribution equals the feature coefficient from
the logistic ridge regression model times the feature value computed
between the selected gene and disease.
</p>
<Chart
chartType='BarChart'
width='100%'
height='500px'
data={this.props.contributions}
options={{
legend: 'none',
backgroundColor: 'none',
colors: ['#02b3e4'],
title:
'Components of the predicted association between ' +
diseaseName +
' and ' +
geneName,
hAxis: {
title: 'Contribution'
},
vAxis: {
title: 'Feature'
},
chartArea: {
left: '20%',
top: '50',
width: '80%',
height: '400'
}
}}
/>
</div>
);
}
}