Skip to content

Commit

Permalink
add external links (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincerubinetti authored Aug 12, 2019
1 parent 4fc3a79 commit 8b0aadd
Show file tree
Hide file tree
Showing 6 changed files with 225 additions and 15 deletions.
7 changes: 6 additions & 1 deletion src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,9 @@ td.left > .dynamic_field {
width: 50%;
height: 100%;
margin: 0;
}
}
.external_link_icon {
position: relative;
top: -1px;
margin-left: 5px;
}
32 changes: 30 additions & 2 deletions src/disease-info.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react';
import { Component } from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons';

import { toFixed } from 'hetio-frontend-components';
import { InfoTable } from 'hetio-frontend-components';
Expand All @@ -16,8 +18,34 @@ export class DiseaseInfo extends Component {
const name = disease.disease_name;
const info = (this.props.diseaseInfo || {}).xref || {};
const bodyContents = [
['Dis. Ont. id', tooltipText['disease_id'], disease.disease_code],
['EFO id', tooltipText['disease_efo_id'], info.EFO],
[
'Dis. Ont. id',
tooltipText['disease_id'],
<a href={'http://www.disease-ontology.org/?id=' + disease.disease_code}>
{disease.disease_code}
<FontAwesomeIcon
className='external_link_icon'
icon={faExternalLinkAlt}
size='xs'
/>
</a>
],
[
'EFO id',
tooltipText['disease_efo_id'],
<a
href={
'https://www.ebi.ac.uk/ols/ontologies/EFO/terms?obo_id=EFO:' + info.EFO
}
>
{info.EFO}
<FontAwesomeIcon
className='external_link_icon'
icon={faExternalLinkAlt}
size='xs'
/>
</a>
],
['UMLS id', tooltipText['disease_umls_id'], info.UMLS_CUI],
[
'pathophysiology',
Expand Down
65 changes: 61 additions & 4 deletions src/disease-prediction-info.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react';
import { Component } from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons';

import { toFixed } from 'hetio-frontend-components';
import { InfoTable } from 'hetio-frontend-components';
Expand All @@ -21,10 +23,65 @@ export class DiseasePredictionInfo extends Component {
tooltipText['gene_aliases'],
info.aliases && info.aliases.length ? info.aliases.join(', ') : ''
],
['HGNC id', tooltipText['gene_id'], diseasePrediction.gene_code],
['Entrez id', tooltipText['gene_entrez_id'], info.entrez],
['Ensembl id', tooltipText['gene_ensembl_id'], info.ensembl],
['Uniprot id', tooltipText['gene_uniprot_id'], info.uniprot],
[
'HGNC id',
tooltipText['gene_id'],

<a
href={
'https://www.genenames.org/data/gene-symbol-report/#!/hgnc_id/' +
diseasePrediction.gene_code
}
>
{diseasePrediction.gene_code}
<FontAwesomeIcon
className='external_link_icon'
icon={faExternalLinkAlt}
size='xs'
/>
</a>
],
[
'Entrez id',
tooltipText['gene_entrez_id'],
<a href={'https://www.ncbi.nlm.nih.gov/gene/' + info.entrez}>
{info.entrez}
<FontAwesomeIcon
className='external_link_icon'
icon={faExternalLinkAlt}
size='xs'
/>
</a>
],
[
'Ensembl id',
tooltipText['gene_ensembl_id'],
<a
href={
'http://useast.ensembl.org/Homo_sapiens/Gene/Summary?g=' +
info.ensembl
}
>
{info.ensembl}
<FontAwesomeIcon
className='external_link_icon'
icon={faExternalLinkAlt}
size='xs'
/>
</a>
],
[
'Uniprot id',
tooltipText['gene_uniprot_id'],
<a href={'https://www.uniprot.org/uniprot/' + info.uniprot}>
{info.uniprot}
<FontAwesomeIcon
className='external_link_icon'
icon={faExternalLinkAlt}
size='xs'
/>
</a>
],
['status', tooltipText['gene_status'], diseasePrediction.status],
[
'other assoc',
Expand Down
34 changes: 32 additions & 2 deletions src/feature-prediction-info.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react';
import { Component } from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons';

import { toFixed } from 'hetio-frontend-components';
import { InfoTable } from 'hetio-frontend-components';
Expand All @@ -19,9 +21,37 @@ export class FeaturePredictionInfo extends Component {
[
'Dis. Ont. id',
tooltipText['disease_id'],
featurePrediction.disease_code
<a
href={
'http://www.disease-ontology.org/?id=' +
featurePrediction.disease_code
}
>
{featurePrediction.disease_code}
<FontAwesomeIcon
className='external_link_icon'
icon={faExternalLinkAlt}
size='xs'
/>
</a>
],
[
'EFO id',
tooltipText['disease_efo_id'],
<a
href={
'https://www.ebi.ac.uk/ols/ontologies/EFO/terms?obo_id=EFO:' +
info.EFO
}
>
{info.EFO}
<FontAwesomeIcon
className='external_link_icon'
icon={faExternalLinkAlt}
size='xs'
/>
</a>
],
['EFO id', tooltipText['disease_efo_id'], info.EFO],
['UMLS id', tooltipText['disease_umls_id'], info.UMLS_CUI],
[
'pathophysiology',
Expand Down
65 changes: 61 additions & 4 deletions src/gene-info.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react';
import { Component } from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons';

import { toFixed } from 'hetio-frontend-components';
import { InfoTable } from 'hetio-frontend-components';
Expand All @@ -21,10 +23,65 @@ export class GeneInfo extends Component {
tooltipText['gene_aliases'],
info.aliases && info.aliases.length ? info.aliases.join(', ') : ''
],
['HGNC id', tooltipText['gene_id'], gene.gene_code],
['Entrez id', tooltipText['gene_entrez_id'], info.entrez],
['Ensembl id', tooltipText['gene_ensembl_id'], info.ensembl],
['Uniprot id', tooltipText['gene_uniprot_id'], info.uniprot],
[
'HGNC id',
tooltipText['gene_id'],

<a
href={
'https://www.genenames.org/data/gene-symbol-report/#!/hgnc_id/' +
gene.gene_code
}
>
{gene.gene_code}
<FontAwesomeIcon
className='external_link_icon'
icon={faExternalLinkAlt}
size='xs'
/>
</a>
],
[
'Entrez id',
tooltipText['gene_entrez_id'],
<a href={'https://www.ncbi.nlm.nih.gov/gene/' + info.entrez}>
{info.entrez}
<FontAwesomeIcon
className='external_link_icon'
icon={faExternalLinkAlt}
size='xs'
/>
</a>
],
[
'Ensembl id',
tooltipText['gene_ensembl_id'],
<a
href={
'http://useast.ensembl.org/Homo_sapiens/Gene/Summary?g=' +
info.ensembl
}
>
{info.ensembl}
<FontAwesomeIcon
className='external_link_icon'
icon={faExternalLinkAlt}
size='xs'
/>
</a>
],
[
'Uniprot id',
tooltipText['gene_uniprot_id'],
<a href={'https://www.uniprot.org/uniprot/' + info.uniprot}>
{info.uniprot}
<FontAwesomeIcon
className='external_link_icon'
icon={faExternalLinkAlt}
size='xs'
/>
</a>
],
['associations', tooltipText['gene_associations'], gene.associations],
[
'mean prediction',
Expand Down
37 changes: 35 additions & 2 deletions src/gene-prediction-info.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react';
import { Component } from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons';

import { toFixed } from 'hetio-frontend-components';
import { InfoTable } from 'hetio-frontend-components';
Expand All @@ -16,8 +18,39 @@ export class GenePredictionInfo extends Component {
const name = genePrediction.disease_name;
const info = (this.props.genePredictionInfo || {}).xref || {};
const bodyContents = [
['Dis. Ont. id', tooltipText['disease_id'], genePrediction.disease_code],
['EFO id', tooltipText['disease_efo_id'], info.EFO],
[
'Dis. Ont. id',
tooltipText['disease_id'],
<a
href={
'http://www.disease-ontology.org/?id=' + genePrediction.disease_code
}
>
{genePrediction.disease_code}
<FontAwesomeIcon
className='external_link_icon'
icon={faExternalLinkAlt}
size='xs'
/>
</a>
],
[
'EFO id',
tooltipText['disease_efo_id'],
<a
href={
'https://www.ebi.ac.uk/ols/ontologies/EFO/terms?obo_id=EFO:' +
info.EFO
}
>
{info.EFO}
<FontAwesomeIcon
className='external_link_icon'
icon={faExternalLinkAlt}
size='xs'
/>
</a>
],
['UMLS id', tooltipText['disease_umls_id'], info.UMLS_CUI],
[
'pathophysiology',
Expand Down

0 comments on commit 8b0aadd

Please sign in to comment.