Fast alignment remapping between pangenome graphs.
Python 3.7+
GraphAlignerconda install -c bioconda graphalignerpython3 panairlift.py \
source.gfa \
target.gfa \
input.gaf \
output.gaf \
--reads reads.fastq \
--threads 8| Option | Description | Default |
|---|---|---|
--reads FILE |
FASTQ/FASTA reads file for new segment alignment | None |
--threads NUM |
Number of threads | CPU count (max 8) |
--kmer SIZE |
K-mer size for indexing | 31 |
--min-id FLOAT |
Minimum identity threshold | 0.9 |
Maps segments from source to target graph using:
- Name matching: O(1) lookup by segment name
- Hash matching: Fast sequence hash comparison
- Substring search: Find segments within larger sequences
For each alignment in the input GAF:
- Extract path nodes from source graph
- Map each node to target graph
- Reconstruct path in target coordinates
- Identify new segments in target graph
- Run GraphAligner on new segments
- Add new alignments to output
| Tag | Description |
|---|---|
LS:Z:OK |
Successfully lifted |
LS:Z:PARTIAL |
Partially lifted |
LS:Z:NEW |
New alignment from GraphAligner |
LS:Z:MIXED |
Mixed path (old + new segments) |
Airlift/
├── panairlift.py # Main CLI
├── README.md
└── src/
├── core/ # I/O handlers
│ ├── gfa_parser.py
│ └── gaf_handler.py
└── mapper/ # Graph mapping
└── segment_mapper.py
python3 panairlift.py \
ecoli-100.gfa \
ecoli-500.gfa \
ecoli-100.gaf \
output.gaf \
--reads reads.fastq \
--threads 8Output:
======================================================================
Results
======================================================================
Lifted: 3,234
New: 2,007
Total: 5,241
======================================================================
from src.core.gfa_parser import parse_gfa_file
from src.core.gaf_handler import GAFReader
from src.mapper.segment_mapper import AdvancedGraphMapper
# Parse graphs
source = parse_gfa_file("source.gfa")
target = parse_gfa_file("target.gfa")
# Create mapper
mapper = AdvancedGraphMapper(source, target)
mappings = mapper.create_all_mappings(min_identity=0.9)- Kim et al. "AirLift: A Fast and Comprehensive Technique for Remapping Alignments between Reference Genomes"
- GFA Specification
- GraphAligner