-
Notifications
You must be signed in to change notification settings - Fork 79
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
How to operate on Format/Info fields for Records? #405
Comments
I am having the exact same issue with string values in INFO fields. I am struggling to convert the |
I found a way to access the value in let Some(u) = record.info(b"MQ").float().expect("Error accessing INFO MQ") else { todo!() };
println!("{:#?}", u[0]);
let v = record.format(b"DP").integer().expect("Error accessing FORMAT DP");
println!("{:#?}", v[0]);
|
I'm having trouble accessing/using FORMAT/INFO fields from vcf
Record
s and the documentation isn't clear on how to be able to do anything with the data types returned via the API. Here's an example code snippet:It's not clear that
i
can be used for any computation, and it especially seems likei
cannot be coerced into aVec<u32>
in any way I can see. How can I actually do any computation with this sort of value? For example, suppose I wanted to add up the values in the vector ofDP
values in my vcf. How would I achieve that with these data types? Given thatu32
implementsCopy
, ideally I'd like to be able to copy the wrapped value to an owned type and do something with that.What's the reason behind wrapping these values in the
BufferBacked
type, and what is that type actually doing? There are warnings in the docs about keeping it in scope to handle some memory issues, but not much more on how to use these types.The text was updated successfully, but these errors were encountered: