Skip to content

Add optional Desc field to set the description in the header.#33

Open
roryk wants to merge 1 commit intobrentp:masterfrom
roryk:master
Open

Add optional Desc field to set the description in the header.#33
roryk wants to merge 1 commit intobrentp:masterfrom
roryk:master

Conversation

@roryk
Copy link

@roryk roryk commented Aug 11, 2016

HI Brent,

This adds a Desc field to the annotation configuration so you can override what the description of the field is in the header. Go is new to me so let me know if I screwed anything up.


Note

Adds optional Desc to annotation config and sources, using it to override INFO header descriptions.

  • API:
    • api.Source: add Desc field and use it in UpdateHeader to override auto-generated descriptions.
  • Shared:
    • shared.Annotation: add Desc field and propagate it in Flatten to Source.

Written by Cursor Bugbot for commit a843cf3. This will update automatically on new commits. Configure here.

@roryk
Copy link
Author

roryk commented Aug 11, 2016

The tests don't work for me-- I think there are some hard-coded paths in there, so I couldn't run them. I checked with and without the description though on my test file and it works ok.

@brentp
Copy link
Owner

brentp commented Aug 12, 2016

I'm a little hesitant about this because I want to keep the .conf stuff as light as possible so that it's not intimidating to write (or to read the docs about it). Do you really need to customize the Description?

@roryk
Copy link
Author

roryk commented Aug 12, 2016

Hi @brentp,

Thanks for the response. I think maybe I'll end up editing it, to try to avoid fielding endless questions about what something like:

##INFO=<ID=possible_rnaedit,Number=0,Type=Flag,Description="calculated by lua:is_edit_flag(ref, alt) of overlapping values in column 4 from RADAR.bed.gz">

means. But I totally hear you about feature creep making stuff turn into a complicated mess. I can replace it after, it doesn't have to be something done in vcfanno for sure.

@brentp
Copy link
Owner

brentp commented Aug 12, 2016

oh, I see. Let me think on it.

@brentp
Copy link
Owner

brentp commented Aug 13, 2016

what about changing the description to something more generic like:

caclulated from overlapping values in columns 4 of RADAR.bed.gz

?
Instead of adding Desc to the config?

@roryk
Copy link
Author

roryk commented Aug 14, 2016

Hi Brent,

'calculated from overlapping values in columns 4' doesn't really describe how we got there though, since there is some other logic that went in it. For this example we did some checking if it was a SNP and if it was a valid edit event, etc. Maybe that is information handled better outside of the VCF file though, looking at the other INFO field descriptions they aren't too descriptive.

Thanks!

@roryk roryk closed this Aug 14, 2016
@hkeward
Copy link

hkeward commented Nov 4, 2025

+1 to being able to override the description in the config; I want to be able to add context about what that column actually contains. I will reheader after the fact, but it would be nice to be able to set descriptions directly through vcfanno.

@brentp brentp reopened this Nov 5, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

if (s.Op == "first" || s.Op == "self") && htype == ntype {
if (s.Desc != "") {
desc = s.Desc
} else if (s.Op == "first" || s.Op == "self") && htype == ntype {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Description Interference with DP2 Type/Number Metadata

When s.Desc is set (not empty), the if-else chain will skip the DP2 field handling at lines 386-389, which not only sets the description but also critically sets number = "2" and ntype = "Integer". This means that if a user provides a custom description for a DP2 field, the VCF header will have incorrect type and number metadata. The logic for setting number and ntype should be separated from description generation so that custom descriptions don't bypass field-specific type/number settings.

Fix in Cursor Fix in Web

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

Successfully merging this pull request may close these issues.

4 participants