Skip to content

How to write bigWig when input comes from memory (e.g. 3 vectors) instead of a file? #8

Answered by jackh726
ghuls asked this question in Q&A
Discussion options

You must be logged in to vote

Just pushed some changes to make this a bit nicer (don't have to call to_string() and don't need to Ok wrap):

let chroms = vec![
    "chrY", "chrY", "chrY", "chrY", "chrY", "chrY", "chrY", "chrY", "chrY", "chrY",
];
let starts: Vec<u32> = vec![530, 538, 584, 713, 751, 860, 865, 873, 879, 902];
let ends: Vec<u32> = vec![538, 584, 713, 751, 860, 865, 873, 879, 902, 923];

let iter = chroms
    .into_iter()
    .zip(starts.into_iter().zip(ends.into_iter()));
let iter = iter.map(|(chrom, (start, end))| {
    (
        chrom,
        Value {
            start,
            end,
            value: 0.0,
        },
    )
});

let vals_iter = BedParserStreamingIterator::new(BedParser::wrap_infallib…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by jackh726
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants