lorikeet_genome/
lib.rs

1#![allow(
2    non_upper_case_globals,
3    non_snake_case,
4    non_camel_case_types
5)]
6// extern crate openssl;
7// extern crate openssl_sys;
8
9pub mod abundance;
10pub mod activity_profile;
11pub mod ani_calculator;
12pub mod annotator;
13pub mod assembly;
14pub mod bam_parsing;
15pub mod cli;
16pub mod evolve;
17pub mod external_command_checker;
18pub mod genotype;
19pub mod graphs;
20pub mod haplotype;
21pub mod linkage;
22pub mod model;
23pub mod pair_hmm;
24pub mod processing;
25pub mod read_error_corrector;
26pub mod read_orientation;
27pub mod read_threading;
28pub mod reads;
29pub mod reference;
30pub mod smith_waterman;
31pub mod test_utils;
32pub mod utils;
33
34// Stats
35#[macro_use]
36extern crate ndarray;
37// Utilities
38#[macro_use]
39extern crate enum_ordinalize;
40#[macro_use]
41extern crate log;
42#[macro_use]
43extern crate lazy_static;
44#[macro_use]
45extern crate serde_derive;
46#[macro_use]
47extern crate approx;
48
49use std::process;
50
51pub const AUTHOR: &str =
52    "Rhys J. P. Newell, Centre for Microbiome Research, School of Biomedical Sciences, Faculty of Health, Queensland University of Technology";
53pub const AUTHOR_AND_EMAIL: &str =
54    "Rhys J. P. Newell, Centre for Microbiome Research, School of Biomedical Sciences, Faculty of Health, Queensland University of Technology <rhys.newell94 near gmail.com>";
55
56pub fn parse_percentage(m: &clap::ArgMatches, parameter: &str) -> f32 {
57    match m.contains_id(parameter) {
58        true => {
59            let mut percentage: f32 = *m.get_one(parameter).unwrap();
60            if percentage >= 1.0 && percentage <= 100.0 {
61                percentage = percentage / 100.0;
62            } else if percentage < 0.0 || percentage > 100.0 {
63                error!("Invalid alignment percentage: '{}'", percentage);
64                process::exit(1);
65            }
66            info!("Using {} {}%", parameter, percentage * 100.0);
67            percentage
68        }
69        false => 0.0,
70    }
71}
72
73// Enum for exclusion out here so long read can find it
74pub enum GenomeExclusionTypes {
75    SeparatorType,
76    NoneType,
77    GenomesAndContigsType,
78}