Skip to main content

run

Function run 

Source
pub fn run(
    seqfile: &Path,
    work_dir: &Path,
    config: &IseConfig,
) -> Result<Vec<Call>, String>
Expand description

Run the IS-element detection pipeline on a genome FASTA, returning the calls.

work_dir is where the intermediate files (proteome.faa, mmseqs isscan_tmp/) are written; the caller owns it and any cleanup. Requires the mmseqs binary on PATH and a valid IS DB at config.db_dir. This is the exact pipeline the rust-ise binary runs (the binary just parses args and writes the TSV/GFF/.sum from the returned calls).

Examples found in repository?
examples/lib_run.rs (line 18)
6fn main() {
7    let mut a = std::env::args().skip(1);
8    let seqfile = a.next().expect("usage: lib_run <genome.fna> <db_dir> [work_dir]");
9    let db = a.next().expect("need db_dir");
10    let work = a.next().unwrap_or_else(|| "/tmp/rustise_lib_work".into());
11
12    let cfg = IseConfig {
13        threads: 8,
14        gpu: false,
15        strict: false,
16        db_dir: PathBuf::from(db),
17    };
18    let calls = run(Path::new(&seqfile), Path::new(&work), &cfg).expect("run");
19    for c in &calls {
20        println!(
21            "{}\t{}\t{}..{}\t{}\t{}\t{}",
22            c.seqid, c.family, c.is_begin, c.is_end, c.strand, c.tier, c.fp_flag
23        );
24    }
25    eprintln!("{} IS calls", calls.len());
26}