clstr

Crates.ioclstr
lib.rsclstr
version0.1.1
sourcesrc
created_at2024-10-30 15:27:36.594619
updated_at2024-10-30 15:27:36.594619
descriptionA library to parse and write .clstr files from 'CD-HIT', as well as a small binary with simple functionality.
homepagehttps://github.com/tolkit/vscan/tree/main/src/clstr
repositoryhttps://github.com/tolkit/vscan/tree/main/src/clstr
max_upload_size
id1428689
size50,690
Max Brown (Euphrasiologist)

documentation

https://docs.rs/clstr

README

clstr

A small crate to parse and write .clstr files.

API

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(())
}

Binaries

There are two programs clstr topn and clstr tofasta which are used in vscan.

Commit count: 0

cargo fmt