SACGF / variantgrid

VariantGrid public repo
Other
23 stars 2 forks source link

Error exporting analysis grid to VCF #1043

Open davmlaw opened 2 months ago

davmlaw commented 2 months ago

Found in unit tests:

======================================================================
ERROR: testVariantGridExport (analysis.tests.test_urls.Test.testVariantGridExport)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/dlawrence/localwork/variantgrid/analysis/tests/test_urls.py", line 204, in testVariantGridExport
    self._testVariantGridExport(export_type)
  File "/home/dlawrence/localwork/variantgrid/analysis/tests/test_urls.py", line 199, in _testVariantGridExport
    response.getvalue()  # Read streaming content
    ^^^^^^^^^^^^^^^^^^^
  File "/home/dlawrence/localwork/variantgrid/env/lib/python3.11/site-packages/django/http/response.py", line 528, in getvalue
    return b"".join(self.streaming_content)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dlawrence/localwork/variantgrid/env/lib/python3.11/site-packages/django/test/client.py", line 112, in closing_iterator_wrapper
    yield from iterable
  File "/home/dlawrence/localwork/variantgrid/analysis/views/views_grid.py", line 314, in iter_row_writer
    record = _grid_item_to_vcf_record(info_dict, obj, sample_ids, samples)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dlawrence/localwork/variantgrid/analysis/views/views_grid.py", line 354, in _grid_item_to_vcf_record
    ad = obj[f"{sample_id}_samples_allele_depth"]
         ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: '7_samples_allele_depth'

Verified can occur via user action:

http://test.variantgrid.com/analysis/59/node_grid/export/?node_id=381&version_id=1&ccc_id=1&ccc_version_id=139&extra_filters=default&zygosity_samples_hash=b6d767d2f8ed5d21a44b0e5886680cb9&_search=false&nd=1713403907972&rows=0&page=1&sidx=pk&sord=asc&export_type=vcf&use_canonical_transcripts=undefined

davmlaw commented 1 month ago

Not in Shariant, vg test only

davmlaw commented 1 month ago

tested vg test - PASSED

could export bottom node 381 from http://test.variantgrid.com/analysis/59/ - what is used in test above, though version has changed so link is broken