Skip to content

Commit

Permalink
PV ftp download
Browse files Browse the repository at this point in the history
  • Loading branch information
prabh-t committed May 28, 2024
1 parent 6d80b7b commit dc2ad02
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 57 deletions.
18 changes: 9 additions & 9 deletions public/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Clicking each category in the contents below will take you to an annotated image
- [Population Observations](#population-observations)
- [Structure Annotations](#structure-annotations)
- [Download Options](#download-options)
- [My Downloads](#my-downloads)
- [Downloads](#downloads)


###### <a name="home-page"></a>Home Page
Expand All @@ -26,7 +26,7 @@ Clicking each category in the contents below will take you to an annotated image
**A.** ProtVar retrieves annotations and predictions for human [missense](#missense) variants.
**B.** Users can submit a new search by pressing here and returning to the home screen.
**C.** The [results page](#results-page) page following variant list submission.
**D.** [My downloads](#my-downloads) contains all the files you have submitted for download. These can be downloaded from here to your local computer.
**D.** [Downloads](#downloads) contains all the files you have submitted for download. These can be downloaded from here to your local computer.
**E.** This can be used to [contact](#contact) ProtVar with questions, comments or suggestions.
**F.** [ProtVar REST API](#protvar-rest-api) can be used to obtain data programmatically.
**G.** The Help section in ProtVar contains information about the options and fields available in the user interface and a description of the columns in the download.
Expand All @@ -41,10 +41,10 @@ Clicking each category in the contents below will take you to an annotated image
###### <a name="results-page"></a>Results Page

![ProtVar Results Page](images/v1.2/results_page.png)
**A.** [My downloads](#my-downloads) A. My downloads contains all the files you have submitted for download. These can be downloaded from here to your local computer. Users can return to the same results again by clicking the 'Results' tab. The results will remain during the users session or until they are replaced by new results.
**A.** [Downloads](#downloads) A. My downloads contains all the files you have submitted for download. These can be downloaded from here to your local computer. Users can return to the same results again by clicking the 'Results' tab. The results will remain during the users session or until they are replaced by new results.
**B.** Navigate to the previous or next page of results and choose how many results to display on the page.
**C.** The legend shows the colour schemes and category boundaries for scores and predictions. The colours can be switched between ProtVar standardised colours and the original colours.
**D.** Download all variant results. The file will be available in [My downloads](#my-downloads)
**D.** Download all variant results. The file will be available in [Downloads](#downloads)
**E.** The data is split into [genomic position](#genomic-position) and [protein position](#protein-position) and [annotations](#annotations)
**F.** The types and number of user inputs and processing by ProtVar is shown here.
**G.** The [data type](#data-types) used to submit the variant is shown in pink. Multiple lines may be shown for a single input in cases such as overlapping genes or when the specific SNP is ambiguous.
Expand Down Expand Up @@ -120,12 +120,12 @@ Clicking each category in the contents below will take you to an annotated image
**B.** - Users can choose which specific fields are most useful to them.
**C.** - Email addresses are optional and are used to notify users when their job is ready.
**D.** - Job names are optional but can help users to identify specific jobs when multiple jobs have been submitted.
**E.** - Pressing submit will put the job in a queue. The results will be available from the [My Downloads](#my-downloads) tab.
**E.** - Pressing submit will put the job in a queue. The results will be available from the [Downloads](#downloads) tab.
**F.** - Close to return to the results page

###### <a name="my-downloads"></a>My Downloads
###### <a name="downloads"></a>Downloads

![ProtVar My Downloads](images/my_downloads.png)
![ProtVar Downloads](images/downloads.png)
**A.** - All of the user's downloads for this session will be displayed on this page.
**B.** - The number of downloads for this session.
**C.** - A date and time stamp when the download request was received.
Expand Down Expand Up @@ -163,7 +163,7 @@ ProtVar will evaluate each one and map them to the protein position in a unified
Because dbSNP IDs may represent more than one variant allele, ProtVar will separate the different variant alleles onto different lines on the mapping page. This is because the different variant alleles may have different consequences to the protein

<a name="download"></a>**Download:** Downloads can be tailored according to the users’ needs. If only mappings from genomic coordinates to protein positions are required then “mappings only” can be used. If specific annotations are required then these can be selected individually. Each annotation category selected adds extra time to produce the downloadable file. Files ready for download are displayed in the "My Downloads” section. Optionally users can add a job name to keep track of multiple jobs and an email address so that they can be informed when the file is ready to be downloaded. All of the annotations in the download file can also be accessed programmatically via the ProtVar REST API.
<a name="download"></a>**Download:** Downloads can be tailored according to the users’ needs. If only mappings from genomic coordinates to protein positions are required then “mappings only” can be used. If specific annotations are required then these can be selected individually. Each annotation category selected adds extra time to produce the downloadable file. Files ready for download are displayed in the "Downloads” section. Optionally users can add a job name to keep track of multiple jobs and an email address so that they can be informed when the file is ready to be downloaded. All of the annotations in the download file can also be accessed programmatically via the ProtVar REST API.

<a name="ensembl-identifiers"></a>**Ensembl identifiers:** The ENSG (Ensembl gene identifiers), ENSP (Ensembl translated sequence identifiers) and ENST (Ensembl transcript identifiers) are given for each isoform. The identifiers in the "Function Annotation" section correspond to those associated with the UniProt canonical isoform. More information about Ensembl stable IDs can be found here: [Ensembl website](http://www.ensembl.org/info/genome/stable_ids/index.html)

Expand Down Expand Up @@ -194,7 +194,7 @@ Futher details about the HGVS format can be found on the [HGVS website](https://

<a name="missense"></a>**Missense:** ProtVar retrieves annotations and predictions for the evaluation of missense mutations. Missense mutations are single nucleotide changes which result in a codon which encodes a different amino acid to the reference sequence. Synonymous mutations are also handled by ProtVar where a point mutation does not alter the encoded amino acid.

<a name="my-downloads"></a>**My Downloads:** This page contains all the jobs sent for download for this browser session. This means that if you submit several different variant sets you will see a list of jobs here. From this page you can see the status of jobs to check if they are ready. When they are, the files can be downloaded to your local machine.
<a name="downloads"></a>**Downloads:** This page contains all the jobs sent for download for this browser session. This means that if you submit several different variant sets you will see a list of jobs here. From this page you can see the status of jobs to check if they are ready. When they are, the files can be downloaded to your local machine.

<a name="paste"></a>**Paste:** Several thousand variants can be pasted into the box (for longer lists please upload a file).

Expand Down
File renamed without changes
3 changes: 2 additions & 1 deletion src/constants/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export const DOWNLOAD_STATUS=`${API_URL}/download/status`;
export const LOCAL_DOWNLOADS='PV_downloads';
export const DISMISS_BANNER = 'PV_banner';
export const SUBSCRIPTION_STATUS = 'PV_subscribed';
export const TITLE='EMBL-EBI ProtVar - Contextualising human missense variation'
export const TITLE='EMBL-EBI ProtVar - Contextualising human missense variation'
export const PV_FTP = 'https://ftp.ebi.ac.uk/pub/databases/ProtVar'
2 changes: 1 addition & 1 deletion src/ui/layout/DefaultPageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const DefaultPageContent = (props: {
}
</li>
<li className="sidebar-menu">
<NavLink to={DOWNLOAD}>My Downloads ({downloadCount})</NavLink>
<NavLink to={DOWNLOAD}>Downloads ({downloadCount})</NavLink>
</li>
</ul>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/modal/DownloadModalHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function processDownload(formData: FormData, functional: boolean, populat
const handleSucc = (downloadRes: DownloadResponse) => {
let localDownloads = JSON.parse(localStorage.getItem(LOCAL_DOWNLOADS) || "[]")
localStorage.setItem(LOCAL_DOWNLOADS, JSON.stringify([...localDownloads, downloadRes]));
Notify.sucs(`Job ${downloadRes.downloadId} submitted. Check My Downloads page. `)
Notify.sucs(`Job ${downloadRes.downloadId} submitted. Check the Downloads page. `)
}

const handleErr = () => {
Expand Down
97 changes: 52 additions & 45 deletions src/ui/pages/download/DownloadPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import DefaultPageLayout from "../../layout/DefaultPageLayout";
import React, {useEffect, useState} from "react";
import "./DownloadPage.css";
import {getDownloadStatus} from "../../../services/ProtVarService";
import {LOCAL_DOWNLOADS, TITLE} from "../../../constants/const"
import {LOCAL_DOWNLOADS, PV_FTP, TITLE} from "../../../constants/const"
//import { v4 as uuidv4 } from 'uuid';
import {DownloadResponse} from "../../../types/DownloadResponse";
import Notify from "../../elements/Notify";
Expand All @@ -29,7 +29,7 @@ function DownloadPageContent() {
const [downloads, setDownloads] = useState<DownloadResponse[]>(localDownloads)

useEffect(() => {
document.title = 'My Downloads - ' + TITLE;
document.title = 'Downloads - ' + TITLE;
let ds: DownloadResponse[] = JSON.parse(localStorage.getItem(LOCAL_DOWNLOADS) || "[]")
const ids = ds.map(d => d.downloadId)
getDownloadStatus(ids)
Expand All @@ -49,60 +49,67 @@ function DownloadPageContent() {
localStorage.setItem(LOCAL_DOWNLOADS, JSON.stringify(downloads));
}, [downloads])

if (!downloads.length) {
return (<strong className="padding-left-1x">There have been no downloads.</strong>)
}

return <div className="container">
<strong>{downloads.length} download{downloads.length > 1 ? 's' : ''}</strong>

{/**
<h6>FTP download</h6>
<p>
<button type="button" className="btn btn-primary btn-sm" onClick={() => setDownloads([...downloads, testDownloadRes()])}><span
className="bi-plus-square-fill"></span> Add
</button>
Bulk pre-computed datasets, separated by data type available to download from the <a href={PV_FTP}
title="ProtVar FTP site" target="_self" className='ref-link'>FTP site</a>.
</p>
*/}

{downloads.length > 0 && (
<table className="table download-table">
<thead style={{backgroundColor: '#6987C3', color: '#FFFFFF'}}>
<tr>
<th scope="col">#</th>
<th scope="col">Requested</th>
<th scope="col">ID</th>
<th scope="col">Job name</th>
<th scope="col">Status</th>
<th scope="col">Download</th>
<th scope="col">Delete</th>
</tr>
</thead>
<tbody>

{downloads.map(( download, index ) => {
return (
<tr className={download.status === 1 ? "table-success" : ""} key={'download'+index}>
<th scope="row">{index+1}</th>

<h6>Result download</h6>
<p>
{downloads.length > 0 ? (
<>{downloads.length} download{downloads.length > 1 ? 's' : ''}
<table className="table download-table">
<thead style={{backgroundColor: '#6987C3', color: '#FFFFFF'}}>
<tr>
<th scope="col">#</th>
<th scope="col">Requested</th>
<th scope="col">ID</th>
<th scope="col">Job name</th>
<th scope="col">Status</th>
<th scope="col">Download</th>
<th scope="col">Delete</th>
</tr>
</thead>
<tbody>

{downloads.map((download, index) => {
return (
<tr className={download.status === 1 ? "table-success" : ""} key={'download' + index}>
<th scope="row">{index + 1}</th>
<td>{download.requested.toLocaleString()}</td>
<td>{download.downloadId}</td>
<td>{download.jobName}</td>
<td><div className={downloadStatusIcon[download.status]}></div> {downloadStatusText[download.status]}</td>
<td><button className="bi bi-download download-btn" onClick={() => downloadFile(download.url)} disabled={download.status !== 1} /></td>
<td><button className="bi bi-trash trash-btn" onClick={() => {
setDownloads(
downloads.filter(d =>
<td>
<div className={downloadStatusIcon[download.status]}></div>
{downloadStatusText[download.status]}</td>
<td>
<button className="bi bi-download download-btn"
onClick={() => downloadFile(download.url)} disabled={download.status !== 1}/>
</td>
<td>
<button className="bi bi-trash trash-btn" onClick={() => {
setDownloads(
downloads.filter(d =>
d.downloadId !== download.downloadId
)
);
}}></button></td>
)
);
}}></button>
</td>
</tr>
);
})}

</tbody>
</table>
);
})}

</tbody>
</table>
</>
) : (
`No download`
)
}
</p>


</div>
Expand Down

0 comments on commit dc2ad02

Please sign in to comment.