Skip to content

FilipSchymik/propagate_go_terms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Propagate go-terms using Python

Propagate_go_terms.py is a very simple script to propagate GO terms from GAF annotations or DeepFRI csv files using the Gene Ontology hierarchy.

Propagation means adding parent go-terms (related, but usually less specific) to your query terms. deepFRI predictions also have scores - in this implementation the parent terms receive the highes score of their children.

The main propagation engine is the get_all_parents() method from goatools. The current implementation uses only is_a relationship.

Main script supports three modes:

--mode gaf: propagate from a GAF file (optionally filtered by your protein list).

--mode pred: propagate from DeepFRI CSV predictions.

--mode both: run both in one invocation.

Key flags:

--gaf: path to GOA GAF file.

--proteins: optional one-per-line protein ID list for GAF filtering.

--pred_pattern: glob pattern for DeepFRI CSVs.

--score_cutoff: float, threshold for DeepFRI scores.

--id_from_filename: when set, overrides the default naming from csv "protein" column by parsing the filename.

--obo: path to GO OBO file.

--ic: optional CSV with information content (go_term,IC).

--output_gaf / --output_pred: output CSV paths.

Installation

git clone https://github.com/FilipSchymik/propagate_go_terms.git
cd propagate_go_terms

# create conda env
conda env create -f environment.yml
conda activate propagate_go_terms

Usage

  1. GAF only, all proteins:
python propagate_go_terms.py \
  --mode gaf \
  --gaf data/goa_uniprot_all.gaf \
  --obo data/go.obo \
  --output_gaf results/gaf_propagated.csv
  1. DeepFRI only, load IDs from filenames:
python propagate_go_terms.py \
  --mode pred \
  --pred_pattern "predictions/*predictions.csv" \
  --id_from_filename \
  --obo data/go.obo \
  --output_pred results/deepfri_propagated.csv
  1. Both modes with IC integration:
python propagate_go_terms.py \
  --mode both \
  --proteins data/af_best_4mln.txt \
  --gaf data/goa_uniprot_all.gaf \
  --pred_pattern "predictions/*_predictions.csv" \
  --obo data/go.obo \
  --ic data/IC_swissprot.csv \
  --output_gaf results/gaf.csv \
  --output_pred results/pred.csv

About

Python tool for propagating go-terms from gaf file or deepFRI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages