bustools_core 0.16.2

Interacting with the kallisto/bus format of scRNAseq data
Documentation
/// Create a Hashset from a list of elements
#[macro_export]
macro_rules! set {
    ( $( $x:expr ),* ) => {
        {
            let mut temp_vec = ::std::collections::HashSet::new();
            $(
                temp_vec.insert($x);
            )*
            temp_vec
        }
    };
}

/// Create a HashMap from a list of elements
#[macro_export]
macro_rules! hashmap {
    ( $( $x:expr => $y:expr ),* ) => {
        {
            let mut hm = ::std::collections::HashMap::new();
            $(
                hm.insert($x, $y);
            )*
            hm
        }
    };
}

/// create a record (cb, umi, ec, count, flag)
#[macro_export]
macro_rules! record {
    ( $cb:expr, $umi:expr, $ec:expr, $count:expr, $flag:expr ) => {{
        let temp_vec =
            $crate::io::BusRecord { CB: $cb, UMI: $umi, EC: $ec, COUNT: $count, FLAG: $flag };
        temp_vec
    }};
}

#[test]
fn test_ma() {
    // let v = vector!({1,2,3});
    // let s: usize = v.iter().sum();
    // println!("{v:?}, {s}");
    let r = record!(10, 12, 4, 3, 1);
    println!("{r:?}");

    let hm = hashmap!(
        1 => 2,
        3 => 7,
        0 => 1
    );
    println!("{hm:?}");

    let s = set!(1, 2, 3, 4);
    println!("{s:?}");
}