Skip to content

Commit

Permalink
fixed the download links and geneontology/go-site#2430
Browse files Browse the repository at this point in the history
  • Loading branch information
tmushayahama committed Feb 4, 2025
1 parent ee47ea9 commit b37df26
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 18 deletions.
12 changes: 11 additions & 1 deletion site-react/src/@pango.core/data/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,15 @@ export const ENVIRONMENT = {

uniprotUrl: 'https://www.uniprot.org/uniprotkb/',
agrPrefixUrl: 'https://www.alliancegenome.org/gene/',
hgncPrefixUrl: 'https://www.genenames.org/data/gene-symbol-report/#!/hgnc_id/'
hgncPrefixUrl: 'https://www.genenames.org/data/gene-symbol-report/#!/hgnc_id/',
ncbiGeneUrl: 'https://www.ncbi.nlm.nih.gov/gene/?term=',
pantreeUrl: 'https://pantree.org/tree/family.jsp?accession=',


// Downloads
downloadAllDataCSVUrl: "https://functionome.org/download/export_annotations.zip",
downloadAllDataJSONUrl: "https://functionome.org/download/export_annotations.json.gz",
downloadAnnotationsGAFUrl: "http://data.pantherdb.org/ftp/downloads/paint/pango/",
downloadEvolutionaryModelsGAFUrl: "http://data.pantherdb.org/ftp/downloads/paint/pango/IBD.gaf"

};
2 changes: 1 addition & 1 deletion site-react/src/@pango.core/services/linksService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const getUniprotLink = (gene: string) => {
if (!gene) return ENVIRONMENT.uniprotUrl;

const geneId = gene.split(':');
return geneId.length > 1 ? `${ENVIRONMENT.uniprotUrl}${geneId[1]}` : ENVIRONMENT.uniprotUrl;
return geneId.length > 1 ? ENVIRONMENT.uniprotUrl + geneId[1] : ENVIRONMENT.uniprotUrl;
};

export const getFamilyLink = (element: Annotation) => {
Expand Down
22 changes: 14 additions & 8 deletions site-react/src/app/Gene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,7 @@ const Gene: React.FC = () => {

const knownTermTypes = annotations.filter(a => a.termType === TermType.KNOWN).length;
const unknownTermTypes = annotations.filter(a => a.termType === TermType.UNKNOWN).length;

const groupedTerms = transformTerms(annotations, 100);


const groupedTerms = transformTerms(annotations, 150);

return (
<div className="w-full bg-slate-200">
Expand All @@ -110,10 +107,8 @@ const Gene: React.FC = () => {
<InfoRow
label="GO annotations from all sources"
value={annotation.gene}
href={`${ENVIRONMENT.amigoGPUrl}${annotation.gene}`}
href={ENVIRONMENT.amigoGPUrl + annotation.gene}
/>


</div>
</div>

Expand Down Expand Up @@ -154,6 +149,11 @@ const Gene: React.FC = () => {
/>
</>
)}
<InfoRow
label="NCBI Gene"
value={annotation.geneSymbol}
href={ENVIRONMENT.ncbiGeneUrl + annotation.geneSymbol}
/>
</div>
</div>
</div>
Expand Down Expand Up @@ -184,7 +184,13 @@ const Gene: React.FC = () => {
</div>
)}
<div className="py-6 px-4 bg-gradient-to-r from-slate-100 to-white">
<h2 className="text-2xl font-semibold tracking-tight m-0">Function Details</h2>
<h2 className="text-2xl font-semibold tracking-tight m-0">Function Details (
<a href={ENVIRONMENT.pantreeUrl + annotation.pantherFamily}
target="_blank" rel="noopener noreferrer"
className="text-lg font-normal">
PAN-GO evolutionary model for this family
</a>)
</h2>
</div>
{annotations.length > 0 && (
<div className="w-full bg-white py-4">
Expand Down
16 changes: 11 additions & 5 deletions site-react/src/app/layout/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Link } from 'react-router-dom';
import { useAppDispatch } from '../hooks';
import { toggleLeftDrawer } from '@/@pango.core/components/drawer/drawerSlice';
import { VersionedLink } from '@/shared/components/VersionedLink';
import { ENVIRONMENT } from '@/@pango.core/data/constants';

interface ToolbarProps {
showLoadingBar?: boolean;
Expand Down Expand Up @@ -75,14 +76,19 @@ const Toolbar: React.FC<ToolbarProps> = ({ showLoadingBar }) => {
open={Boolean(exportMenuAnchor)}
onClose={handleCloseExportMenu}
>
<MenuItem component="a" href="https://functionome.org/download/export_annotations.zip">
As CSV
<MenuItem component="a" href={ENVIRONMENT.downloadAllDataCSVUrl}>
All data as CSV
</MenuItem>
<MenuItem component="a" href="https://functionome.org/download/export_annotations.json.gz">
As JSON
<MenuItem component="a" href={ENVIRONMENT.downloadAllDataJSONUrl}>
All data as JSON
</MenuItem>
<MenuItem component="a" href={ENVIRONMENT.downloadAnnotationsGAFUrl}>
Annotations as GAF
</MenuItem>
<MenuItem component="a" href={ENVIRONMENT.downloadEvolutionaryModelsGAFUrl} target='_blank' rel='noopener noreferrer'>
Evolutionary models as GAF
</MenuItem>
</Menu>

<Button
color="inherit"
component={Link}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const AnnotationTable: React.FC<AnnotationTableProps> = ({
const getPubmedArticleUrl = (pmid: string): string => {
if (!pmid) return '';
const id = pmid?.split(':');
return id.length > 0 ? `${ENVIRONMENT.pubmedUrl}${id[1]}` : '';
return id.length > 0 ? ENVIRONMENT.pubmedUrl + id[1] : '';
};

return (
Expand Down Expand Up @@ -122,7 +122,7 @@ const AnnotationTable: React.FC<AnnotationTableProps> = ({
{evidence.withGeneId && (
<div className="text-sm mb-1">
{evidence.withGeneId.gene} ({evidence.withGeneId.geneSymbol})
(<a href={`${ENVIRONMENT.taxonApiUrl}${evidence.withGeneId.taxonId}`} target="_blank" rel="noopener noreferrer"
(<a href={ENVIRONMENT.taxonApiUrl + evidence.withGeneId.taxonId} target="_blank" rel="noopener noreferrer"
className="">
{evidence.withGeneId.taxonAbbr}
</a>)
Expand Down
4 changes: 3 additions & 1 deletion site-react/src/features/terms/components/TermLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ interface TermLinkProps {

const TermLink: React.FC<TermLinkProps> = ({ term }) => {
return term.displayId ? (
<a href={`${ENVIRONMENT.amigoTermUrl}${term.id}`} target="_blank" rel="noopener noreferrer" className="no-underline">
<a href={ENVIRONMENT.amigoTermUrl + term.id}
target="_blank"
rel="noopener noreferrer" className="no-underline">
{term.label}
</a>
) : (
Expand Down

0 comments on commit b37df26

Please sign in to comment.