Crates.io | clstr |
lib.rs | clstr |
version | 0.1.1 |
source | src |
created_at | 2024-10-30 15:27:36.594619 |
updated_at | 2024-10-30 15:27:36.594619 |
description | A library to parse and write .clstr files from 'CD-HIT', as well as a small binary with simple functionality. |
homepage | https://github.com/tolkit/vscan/tree/main/src/clstr |
repository | https://github.com/tolkit/vscan/tree/main/src/clstr |
max_upload_size | |
id | 1428689 |
size | 50,690 |
clstr
A small crate to parse and write .clstr
files.
A really simple example which just reads in a file and prints it.
use std::fs::File;
use std::io::{BufReader, BufWriter};
use std::path::Path;
fn main() -> Result<(), std::error::Error> {
// Define the input and output file paths
let input_path = Path::new("input.clstr");
let output_path = Path::new("output.clstr");
// make the parser
let parser = clstr::from_path(input_path)?;
// and the writer
let clstr_writer = clstr::to_path(output_path)?;
for cluster_res in parser {
let cluster = cluster_res?;
clstr_writer.write_cluster(&cluster)?;
}
clstr_writer.flush()?;
Ok(())
}
There are two programs clstr topn
and clstr tofasta
which are used in vscan
.