Conversation
Added a "Run All" functionality to process all studies in the database with user SNP matches. Introduced a dedicated modal for real-time progress updates, including status details and error handling. Extended `MenuBar` with a trigger for the feature. Updated API route to support bulk data fetching for this process.
Implemented an exponential moving average (EMA) for rate calculations to provide a smoother and more accurate ETA in the "Run All" process. Added a safety buffer and enhanced progress updates with improved handling for early batch estimations. Updated UI to display "Calculating..." when ETA is unavailable.
Implemented IndexedDB-based caching for GWAS catalog and reworked the "Run All" analysis to process studies directly from local storage. Added support for downloading, decompressing, parsing, and storing large GWAS datasets in IndexedDB for efficient processing. Enhanced real-time progress updates and improved memory efficiency with batch processing.
Added `studyAccession` tracking for more accurate result identification and deduplication across studies. Improved cache clearing UX with loading indicators and error handling. Updated local result retrieval logic to prioritize `gwasId` and added fallbacks for `studyId`. Enhanced status messaging and UI hints for IndexedDB operations.
Implemented a SQL.js-backed in-memory database optimized for handling 100k+ genetic results. Replaced array-based state management with advanced SQL schemas, batch operations, indexes, and custom query methods for efficient analysis. Updated context and components to support new database APIs and enhanced `Run All` logic with database-backed result persistence and retrieval.
…ration Introduced SQL-based top-results querying for improved performance. Enhanced the `fetchCommentary` workflow with phased loading states, progress indicators, and better error handling. Deprecated the `allResults` prop in favor of context-driven SQL queries. Added UI feedback for commentary generation stages and connected new `getTopResultsByEffect` API to streamline database operations.
Switch to production nilAI
…th instances - Switch baseURL to production nilai-f910 endpoint - Add nilauthInstance: PRODUCTION parameter - Update model from google/gemma-3-27b-it to openai/gpt-oss-20b for consistency - Ensures both useEffect and fetchCommentary use identical configuration
- Install sql.js and @types/sql.js dependencies - Remove unused results-query-examples.ts that violated React Hooks rules - Fix loadingPhase type issue in LLMCommentaryModal (simplify ternary logic) - Add missing phase types to runAllStatus (downloading, decompressing, parsing, storing) - Add null check for genotypeData before running analysis - Add missing 'type' prop to DisclaimerModal component Build now passes successfully with only linting warnings remaining.
The initial disclaimer modal was only calling onClose() instead of onAccept() when the user clicked 'I Understand - Continue', preventing the Run All functionality from proceeding after disclaimer acceptance.
…lt handling and commentary modal props - Replace `savedResults` with `resultsContext.savedResults` for better context usage. - Memoize `currentResultForModal` in `StudyResultReveal` to enhance performance. - Remove deprecated `allResults` prop from `LLMCommentaryModal`. - Add debug-level logging to monitor component rendering and fetch processes.
…ment - Use `createPortal` to mount the modal at the document body level, ensuring fixed viewport positioning. - Adjust `.modal-overlay` styles to center modal vertically and modify padding for consistent spacing.
- Introduce `CustomizationContext` to manage user customization data (ethnicity, age, medical history). - Add encryption utilities (`encryption-utils.ts`) for secure client-side storage of sensitive data. - Create `CustomizationModal` for managing and encrypting user customization. - Update `MenuBar` to include a "Customize" button reflecting customization status. - Integrate customization context into `LLMCommentaryModal` to personalize AI interpretations. - Add styles for customization features and improve overall UI consistency.
- Implement `EmbeddingCache` with in-memory (hot) and database (persistent) tiers for efficient storage and retrieval of embeddings. - Add `EmbeddingService` to generate embeddings using the `nomic-ai/nomic-embed-text-v1.5` model with optimization for quantized parameters. - Create Python script `generate-embeddings.py` for generating embeddings from GWAS catalog studies and storing them in a separate `study_embeddings` table. - Incorporate caching, cleanup logic, and batch handling for improved performance and maintainability.
…and improve type safety in `encryption-utils` - Calculate `hnswCandidateLimit` based on filter strictness and user-defined limit for better query efficiency. - Remove static cap for `rawLimit`, scaling it dynamically for post-query filtering needs. - Add type-safe assertion for `salt` in `encryption-utils`. - Update `CustomizationContext` to separate personal and family conditions for improved customization management.
…lters - Introduce `offset` to filters and backend queries for paginated result loading. - Add "Load More" button to UI with scroll position restoration after loading additional results. - Reset offset when non-offset filters change to ensure fresh queries. - Improve `rawLimit` calculation by dynamically adjusting buffer size for post-query filtering.
- Create `POST` APIs for generating embeddings, fetching embeddings from PostgreSQL, and finding similar studies using vector similarity search. - Enhance semantic relevance handling in `LLMCommentaryModal` with logging and user-specific metadata. - Add embedding generation progress to `RunAllModal` and optimize result storage. - Improve UI for displaying embedding-related data and enhance CSS styling for metadata sections.
- Introduce a personalization prompt in `LLMCommentaryModal` to encourage users to set up or unlock customization data for tailored analysis. - Enhance relevance calculation by supplementing results with high-risk studies when semantic matches are insufficient. - Update `RunAllIndexed` and `ResultsManager` to include GWAS catalog details (e.g., p-values, mapped genes) in saved results. - Extend PostgreSQL schema to store new GWAS study fields and enable advanced filtering. - Optimize `similar-studies` API by aggregating similarity scores at the study level for improved accuracy. - Refine UI and CSS for consent and personalization prompts to guide user interaction.
- Expand GWAS result schema with additional metadata fields (e.g., `p_value`, `mapped_gene`). - Improve semantic search in `LLMCommentaryModal` by querying and filtering a broader range of studies (5000 -> 499). - Add print feature for AI analysis in `LLMCommentaryModal`, generating a styled, print-ready summary of the results. - Adjust API result limit cap in `similar-studies` to 50000. - Update console logs for clearer context and debugging.
…ix duplicate detection in results-database.
- Introduce `similarity` field to GWAS study data for semantic search relevance (0-1 scale). - Dynamically display and handle "Similarity" column in results table based on availability of semantic search scores. - Use `resultsVersion` for efficient state updates in ResultsContext, avoiding unnecessary re-renders. - Improve StudyResultReveal component by memoizing saved results to prevent redundant effect triggers. - Enhance PostgreSQL query to include similarity score calculation for semantic search.
…isk score calculation logic, and refine personalization terminology - Extend GWAS schema with `effectType` (OR/beta) and `replicationSampleSize` fields. - Refactor risk score calculation to accurately handle odds ratios and beta coefficients. - Standardize risk score formatting for improved clarity in results display. - Replace "Customize" with "Personalize" across the UI for consistency and user alignment. - Update modal behavior in `CustomizationModal` for smoother user experience. - Miscellaneous fixes, including button handling, API updates, and redundant code cleanup.
31b6441 to
1b83e5a
Compare
- Introduce AIChatModal in `MenuBar` to allow users to chat about their genetic results. - Implement AI chat button with prompts encouraging users to analyze more results for better insights. - Expand `ResultsContext` and `CustomizationContext` with development mode utilities for auto-loading and auto-unlocking results and personalization. - Add `AIIcon` component and update CSS for AI chat modal styling. - Refactor results parsing in `ResultsManager` for flexibility with file formats (JSON/TSV). - Provide `.env.local.example` for environment variable setup, including AI and database configurations. - Extend dev-mode utilities with File System Access API fallback mechanisms for automated file handling in development.
…t functionality. - Introduce `AIChatInline` for direct AI chat integration within the premium section. - Remove `AIChatModal` and its related functionality in `MenuBar`. - Implement tab navigation for "Explore" and "Premium" in `MainContent` with persistent active tab state in development mode. - Update CSS for tab navigation, AI chat inline layout, and premium section styling. - Add `react-markdown` and `remark-gfm` dependencies for rich markdown rendering in AI chat responses.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the following paid features while maintaining privacy and maixmum local processing:
Changes to regular functionality:
The database schema has been expanded to accommodate study embeddings.