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

--choose behavior #146

Closed
lgmgeo opened this issue Feb 24, 2023 · 5 comments
Closed

--choose behavior #146

lgmgeo opened this issue Feb 24, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@lgmgeo
Copy link

lgmgeo commented Feb 24, 2023

Dear authors,

Thank you for maintaining Truvari!

Would it be possible to add a new "median" behavior in the --choose option?
I mean, when collapsing, Truvari would calculate a median of the POS and END values from the SVs of a cluster and recalculate the SVLEN.

Would that sound interesting to you?

Thanks again for your work,

Best regards,

Véronique

@ACEnglish
Copy link
Owner

Hello,

I'm happy to hear you find Truvari useful.

This is an interesting request. My first reaction is to say no, we won't do that exactly as described. Because truvari doesn't use any sequencing information, I don't feel like it really has the authority to change variant representations. And if we opened the door to changing variants, we'd maybe want to consider options like weighing the median breakpoints based on variant depth or AF. How that information is stored in a VCF can get really messy and I can imagine it becomes a huge development burden. Additionally, one of my main design goals is to have inputs/outputs be cleanly traceable (e.g. every variant representation given to collapse ends up either in the output VCF or the collapsed (i.e. removed) output VCF). So, if Truvari creates brand new variant representations, it gets a little tricky to figure out how to make that traceable - not to mention making it cleanly compatible across all the variant representations possible (e.g. what would the 'median' insertions's ALT sequence be?). Everyone's VCFs look a little different and I don't want to add more expectations on what their VCFs look like nor do I want to add more noise to that mix.

Having said that, I do think it may be reasonable to collect the median information and supplement the output VCF's INFO fields with it. Then, if users are interested in changing their variants, Truvari can help them work it out while taking on none of the variant representation responsibility. An initial design would be to add something like INFO/Median[Start/End/Len] which could be calculated beside INFO/NumCollapsed in the code.

Please let me know what you think of this idea of adding Median annotations.

Have a great day,
~/Adam English

@lgmgeo
Copy link
Author

lgmgeo commented Feb 24, 2023

Thank you so much for your detailed answer, that makes sense to me!

Indeed, adding INFO/Median[Start/End/Len] could be really helpful to explore data from large cohorts.
May I request to also add the minimum start and maximum end in the cluster INFO/[MinStart/MaxEnd]?

Thank you very much for Truvari,

Have a great week-end,

Véronique

@ACEnglish ACEnglish self-assigned this Feb 24, 2023
@ACEnglish ACEnglish added the enhancement New feature or request label Feb 24, 2023
@ACEnglish
Copy link
Owner

Sounds good. I'm going to use this ticket to track the development so feel free to unsubscribe to the notifications.

I was close to cutting a v4.0.0 release with a bunch of changes so I'll use the weekend to figure out if I want to get this in for 4.0 or the inevitable 4.1.

Dev notes:

  • add header definitions of new fields in truvari.collapse.edit_header.
  • populate the INFO fields inside truvari.collapse.annotate_entry
  • clean up the interface for annotate_entry since passing a parameter per-INFO isn't ideal
  • make a new method collapse_boundaries or calculate_position that takes the kept entry and the set of collapsed entries to return the Start/End/Len ranges which will need to be passed to annotate_entry.
  • can call the new method inside truvari.collapse.output_writer
  • this change will break probably all of repo_utils/sub_tests/collapse.sh, so will need to update VCFs in repo_utils/answer_key/collapse

@lgmgeo
Copy link
Author

lgmgeo commented Feb 27, 2023

Great!
Thank you

ACEnglish added a commit that referenced this issue Aug 4, 2023
@ACEnglish
Copy link
Owner

Hello,

It took a while, but I finally found time to build this. The next release will have a collapse flag for--median-info. It adds three new info fields:

##INFO=<ID=CollapseStart,Number=1,Type=Integer,Description="Median start position of collapsed variants">
##INFO=<ID=CollapseEnd,Number=1,Type=Integer,Description="Median end position of collapsed variants">
##INFO=<ID=CollapseSize,Number=1,Type=Integer,Description="Median size of collapsed variants">

Note that I didn't test this extensively. So let me know how it goes.

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

No branches or pull requests

2 participants