From 46f1c6fa6eec1fc67bc5f1faad6ec556b8b3a0c5 Mon Sep 17 00:00:00 2001 From: fnguyen Date: Wed, 13 Nov 2024 16:16:03 -0500 Subject: [PATCH] Remove deprecated HTSGetBrowser --- src/store/api.js | 23 ---- src/views/genomicsData/HtsgetBrowser.js | 142 ------------------------ 2 files changed, 165 deletions(-) delete mode 100644 src/views/genomicsData/HtsgetBrowser.js diff --git a/src/store/api.js b/src/store/api.js index c5230145..d98eed14 100644 --- a/src/store/api.js +++ b/src/store/api.js @@ -16,29 +16,6 @@ export function fetchOrRelogin(...args) { }); } -// API Calls -/* -Fetch katsu calls -*/ -export function fetchKatsu(URL) { - // This code is no longer used, however we have decided to archive the HTSGetBrowser class - // which depends on this. Therefore, this is kept for posterity - /* - return fetch(`${katsu}/moh/v1/discovery/overview/${URL}`) - .then((response) => { - if (response.ok) { - return response.json(); - } - console.log(`Katsu: ${response}`); - throw new Error(`Katsu: ${response}`); - }) - .catch((error) => { - console.log(`Error: ${error}`); - return 'error'; - }); - */ -} - export function fetchFederationStat(endpoint) { return fetchOrRelogin(`${federation}/fanout`, { method: 'post', diff --git a/src/views/genomicsData/HtsgetBrowser.js b/src/views/genomicsData/HtsgetBrowser.js deleted file mode 100644 index 2f0048d7..00000000 --- a/src/views/genomicsData/HtsgetBrowser.js +++ /dev/null @@ -1,142 +0,0 @@ -import { useState, useEffect } from 'react'; -import { Box, Button, FormControl, Grid } from '@mui/material'; -import MainCard from 'ui-component/cards/MainCard'; - -import { MultiSelect } from 'react-multi-select-component'; -import LightCard from 'views/dashboard/Default/LightCard'; -import AlertComponent from 'ui-component/AlertComponent'; - -import HtsgetInstance from 'ui-component/IGV/HtsgetInstance'; -import { fetchKatsu } from 'store/api'; - -import { LoadingIndicator, usePromiseTracker, trackPromise } from 'ui-component/LoadingIndicator/LoadingIndicator'; - -// Assets -import MapIcon from '@mui/icons-material/Map'; -import DescriptionIcon from '@mui/icons-material/Description'; - -import 'assets/css/VariantsSearch.css'; - -function HtsgetBrowser() { - const [isLoading, setLoading] = useState(true); - // const events = useSelector((state) => state); - const [BamCount, setBamCount] = useState(''); - const [VcfCount, setVcfCount] = useState(''); - const { promiseInProgress } = usePromiseTracker(); - const options = useState([]); - const [selected, setSelected] = useState([]); - const [open, setOpen] = useState(false); - const [selectedBamIds, setSelectedBamIds] = useState([]); - const [selectedVcfIds, setSelectedVcfIds] = useState([]); - const [alertMessage, _setAlertMessage] = useState(''); - const [alertSeverity, _setAlertSeverity] = useState(''); - - useEffect(() => { - setSelected([]); - options.length = 0; - setSelectedBamIds([]); - setSelectedVcfIds([]); - setLoading(false); - - // Get a list of genomics files available - trackPromise( - fetchKatsu('/api/genomicsreports') - .then((_data) => { - // TODO: get a list of ids of genomics files from API above - // Or any other APIs that can provide a list of IDs - // Note: if only VCF files are served, then the following TODOs concerning BAM files - // can all be removed. - }) - .catch(() => { - setBamCount('Not Available'); - setVcfCount('Not Available'); - }) - ); - }, [options]); - - const formHandler = (e) => { - e.preventDefault(); // Prevent form submission - - // TODO: Dynamically create a list of IDs that have been selected - // TODO: And pass this list of IDs into htsgetInstance - setSelectedBamIds([]); - setSelectedVcfIds([]); - }; - - return ( - - - - - - {promiseInProgress === true ? ( - - ) : ( - } - color="primary" - /> - )} - - - {promiseInProgress === true ? ( - - ) : ( - } - color="secondary" - /> - )} - - - -
- - - {options.length > 0 && ( - - - -

Genomics Files

-
- -
-
- )} -
- - - - - - -
-
- - -
-
- ); -} - -export default HtsgetBrowser;