Add TNT configuration directives and tree export commands to script

Updates the generated TNT script with configuration parameters and appends tree management commands for saving and exporting results. Modifications are strictly limited to string literals written to the output stream.
This commit is contained in:
Eric Coissac
2026-08-17 11:39:51 +02:00
parent 70b0527957
commit 8de0c0907f
3 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -1793,7 +1793,7 @@ dependencies = [
[[package]] [[package]]
name = "obikmer" name = "obikmer"
version = "1.1.44" version = "1.2.0"
dependencies = [ dependencies = [
"clap", "clap",
"csv", "csv",
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "obikmer" name = "obikmer"
version = "1.1.44" version = "1.2.0"
edition = "2024" edition = "2024"
[[bin]] [[bin]]
+5 -3
View File
@@ -46,6 +46,10 @@ pub(super) fn write_sankoff_tnt(
let n_sites = alignment.sequences.first().map(|s| s.len()).unwrap_or(0); let n_sites = alignment.sequences.first().map(|s| s.len()).unwrap_or(0);
writeln!(f, "xread").unwrap(); writeln!(f, "xread").unwrap();
writeln!(f, "mxram 16000;").unwrap();
writeln!(f, "taxname =;").unwrap();
writeln!(f, "taxname +50;").unwrap();
writeln!( writeln!(
f, f,
"'obikmer central-position SNP families, calibrated Sankoff 16-state encoding'" "'obikmer central-position SNP families, calibrated Sankoff 16-state encoding'"
@@ -166,9 +170,7 @@ pub(super) fn write_sankoff_tnt(
writeln!(f, ";").unwrap(); writeln!(f, ";").unwrap();
writeln!(f, "hold 20;").unwrap(); writeln!(f, "hold 20;").unwrap();
writeln!(f, "mult;").unwrap(); writeln!(f, "mult;").unwrap();
writeln!(f, "taxname =;").unwrap(); writeln!(f, "export - {tre_name};").unwrap();
writeln!(f, "tsave * {tre_name};").unwrap();
writeln!(f, "tsave /;").unwrap();
info!( info!(
"TNT script → {path} (costs scaled x{cost_scale:.0}, runs a default `hold 20; mult;` \ "TNT script → {path} (costs scaled x{cost_scale:.0}, runs a default `hold 20; mult;` \