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

Annotate writes GAF too and fix to unwanted GAM dumping to stdout #4364

Closed
wants to merge 3 commits into from

Conversation

jmonlong
Copy link
Contributor

@jmonlong jmonlong commented Aug 1, 2024

Changelog Entry

To be copied to the draft changelog by merger:

  • vg annotate can output alignments in GAF.
  • When reading more than 1000 BED or GFF records, vg will no longer dump the first records to standard output and forget about them.

Description

In #4363, @adamnovak is fixing the bug I introduced when flushing the output buffer when vg annotate output alignments. I happened to have also noticed and corrected this when I added a GAF output option to vg annotate.

Basically, I added an optional AlignmentEmitter which, when provided, will be used to write the alignments. That emitter can be set to output either GAM or GAF. In vg annotate, we prepare an emitter and pass it to the function that parses the regions, and it outputs the alignments (flushing every 1000 alignments). In the rest of the code, where an emitter is not passed, it will return the vector of alignments and not do any GAM dumping and buffer flushing.

@adamnovak
Copy link
Member

I think we probably want to glom both of these together; we want to use the AlignmentEmitter, but I think it also makes the most sense for the reader to use a callback to keep the input task and the output task separate, instead of having output logic make its way in there in case the caller was hoping to do output.

@jmonlong
Copy link
Contributor Author

jmonlong commented Aug 1, 2024

Sounds good, I think I understand your code so I can give it a try if you want.

@adamnovak
Copy link
Member

I already merged them and put it into #4363.

@jmonlong
Copy link
Contributor Author

jmonlong commented Aug 1, 2024

Thanks @adamnovak !

@jmonlong
Copy link
Contributor Author

jmonlong commented Aug 1, 2024

Closing this one then.

@jmonlong jmonlong closed this Aug 1, 2024
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.

2 participants