A comprehensive pipeline for analyzing environmental DNA (eDNA) sequences using deep learning and phylogenetic methods.
./deepsea-ai/
├── frontend/ # React app
├── backend/ # FastAPI/Express server
├── pipeline/ # ML scripts + models
│ ├── scripts/ # Python pipeline scripts
│ ├── models/ # Pre-trained models
│ └── data/ # Raw and processed data
├── shared/ # Shared TypeScript schemas
├── docker-compose.yml # Container orchestration
└── README.md # This file
cd deepsea-ai
pip install -r pipeline/scripts/requirements.txtpython pipeline/run_pipeline.py --input pipeline/data/raw/deepsea-sample.fastapython pipeline/run_pipeline.py --input your_sequences.fasta --output-dir pipeline/data/processed --method transformer --device cuda --k 6- Preprocessing & QC - Quality filtering, trimming, deduplication
- K-mer Tokenization - Convert sequences to k-mer features
- Embeddings Generation - Create dense representations using DNABERT or SVD
- VAE Clustering - Unsupervised discovery using Variational Autoencoders
- Phylogenetic Visualization - Build similarity graphs and phylogenetic trees
- Taxonomy Assignment - Hybrid workflow with representative BLAST queries
- Report Generation - Comprehensive analysis reports and visualizations
--input: Input FASTA/FASTQ file (required)--output-dir: Output directory (default: pipeline/data/processed)--method: Embedding method - transformer or svd (default: transformer)--device: Device for transformer - cpu or cuda (default: cpu)--k: K-mer size (default: 6)--skip-stages: Skip specific stages (e.g., --skip-stages 1 2)--blast-db: Local BLAST database path for taxonomy assignment--online-blast: Use online BLAST (slower but no local DB needed)
cleaned_sample.fasta- Preprocessed sequencesdedup_counts.csv- Sequence counts and metadataembeddings.npy- Dense sequence embeddingsclusters.csv- Cluster assignmentsnovelty_scores.csv- Novelty detection resultsumap_2d.npy- 2D projections for visualizationphylo_graph.json- Similarity graphphylo_simple.nwk- Phylogenetic treephylo_tree_colored.png- Tree visualizationcluster_taxonomy.csv- Taxonomy assignments for cluster representativessequence_taxonomy.csv- Full taxonomy mapping for all sequencesanalysis_report.md- Comprehensive analysis summarytaxonomy_abundance.png- Taxonomic composition plotsnovelty_analysis.png- Novelty detection visualizationsphylogenetic_diversity.png- Phylogenetic diversity plots
You can also run individual stages:
# Stage 1: Preprocessing
python pipeline/scripts/preprocess.py pipeline/data/raw/input.fasta pipeline/data/processed
# Stage 2: Tokenization
python pipeline/scripts/kmer_tokenize.py pipeline/data/processed/cleaned_sample.fasta pipeline/data/processed --k 6
# Stage 3: Embeddings
python pipeline/scripts/get_embeddings.py pipeline/data/processed/cleaned_sample.fasta pipeline/data/processed/embeddings.npy --method transformer
# Stage 4: Clustering
python pipeline/scripts/vae_cluster.py
# Stage 5: Phylogenetics
python pipeline/scripts/phylo_vis.py
# Stage 6: Taxonomy Assignment
python pipeline/scripts/run_taxonomy.py --blast-db pipeline/data/reference/16S_ribosomal_RNA
# OR for online BLAST (slower):
python pipeline/scripts/run_taxonomy.py --online
# Stage 7: Generate Reports
python pipeline/scripts/biodiversity_analysis.py
# Visualization
python pipeline/scripts/view_tree.pycd frontend
npm install
npm run devcd backend
npm install
npm run devdocker-compose up --build- ✅ Robust error handling and validation
- ✅ Reproducible results with fixed random seeds
- ✅ Memory-efficient processing for large datasets
- ✅ Support for both CPU and GPU acceleration
- ✅ Comprehensive logging and progress tracking
- ✅ Flexible configuration options
- ✅ Web interface for pipeline management
- ✅ Real-time progress monitoring