Skip to content

Granges from par_iter? #11

Description

@cademirch

Hi @vsbuffalo, thanks for the super useful crate. I'm working on a small project calculating some stats from a VCF, and am processing records in parallel using rayon::iter::par_bridge and would like to make a GRanges object from this parallel iterator.

For example:

    let records = reader
        .records()
        .par_bridge()
        .map(|result| {
            let record = result.expect("failed to read VCF record");
            // Do something with record and get data; get chrom, position
            
            Ok(GenomicRangeRecord::new(chrom.to_string(), position, position+1, data))
        });
        
// Make GRanges from records parallel iterator

I'm still fairly new to rust but would be happy to look into implementing this if you're open to it and some pointers on where to start.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions