Step 4 Mapping RXNs to Gene Families - quadram-institute-bioscience/FuncDarkMatt GitHub Wiki
Step 4: Mapping RXNs to Gene Families
Each per-species *_RXNS.txt file from Step 3 is mapped to UniRef90 gene families (GFs) using a hierarchical three-strategy approach.
Mapping Strategy Overview
Strategies are applied from most to least specific. Reactions unmapped by one strategy are passed to the next.
All RXNs with UniProtKB Accession â GF assigned (UniProtKB accession pool)
â
All RXNs â EC mapping
EC hit? â GF assigned (EC + UniProtKB accession pooled if UniProtKB accession exists for that RXN) â File 1 reactions
No EC hit? â residual
â
Residuals â Pfam mapping
Pfam hit? â GF assigned (Pfam + UniProtKB accession pooled if UniProtKB accession exists for that RXN) â File 2 additions
No Pfam hit? â final residual
â
Final residuals â PA-only GF (if PA existed) or no GF â File 3 unique additions
Exact Pfam Set Matching â Detail
Each reaction can carry one or more Pfam domain sets (reflecting alternative subunit or isoform compositions). A GF is assigned only when its Pfam composition is an exact set match to the query.
| Scenario | Pfam sets on reaction | Match result | GF assignment |
|---|---|---|---|
| Single set, full match | {PF00001} |
{PF00001} found |
â Assigned |
| Single set, partial match | {PF00001, PF00002} |
Only {PF00001} found |
â Not assigned |
| Single set, no match | {PF00001} |
Not in database | â Not assigned |
| Multiple sets, all match | {PF00001}, {PF00002, PF00003} |
Both found | â GFs from both sets pooled |
| Multiple sets, partial match | {PF00001}, {PF00099} |
Only first found | â GFs from matched set only |
Running the Mapping
The mapping runs as a SLURM array job â one task per BioCyc organism file.
Before submitting, set these variables at the top of scripts/map_RXNS2GF.sh:
| Variable | Description |
|---|---|
BIOCYC_RXNS |
Directory containing per-organism *_RXNS.txt files from Step 3 |
BASE_DIR |
Output root directory (subdirectories created automatically) |
SCRIPT_DIR |
Directory containing the Python scripts |
DB |
Path to uniref90_pf_ec.db built in Step 2 |
Array size: Set --array=0-N where N = (number of files) - 1. For clusters with a MaxArraySize limit, submit in batches using the OFFSET variable:
# Standard submission
sbatch --array=0-N scripts/map_RXNS2GF.sh
# Batched submission example
OFFSET=6000 sbatch --array=0-5999 scripts/map_RXNS2GF.sh
Each task runs all mapping steps sequentially with checkpointing, so incomplete runs can be safely resumed.
Output
Three directories are created under BASE_DIR:
| Directory | Contents |
|---|---|
rxn_ec_uniref90/ |
EC-number based RXNâGF mappings |
rxn_exactpfamset_uniref90/ |
Exact Pfam set RXNâGF mappings |
rxn_proteinaccession_uniref90/ |
UniProtKB Accession based RXNâGF mappings |
Each directory contains:
RXN_GF-{NAME}.txtâ reactions successfully mapped to a GFRXN_NO_GF-{NAME}.txtâ unmapped residuals passed to the next strategy