Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Big refactor on the rust codebase (#692)
save semi-working initial bigsi Rename Leaf to Dataset remove storage from readdata trait basic search working start best_only UKHS save and load, expose draff command move ffi to mod dir split ffi functions initial draff command keeping track of unique kmers with a Nodegraph Fix overcounting, add HLL storage make tests deterministic move Signature from root to submodule move KmerMinHash into submodule fix finch make index consistent with other submodules starting support for multiple signature types move add_sequence and check_compatible to SigsTrait use unimplemented if something is missing initial docs and warnings cleanup move sbt into submodule reorganize sbt module insertion working for SBT Replace derive_builder with typed_builder using fastx parser from rust-bio search saves output Rename Signatures enum to Sketch Move nodegraph into sketch Storage args are a proper enum now explicit sig and dataset conversion Use syntax inspired by czbiohub/extract_kmers for codon table (original commit: https://github.com/czbiohub/extract_kmers/blob/d036145000bff96454ec383b193f8913fc5e2b16/src/codon_table.rs) demo command for counting unique hashes in an SBT implement sbt v4 parsing, and clean up clippy warnings Start replacing the Factory struct with an enum move smrs bin to src/bin split draff commands from smrs fix v4 loading
- Loading branch information
Showing
36 changed files
with
5,160 additions
and
2,627 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
use clap::{load_yaml, App}; | ||
use exitfailure::ExitFailure; | ||
//use human_panic::setup_panic; | ||
use sourmash::cmd::{draff_compare, draff_index, draff_search, draff_signature}; | ||
|
||
fn main() -> Result<(), ExitFailure> { | ||
//setup_panic!(); | ||
|
||
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")).init(); | ||
|
||
let yml = load_yaml!("draff.yml"); | ||
let m = App::from_yaml(yml).get_matches(); | ||
|
||
match m.subcommand_name() { | ||
Some("compute") => { | ||
let cmd = m.subcommand_matches("compute").unwrap(); | ||
let inputs = cmd | ||
.values_of("inputs") | ||
.map(|vals| vals.collect::<Vec<_>>()) | ||
.unwrap(); | ||
|
||
let ksize: usize = cmd.value_of("ksize").unwrap().parse().unwrap(); | ||
let wsize: usize = cmd.value_of("wsize").unwrap().parse().unwrap(); | ||
|
||
draff_signature(inputs, ksize, wsize)?; | ||
} | ||
Some("search") => { | ||
let cmd = m.subcommand_matches("search").unwrap(); | ||
|
||
let index: &str = cmd.value_of("index").unwrap(); | ||
let query: &str = cmd.value_of("query").unwrap(); | ||
|
||
draff_search(index, query)?; | ||
} | ||
Some("compare") => { | ||
let cmd = m.subcommand_matches("compare").unwrap(); | ||
let inputs = cmd | ||
.values_of("inputs") | ||
.map(|vals| vals.collect::<Vec<_>>()) | ||
.unwrap(); | ||
|
||
draff_compare(inputs)?; | ||
} | ||
Some("index") => { | ||
let cmd = m.subcommand_matches("index").unwrap(); | ||
let inputs = cmd | ||
.values_of("inputs") | ||
.map(|vals| vals.collect::<Vec<_>>()) | ||
.unwrap(); | ||
|
||
let output: &str = cmd.value_of("output").unwrap(); | ||
|
||
draff_index(inputs, output)?; | ||
} | ||
_ => { | ||
println!("{:?}", m); | ||
} | ||
} | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: draff | ||
version: "0.0.1" | ||
about: "draff signature commands" | ||
author: Luiz Irber <sourmash@luizirber.org> | ||
|
||
settings: | ||
- SubcommandRequiredElseHelp | ||
|
||
subcommands: | ||
- compute: | ||
about: create a draff signature | ||
settings: | ||
- ArgRequiredElseHelp | ||
args: | ||
- ksize: | ||
help: ksize | ||
short: K | ||
default_value: "9" | ||
takes_value: true | ||
required: false | ||
- wsize: | ||
help: window size | ||
short: W | ||
default_value: "31" | ||
takes_value: true | ||
required: false | ||
- output: | ||
help: alternative output file | ||
short: o | ||
takes_value: true | ||
required: false | ||
- inputs: | ||
help: FASTA files | ||
multiple: true | ||
- index: | ||
about: create a draff index | ||
settings: | ||
- ArgRequiredElseHelp | ||
args: | ||
- output: | ||
help: alternative output file | ||
short: o | ||
takes_value: true | ||
required: false | ||
- inputs: | ||
help: draff signatures | ||
multiple: true | ||
- compare: | ||
about: compare draff signatures | ||
settings: | ||
- ArgRequiredElseHelp | ||
args: | ||
- inputs: | ||
help: draff signatures | ||
multiple: true | ||
- search: | ||
about: search a draff index | ||
settings: | ||
- ArgRequiredElseHelp | ||
args: | ||
- index: | ||
help: index to search | ||
required: true | ||
- query: | ||
help: draff signature to search | ||
required: true |
Oops, something went wrong.