1extern crate bio;
2extern crate rust_htslib;
3#[macro_use]
4extern crate log;
5extern crate itertools;
6extern crate itertools_num;
7extern crate rgsl;
8#[macro_use]
9extern crate approx;
10extern crate ndarray;
11extern crate ordered_float;
12extern crate rusty_machine;
13extern crate serde;
14#[macro_use]
15extern crate serde_derive;
16#[macro_use]
17extern crate quick_error;
18extern crate csv;
19#[macro_use]
20extern crate lazy_static;
21extern crate regex;
22extern crate statrs;
23extern crate vec_map;
24
25#[macro_use]
26extern crate cached;
27
28pub mod call;
29pub mod constants;
30pub mod estimation;
31pub mod model;
32pub mod utils;
33
34pub use estimation::alignment_properties::{AlignmentProperties, InsertSize};
35pub use model::likelihood;
36pub use model::priors;
37pub use model::sample::Sample;
38
39quick_error! {
40 #[derive(Debug)]
41 pub enum BCFError {
42 MissingTag(name: String) {
43 description("unexpected missing tag")
44 display("expected tag {} missing from BCF record", name)
45 }
46 InvalidRecord(msg: String) {
47 description("invalid record")
48 display("{}", msg)
49 }
50 }
51}
52
53pub trait Event {
55 fn name(&self) -> &str;
56
57 fn tag_name(&self, prefix: &str) -> String {
58 format!("{}_{}", prefix, self.name().to_ascii_uppercase())
59 }
60
61 fn header_entry(&self, prefix: &str, desc: &str) -> String {
62 format!(
63 "##INFO=<ID={tag_name},Number=A,Type=Float,\
64 Description=\"{desc} {name} variant\">",
65 name = self.name(),
66 desc = desc,
67 tag_name = &self.tag_name(prefix)
68 )
69 }
70}
71
72pub struct ComplementEvent {
74 pub name: String,
76}
77
78impl Event for ComplementEvent {
79 fn name(&self) -> &str {
80 &self.name
81 }
82}
83
84pub struct SimpleEvent {
86 pub name: String,
88}
89
90impl Event for SimpleEvent {
91 fn name(&self) -> &str {
92 &self.name
93 }
94}