From 03dafb573460314d38a709ddb77834e39701a65f Mon Sep 17 00:00:00 2001 From: mgs-sails Date: Thu, 3 Oct 2024 14:25:03 +0100 Subject: [PATCH] WIP, localised branchwater search interface --- src/pages/Branchwater/Index.tsx | 90 +++++++++---- src/pages/Home/index.tsx | 11 +- src/pages/Search/Index.tsx | 8 +- temp.html | 228 ++++++++++++++++++++++++++++++++ 4 files changed, 301 insertions(+), 36 deletions(-) create mode 100644 temp.html diff --git a/src/pages/Branchwater/Index.tsx b/src/pages/Branchwater/Index.tsx index 0613ce99..1cbe832f 100644 --- a/src/pages/Branchwater/Index.tsx +++ b/src/pages/Branchwater/Index.tsx @@ -71,6 +71,7 @@ const Branchwater = () => { const ref = useRef(); const [showMgnifySourmash, setShowMgnifySourmash] = useState(false); const [uploadedFile, setUploadedFile] = useState(null); + const [targetDatabase, setTargetDatabase] = useState('MAGs'); const handleFileUpload = (event) => { const file = event.target.files[0]; @@ -82,13 +83,15 @@ const Branchwater = () => { // } }; - const handleSearchClick = () => { + const handleSearchClick = (event) => { + event.preventDefault(); setShowMgnifySourmash(true); // if (uploadedFile) { // setShowMgnifySourmash(true); // } else { // alert('Please upload a FASTA file first.'); // } + console.log(`Searching in ${targetDatabase} database`); }; const handleClearClick = () => { @@ -104,34 +107,63 @@ const Branchwater = () => { return (
-
- - - - +
+
+
+ + +
+ + Select target database + + +
+ setTargetDatabase('MAGs')} + /> + +
+ +
+ setTargetDatabase('Metagenomes')} + /> + +
+ + + +
+
+
{showMgnifySourmash && ( diff --git a/src/pages/Home/index.tsx b/src/pages/Home/index.tsx index abc52bea..4814b68b 100644 --- a/src/pages/Home/index.tsx +++ b/src/pages/Home/index.tsx @@ -5,6 +5,7 @@ import BlogExcerpts from 'components/Home/BlogExcerpts'; import ExtLink from 'components/UI/ExtLink'; import Publications, { MainPublication } from 'components/Publications'; import './style.css'; +import SearchPage from 'pages/Search'; const HomePage: React.FC = () => { return ( @@ -26,10 +27,12 @@ const HomePage: React.FC = () => {
-
- - -
+ + {/*
*/} + {/* /!**!/*/} + {/* */} + {/* */} + {/*
*/}

Latest publications

diff --git a/src/pages/Search/Index.tsx b/src/pages/Search/Index.tsx index 5a03269e..88e8c491 100644 --- a/src/pages/Search/Index.tsx +++ b/src/pages/Search/Index.tsx @@ -1,4 +1,6 @@ import React, { useState } from 'react'; +import Branchwater from 'pages/Branchwater'; +import Cobs from 'components/Genomes/Cobs'; const SearchPage: React.FC = () => { // State to manage the active tab @@ -90,12 +92,12 @@ const SearchPage: React.FC = () => {

Search by Nucleotide

Search by MAG - Something small enough to escape casual notice. +
- Sarch by Gene - Something small enough to escape casual notice. + Search by Gene +
diff --git a/temp.html b/temp.html new file mode 100644 index 00000000..029e59cb --- /dev/null +++ b/temp.html @@ -0,0 +1,228 @@ +{% include 'header.html' %} + + + + + + + + + + + + + + + + + + +
+

Try out the search!

+

+ Submit one of the genomes below to examine its potential SRA metagenome + matches and explore the default metadata options. +
+ Refresh the page to try a different genome. +

+
+
+ + + +
+
+ +
+ Which do you like? +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ +
+ + +
+
+ +
+ + +
+ + + +

+ This example search allows you to try out the + default search, which rapidly searches over 700,000 metagenomes deposited in NCBI's + sequence read archive (SRA) + and bypasses additional steps for metadata collation. Search typically + takes less than 5 minutes. Default results return SRA metagenomes with + >10% containment of the query genome presented in a table, map, and + summary plots for selected high-interest metadata. If you'd like to have + greater control over the included metadata, an + advanced search is available. Metadata selection + does not change the datasets that are searched; it only impacts which + metadata are included in the table and plots. Please note that + SRA run accessions vary greatly in which metadata categories have + information available. Further details regarding the curated metadata + can be found on the about page. +

+ + + + + +{% include 'footer.html' %}