This directory contains shell scripts that automate the complete SOORENA pipeline.
Run the entire pipeline end-to-end:
./scripts/run_full_pipeline.sh./scripts/run_training.shWhat it does:
- Prepares data from raw .rds files
- Trains Stage 1 model (binary classification)
- Trains Stage 2 model (7-class mechanism classification)
- Evaluates both models on test set
- Generates predictions on unused unlabeled data
Runtime: 1 hour (GPU) | 5 hours (CPU)
Outputs:
models/stage1_best.ptmodels/stage2_best.ptdata/processed/stage1_test_eval.csvdata/processed/stage2_test_eval.csvresults/unused_unlabeled_predictions.csv
./scripts/run_unused_predictions.shWhat it does:
- Filters predictions to autoregulatory only
- Merges with labeled training data
- Enriches with PubTator/UniProt metadata
Runtime: 30 minutes (GPU) | 2 hours (CPU)
Outputs:
results/unused_predictions_autoregulatory_only_metadata_enriched.csv
./scripts/run_new_predictions.shWhat it does:
- Runs predictions on 3M PubMed dataset
- Filters to autoregulatory only
- Enriches with PubTator/UniProt metadata
Runtime: 2-3 days (GPU) | 1-2 weeks (CPU)
Features:
- Automatic checkpointing every 10,000 predictions
- Resume support (just re-run if interrupted)
Outputs:
results/new_predictions_autoregulatory_only_enriched.csv
./scripts/run_merge_and_deploy.shWhat it does:
- Merges unused + 3M enriched datasets
- Enriches external resources with Title, Abstract, Journal, Authors, Date, Protein Name (cached)
- Integrates external resources (OmniPath, SIGNOR, TRRUST)
- Builds SQLite database for Shiny app
- Optionally deploys to DigitalOcean
Runtime: 10-15 minutes (first run with enrichment), 10 minutes (subsequent runs with cache)
Outputs:
shiny_app/data/predictions.csv(includes external resources)shiny_app/data/predictions.dbothers/OtherResources_enriched.csv(cached enriched external resources)
External Resources (optional):
Place this file in others/ directory to include curated self-loop data:
others/OtherResources.xlsx(preprocessed OmniPath, SIGNOR, TRRUST data)
The script will automatically enrich this file with metadata on first run and cache the results.
To re-enrich from scratch, delete others/OtherResources_enriched.csv.
If the file is missing, the script continues without external resources.
./scripts/run_full_pipeline.shWhat it does:
Runs all 4 scripts in sequence with:
- Interactive prompts
- Prerequisite checking
- GPU detection
- Runtime estimates
- Progress tracking
- Final summary
Runtime: Varies (see individual script runtimes)
./scripts/run_full_pipeline.sh# If 3M predictions were interrupted, just re-run
./scripts/run_new_predictions.sh
# Automatically resumes from checkpoint# If you already have enriched CSVs and just need to rebuild DB
./scripts/run_merge_and_deploy.sh# Deploy without rebuilding database
rsync -avz shiny_app/data/predictions.db root@143.198.38.37:/srv/shiny-server/soorena/data/predictions.db
ssh root@143.198.38.37 "chown -R shiny:shiny /srv/shiny-server/soorena && systemctl restart shiny-server"DO_HOST - DigitalOcean droplet IP (default: 143.198.38.37)
export DO_HOST="your.server.ip"
./scripts/run_merge_and_deploy.shAll scripts use set -e to exit immediately on errors. This ensures:
- Failed steps don't cascade
- You can identify exactly which step failed
- Resume from the failed step after fixing
Example:
# If run_full_pipeline.sh fails during Phase 2
./scripts/run_unused_predictions.sh # Fix and re-run Phase 2 only
./scripts/run_new_predictions.sh # Then continue with Phase 3
./scripts/run_merge_and_deploy.sh # Then finish with Phase 4Required files:
data/raw/autoregulatoryDB.rds(from Git LFS)data/raw/pubmed.rds(from Git LFS)
Optional (for 3M predictions):
data/pred/abstracts-authors-date.tsv(from Google Drive)
Download 3M dataset:
https://drive.google.com/drive/folders/1cHp6lodUptxHGtIgj3Cnjd7nNBYWHItM
watch -n 1 nvidia-smiwc -l results/new_predictions_checkpoint.csvchmod +x scripts/run_*.shThe scripts will tell you exactly which files are missing. Download from Git LFS or Google Drive as indicated.
- Reduce batch size in config.py
- Close other applications
- Consider using CPU if GPU memory is limited
rm results/new_predictions_checkpoint.csv
./scripts/run_new_predictions.shrun_full_pipeline.sh (orchestrator)
|
+-> run_training.sh
| +-> prepare_data.py
| +-> train_stage1.py
| +-> train_stage2.py
| +-> evaluate.py
| +-> predict_unused_unlabeled.py
|
+-> run_unused_predictions.sh
| +-> filter_non_autoregulatory.py
| +-> merge_final_shiny_data.py
| +-> enrich_pubtator_csv.py
|
+-> run_new_predictions.sh
| +-> predict_new_data.py
| +-> filter_non_autoregulatory.py
| +-> enrich_pubtator_csv.py
|
+-> run_merge_and_deploy.sh
+-> merge_enriched_predictions.py
+-> enrich_external_resources.py <-- NEW (enrich OtherResources.xlsx)
+-> integrate_external_resources.py <-- NEW (OmniPath, SIGNOR, TRRUST)
+-> create_sqlite_db.py
+-> rsync + ssh (deploy)
For detailed documentation on each Python script, see docs/README.md.