How rudrakshyadav1/deepseapoc works
Purpose and Topology
This repository is a bioinformatics analysis product: a Next.js frontend lets users upload and inspect site/sample analyses, while a Python backend exposes job-oriented APIs and a standalone Python pipeline processes sequencing data through QC, taxonomy, and reporting stages.
Frontend Application
Next.js App Router provides public pages, authentication, and a dashboard. Primary page entry points are:
• frontend/src/app/page.tsx
• frontend/src/app/dashboard/page.tsx
• frontend/src/app/layout.tsx
Dashboard UI is organized around upload, map/site selection, and result presentation:
• frontend/src/app/components/dashboard/UploadPanel.tsx
• frontend/src/app/components/dashboard/MapComponent.tsx
• frontend/src/app/components/dashboard/ResultsPanel.tsx
The map uses a bundled India GeoJSON dataset at frontend/public/india-composite.geojson.
Frontend State, Identity, and Backend Boundary
JobContext coordinates analysis-job state across dashboard components, while Redux store setup includes an authentication slice:
• frontend/src/app/contexts/JobContext.tsx
• frontend/src/store/store.tsx
• frontend/src/store/authSlice.ts
Firebase is the apparent client authentication integration:
• frontend/src/firebase/firebase.ts
BackendDataService is the principal frontend-to-backend boundary; it should encapsulate API calls rather than allowing dashboard components to depend directly on backend endpoints:
• frontend/src/app/services/BackendDataService.ts
Mock site/sample data supports frontend operation independent of completed backend analyses:
• frontend/src/data/mockSamples.json
• frontend/src/data/mockSites.json
Backend API and Job Control Plane
The Python backend is structured as an API service with versioned route modules. Application startup and shared infrastructure are centered in:
• backend/app/main.py
• backend/app/db.py
• backend/app/core/config.py
The externally meaningful workflow endpoints are separated by responsibility:
• upload intake: backend/app/api/v1/upload.py
• job creation/status: backend/app/api/v1/jobs.py
• analysis retrieval: backend/app/api/v1/results.py
A health endpoint supports service monitoring at backend/app/api/v1/health.py. There is also a routes-level jobs module, suggesting job routing or compatibility logic:
• backend/app/routes/jobs.py
Persistence, Schemas, and Security
Backend models define persisted job/result domain entities, and schemas define request/response contracts:
• backend/app/models/models.py
• backend/app/schemas/schemas.py
Security concerns are isolated from endpoint handlers:
• backend/app/core/security.py
The database implementation is represented by backend/app/db.py; the tree does not identify its database vendor. Logging is similarly centralized:
• backend/app/core/logger.py
Asynchronous Processing Boundary
Celery is the designated background-worker runtime, separating API request handling from long-running analysis execution:
• backend/app/workers/celery_worker.py
• backend/app/api/v1/jobs.py
The intended control flow is: frontend uploads data → backend creates/persists a job → Celery worker executes analysis → frontend polls or retrieves job results through the results API. Broker/result-backend infrastructure is not identifiable from the supplied tree.
Bioinformatics Pipeline
The standalone pipeline orchestrator is:
• pipeline/run_pipeline.py
It composes a staged analysis flow over uploaded sequencing inputs:
1. Input conversion and QC: pipeline/converter.py, pipeline/steps/qc.py
2. Read cleanup: pipeline/steps/adapters.py, pipeline/steps/filter.py, pipeline/steps/chimera.py, pipeline/steps/contam.py
3. Biological reduction/classification: pipeline/steps/cluster.py, pipeline/steps/annotate.py, pipeline/steps/genus.py
4. Analytical output generation: pipeline/steps/abundance.py, pipeline/steps/embed.py, pipeline/steps/reduce.py, pipeline/steps/report.py
pipeline/cache/ncbi_cache.json indicates NCBI-derived lookup/cache usage, likely associated with annotation. Pipeline outputs must be translated into the backend’s result model/API contract for dashboard consumption.
Main entry points: page.tsx Dashboard · BackendDataService.ts Backend data service · jobs.py Job API · models.py Job/result domain
Components 22
Next.js frontend
- App Router · Public, auth, and dashboard page entry points.
frontend/src/app/layout.tsx - Dashboard · Upload, site selection, and result presentation.
frontend/src/app/dashboard/page.tsx - Upload panel
frontend/src/app/components/dashboard/UploadPanel.tsx - Site map · Renders India site geography.
frontend/src/app/components/dashboard/MapComponent.tsx - Results panel
frontend/src/app/components/dashboard/ResultsPanel.tsx - Job state · Coordinates analysis jobs across dashboard components.
frontend/src/app/contexts/JobContext.tsx - Authentication · Client identity state and Firebase integration.
frontend/src/store/authSlice.ts - Backend data service · Encapsulates frontend calls to backend APIs.
frontend/src/app/services/BackendDataService.ts - Mock sites & samples · Supports frontend use without completed analyses.
frontend/src/data/mockSamples.json
Python API & workers
- API application · Application startup and versioned API composition.
backend/app/main.py - Upload intake
backend/app/api/v1/upload.py - Job API · Creates jobs and exposes their status.
backend/app/api/v1/jobs.py - Results API · Returns completed analysis results.
backend/app/api/v1/results.py - Job/result domain · Persisted entities and API contracts.
backend/app/models/models.py - Database · Vendor is not identified.
backend/app/db.py - Celery worker · Runs long-lived analysis outside API requests.
backend/app/workers/celery_worker.py
Analysis pipeline
- Pipeline orchestrator · Composes sequencing analysis stages for worker jobs.
pipeline/run_pipeline.py - Conversion & QC · Converts inputs and performs quality control.
pipeline/converter.py - Read cleanup · Adapter, filter, chimera, and contaminant processing.
pipeline/steps/adapters.py - Classification · Clustering, annotation, and genus reduction.
pipeline/steps/cluster.py - Analytical reporting · Abundance, embedding, reduction, and report output.
pipeline/steps/abundance.py - NCBI cache · Cached NCBI-derived annotation data.
pipeline/cache/ncbi_cache.json
Connections 29
- App Router → Dashboard: renders
- Dashboard → Upload panel: includes
- Dashboard → Site map: includes
- Dashboard → Results panel: includes
- Dashboard → Job state: uses
- Dashboard → Authentication: uses identity
- Site map → Mock sites & samples: fallback data
- Results panel → Mock sites & samples: fallback data
- Upload panel → Backend data service: submits input
- Job state → Backend data service: tracks jobs
- Results panel → Backend data service: retrieves results
- Backend data service → Upload intake: uploads
- Backend data service → Job API: creates / polls
- Backend data service → Results API: fetches
- API application → Upload intake: serves
- API application → Job API: serves
- API application → Results API: serves
- Upload intake → Job API: initiates job
- Job API → Job/result domain: uses contracts
- Results API → Job/result domain: serializes
- Job/result domain → Database: persists
- Job API → Celery worker: dispatches
- Celery worker → Pipeline orchestrator: executes
- Pipeline orchestrator → Conversion & QC: runs first
- Conversion & QC → Read cleanup: clean reads
- Read cleanup → Classification: prepared reads
- Classification → NCBI cache: lookup data
- Classification → Analytical reporting: taxonomic output
- Analytical reporting → Job/result domain: maps outputs to results