Split VCF line in builder and storage object#18
Merged
tcezard merged 2 commits intoEBIvariation:mainfrom Dec 2, 2025
Merged
Conversation
khetherin
reviewed
Dec 1, 2025
| pragmas_to_add.append(generate_vcf_header_unstructured_line(vcf_header_key, pragma_value)) | ||
| for vcf_obj in list_of_vcf_objects: | ||
| pragmas_to_add.append(generate_vcf_header_unstructured_line("source", vcf_obj.source)) | ||
| # FIXME: Why are we adding header from the VCF lines |
Collaborator
There was a problem hiding this comment.
Adding the source (displayed in VCF header as: ##source=DGVa). This comes from the GVF feature line. Alsopragmas_to_add is probably a misleading name, these were GVF pragmas that have been converted to VCF header.
khetherin
reviewed
Dec 1, 2025
| unique_info_lines_to_add = list(dict.fromkeys(info_line for info_line in standard_lines_dictionary["INFO"] if info_line not in unique_info_lines_to_add)) | ||
| unique_filter_lines_to_add = list(dict.fromkeys(filter_line for filter_line in standard_lines_dictionary["FILTER"] if filter_line not in unique_filter_lines_to_add)) | ||
| unique_format_lines_to_add = list(dict.fromkeys(format_line for format_line in standard_lines_dictionary["FORMAT"] if format_line not in unique_format_lines_to_add)) | ||
| # TODO: The addition of headers from the VCF lines should be done in the VCF builder |
Collaborator
There was a problem hiding this comment.
I agree with the TODO. I also think the function generate_vcf_header_metainfo could be simplified.
khetherin
reviewed
Dec 1, 2025
|
|
||
| # This is the main conversion logic | ||
| def convert_gvf_features_to_vcf_objects(gvf_lines_obj_list, reference_lookup): | ||
| def convert_gvf_features_to_vcf_objects(gvf_lines_obj_list, reference_lookup, ordered_list_of_samples): |
Collaborator
There was a problem hiding this comment.
Having an ordered_list_of_Samples is a good idea and will be useful in this function. Getting this ordered list will need to come from the GVF pragmas and should be done early on.
khetherin
reviewed
Dec 1, 2025
| self.info_dict = merged_info_dict | ||
| other_vcf_line.info_dict = merged_info_dict | ||
|
|
||
| def merge_vcf_values_for_format(self, other_vcf_line): |
khetherin
approved these changes
Dec 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.