Module bustools::bus_multi

source ·
👎Deprecated since 0.11.1: please use merger instead
Expand description

A module that allows iteration of multiple busfiles simulatniously

One can iterate e.g. two busfiles, going through it cell-by-cell, i.e. if the same cell is present in both files, we get their BusRecords in a single emission

§Example

use crate::bustools::iterators::CbUmiGroupIterator;
// two busfiles, named
let hashmap = HashMap::from([
    ("test1".to_string(), BusReader::new("/tmp/some1.bus").groupby_cbumi()),
    ("test2".to_string(), BusReader::new("/tmp/some2.bus").groupby_cbumi())
]);
let iii = CellUmiIteratorMulti::new(hashmap); //warning: this triggers the .next() method for both ierators once, consuming the cell 0

for (cb, emission_dict) in iii{
    // get the records wrt to cb
    // if the file doesnt contain that cell
    // emission_dict wont contain an entry
    let records1 = emission_dict.get("test1");
    let records2 = emission_dict.get("test2");
}

§Structure

Taking multiple iterators over busfiles, we merge them into a new iterator which emits the cell (cell/umi) and a dictionary. The dict contains the file identifiers a keys, and values are a Vec of BusRecords with that cell (cell/umi) in the respective file There’s two main iterators in here

  • CellIteratorMulti -> iterate, grouping by cell
  • CellUmiIteratorMulti -> iterate, grouping bt cell/umi

Structs§