feat: add annotate CLI command for applying genome metadata via CSV
Introduces the `annotate` subcommand to apply genome metadata from an external CSV file to a pre-built k-mer index. The command supports configurable field separators, ID columns, and null markers, while providing a `--dump` option to export current index metadata as sorted CSV. Supporting changes include minor internal refactoring in `obikindex` to use object-level directory accessors and updates to the `csv` dependency.
This commit is contained in:
1 parent
fb31a35c76
commit
fba9c65b1a
7 files changed
+219
-26
No files matched your search
@@ -25,25 +25,25 @@ fn main() -> anyhow::Result<()> {
|
||||
let mut first_mismatch = None;
|
||||
|
||||
for part in 0..n_parts {
|
||||
let index_dir_sparse = sparse.index_dir(part);
|
||||
let index_dir_dense = dense.index_dir(part);
|
||||
|
||||
if !index_dir_sparse.exists() || !index_dir_dense.exists() {
|
||||
let Ok(part_sparse) = sparse.partition(part) else {
|
||||
continue;
|
||||
}
|
||||
};
|
||||
let Ok(part_dense) = dense.partition(part) else {
|
||||
continue;
|
||||
};
|
||||
|
||||
for layer in 0..n_layers {
|
||||
let layer_dir_sparse = sparse.layer_dir(part, layer);
|
||||
let layer_dir_dense = dense.layer_dir(part, layer);
|
||||
|
||||
if !layer_dir_sparse.exists() || !layer_dir_dense.exists() {
|
||||
let Ok(layer_sparse) = part_sparse.layer(layer) else {
|
||||
continue;
|
||||
}
|
||||
};
|
||||
let Ok(layer_dense) = part_dense.layer(layer) else {
|
||||
continue;
|
||||
};
|
||||
|
||||
let presence_sparse = layer_dir_sparse.join("presence");
|
||||
let presence_dense = layer_dir_dense.join("presence");
|
||||
let presence_sparse = layer_sparse.presence_dir();
|
||||
let layer_dir_dense = layer_dense.dir().to_path_buf();
|
||||
|
||||
if !presence_sparse.exists() || !presence_dense.exists() {
|
||||
if !presence_sparse.exists() || !layer_dense.presence_dir().exists() {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user