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

vcf2maf not converting missing AD values to 0 #58

Open
edoyango opened this issue Sep 11, 2023 · 0 comments
Open

vcf2maf not converting missing AD values to 0 #58

edoyango opened this issue Sep 11, 2023 · 0 comments

Comments

@edoyango
Copy link

Hi,

We're looking at using vcf2maf to prepare our VCF files for import into cBioPortal, but I've run into the issue:

$ python3 vcf2maf.py -i ../vcf-noann-FTatleast1PASS/solace2-0003.vcf --tumor-id tumour --normal-id germline
Loading data from file: ../vcf-noann-FTatleast1PASS/solace2-0003.vcf
Traceback (most recent call last):
  File "/vast/projects/staffordfox-cbioportal/genome-nexus_annotation-tools/vcf2maf.py", line 1640, in <module>
    main()
  File "/vast/projects/staffordfox-cbioportal/genome-nexus_annotation-tools/venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/vast/projects/staffordfox-cbioportal/genome-nexus_annotation-tools/venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/vast/projects/staffordfox-cbioportal/genome-nexus_annotation-tools/venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/vast/projects/staffordfox-cbioportal/genome-nexus_annotation-tools/venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/vast/projects/staffordfox-cbioportal/genome-nexus_annotation-tools/vcf2maf.py", line 1628, in main
    generate_maf_from_input_data(
  File "/vast/projects/staffordfox-cbioportal/genome-nexus_annotation-tools/vcf2maf.py", line 1552, in generate_maf_from_input_data
    maf_data = extract_vcf_data_from_file(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/vast/projects/staffordfox-cbioportal/genome-nexus_annotation-tools/vcf2maf.py", line 1496, in extract_vcf_data_from_file
    maf_record = create_maf_record_from_vcf(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/vast/projects/staffordfox-cbioportal/genome-nexus_annotation-tools/vcf2maf.py", line 1048, in create_maf_record_from_vcf
    resolve_vcf_counts_data(
  File "/vast/projects/staffordfox-cbioportal/genome-nexus_annotation-tools/vcf2maf.py", line 630, in resolve_vcf_counts_data
    (t_ref_count, t_alt_count, t_depth) = resolve_vcf_allele_depth_values(
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/vast/projects/staffordfox-cbioportal/genome-nexus_annotation-tools/vcf2maf.py", line 511, in resolve_vcf_allele_depth_values
    mapped_sample_format_data["DP"] = str(sum(map(float, allele_depth_values)))
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: could not convert string to float: ''

I believe this is because .,237 is the AD value, and the . is being converted to an empty string, which is not accepted by float. I've traced this back to line 341.

        # attempt to parse values as int - if not an int then set value to empty string
        allele_depth_values = []
        for value in mapped_sample_format_data["AD"].split(","):
            if is_valid_integer(value):
                allele_depth_values.append(value)
            else:
                allele_depth_values.append("")

Should "0" be appended instead of ""? For our data, this would make sense.

Please let me know how best to resolve this, and I will create a pull request.

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

No branches or pull requests

1 participant