Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Granges from par_iter? #11

Open
cademirch opened this issue Sep 20, 2024 · 0 comments
Open

Granges from par_iter? #11

cademirch opened this issue Sep 20, 2024 · 0 comments

Comments

@cademirch
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant