This guide explains how to run predictions on the large 3M PubMed dataset, filter to autoregulatory papers, enrich with PubTator, and merge with the existing enriched app dataset.
Download required files (Google Drive): https://drive.google.com/drive/folders/1cHp6lodUptxHGtIgj3Cnjd7nNBYWHItM?usp=sharing
Place the files here:
data/pred/abstracts-authors-date.tsvmodels/stage1_best.ptmodels/stage2_best.pt
conda env create -f environment.yml
conda activate autoregulatory
pip install torch --index-url https://download.pytorch.org/whl/cpuThis runs the 3M prediction step:
python scripts/python/prediction/predict_new_data.py \
--input data/pred/abstracts-authors-date.tsv \
--output results/new_predictions.csv \
--checkpoint-interval 10000After predictions, filter to keep only rows with autoregulatory mechanisms:
python scripts/python/data_processing/filter_non_autoregulatory.py \
--input results/new_predictions.csv \
--output results/new_predictions_autoregulatory_only.csvAfter filtering, enrich the CSV with protein and gene info using PubTator + UniProt.
python scripts/python/data_processing/enrich_pubtator_csv.py \
--input results/new_predictions_autoregulatory_only.csv \
--output results/new_predictions_autoregulatory_only_enriched.csvOutput columns added:
UniProtKB_accessions(comma-separated UniProtKB accession numbers, if found)Protein_IDProtein_NameGene_Name
Optional: if any PubMed fields are missing (e.g., Year/Month/PublicationDate), add --fill-pubmed
to fetch them from PubMed (cached):
python scripts/python/data_processing/enrich_pubtator_csv.py \
--input results/new_predictions_autoregulatory_only.csv \
--output results/new_predictions_autoregulatory_only_enriched.csv \
--fill-pubmedOnce the 3M predictions are enriched, merge them with the enriched metadata dataset from the unused unlabeled flow.
scripts/python/data_processing/merge_enriched_predictions.py
Base (unused unlabeled metadata, enriched):
results/unused_predictions_autoregulatory_only_metadata_enriched.csv
New (3M predictions enriched):
results/new_predictions_autoregulatory_only_enriched.csv
shiny_app/data/predictions.csv
python scripts/python/data_processing/merge_enriched_predictions.py \
--base results/unused_predictions_autoregulatory_only_metadata_enriched.csv \
--new results/new_predictions_autoregulatory_only_enriched.csv \
--output shiny_app/data/predictions.csv
This merge step also generates a database-specific unique row identifier:
AC=SOORENA-<SourceCode>-<PMID>-<n>(keeps duplicate PMIDs as separate rows)- Source codes:
U=UniProt,P=Predicted (Non-UniProt),O=OmniPath,S=SIGNOR,T=TRRUST
Add curated self-loop data from external biological databases:
python scripts/python/data_processing/integrate_external_resources.py \
--input shiny_app/data/predictions.csv \
--output shiny_app/data/predictions.csv \
--others-dir others/What this does:
- Reads external resource files from
others/directory:OmniAll.xlsx(OmniPath protein-protein interactions)Signor.xlsx(SIGNOR signaling/phosphorylation data)TRUST.xlsx(TRRUST transcription factor autoregulation)
- Extracts self-loop entries (where source = target)
- Maps mechanism types to SOORENA categories
- Adds entries with
Source= "OmniPath", "SIGNOR", or "TRRUST" - Sets
Mechanism_Probability = 1.0(curated, not predicted)
Requirements:
- Place external resource Excel files in
others/directory - Files are optional; missing files are skipped with a warning
More detail: docs/README_EXTERNAL_RESOURCES.md
Create the Shiny app database directly from the merged enriched CSV:
python scripts/python/data_processing/create_sqlite_db.py \
--input shiny_app/data/predictions.csv \
--output shiny_app/data/predictions.db- This step can take days on CPU.
- Checkpointing lets you resume from
results/new_predictions_checkpoint.csv.