Skip to content

Commit fa9c1db

Browse files
committed
Use align_with_existing_indices() to eliminate redundant index building
- Switches from orchestrator.align() to align_with_existing_indices() - Avoids rebuilding GDB/GIX indices for each pairwise alignment - Changes min_identity default from 0.7 to 0.0 (use FastGA default) - Significantly reduces I/O overhead in all-vs-all alignment scenarios
1 parent 392d8d1 commit fa9c1db

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/fastga_integration.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,19 +181,20 @@ impl FastGAIntegration {
181181
}
182182

183183
/// Run FastGA alignment and write output to a temporary PAF file
184+
/// Assumes GDB/GIX indices already exist for the input files
184185
/// Returns the temporary file handle (which auto-deletes when dropped)
185186
pub fn align_to_temp_paf(&self, queries: &Path, targets: &Path) -> Result<NamedTempFile> {
186187
// Create orchestrator to run FastGA binary directly
187188
let orchestrator = fastga_rs::orchestrator::FastGAOrchestrator {
188189
num_threads: self.config.num_threads as i32,
189190
min_length: self.config.min_alignment_length as i32,
190-
min_identity: self.config.min_identity.unwrap_or(0.7),
191+
min_identity: self.config.min_identity.unwrap_or(0.0), // 0.0 means use FastGA default
191192
kmer_freq: self.config.adaptive_seed_cutoff.unwrap_or(10) as i32,
192193
temp_dir: std::env::var("TMPDIR").unwrap_or_else(|_| ".".to_string()),
193194
};
194195

195-
// Run alignment (returns PAF bytes directly)
196-
let paf_output = orchestrator.align(queries, targets)
196+
// Run alignment with existing indices (returns PAF bytes directly)
197+
let paf_output = orchestrator.align_with_existing_indices(queries, targets)
197198
.map_err(|e| anyhow::anyhow!("Failed to run FastGA alignment: {}", e))?;
198199

199200
eprintln!(

0 commit comments

Comments
 (0)