eastgenomics / eggd_generate_variant_workbook

DNAnexus app for generating xlsx variant workbooks
3 stars 0 forks source link

COSMIC URL link not generated when CSQ_COSMICcMuts is added as an include parameter #177

Open Aisha-D opened 3 months ago

Aisha-D commented 3 months ago

Failed Job: https://platform.dnanexus.com/panx/projects/GfFBpgj47xBp7qq7jV53pv68/monitor/job/GgkGQg047xBbK55Fbx4g4gyj

The testing COSMIC was only ever done without the CSQ_COSMICcMuts added as an --include parameter. The annotation is presents in the workbook if --include left as default blank.

If it is included as an --include parameter then an error is raised:

Traceback (most recent call last):
  File "resources/home/dnanexus/generate_workbook/generate_workbook.py", line 469, in <module>
    main()
  File "resources/home/dnanexus/generate_workbook/generate_workbook.py", line 456, in main
    vcf_handler.process()
  File "/home/aisha/Documents/Projects/git/eggd_generate_variant_workbook/resources/home/dnanexus/generate_workbook/utils/vcf.py", line 184, in process
    self.vcfs = self.add_hyperlinks(self.vcfs)
  File "/home/aisha/Documents/Projects/git/eggd_generate_variant_workbook/resources/home/dnanexus/generate_workbook/utils/vcf.py", line 523, in add_hyperlinks
    vcfs[idx][col] = vcfs[idx].apply(
  File "/home/aisha/miniconda3/lib/python3.8/site-packages/pandas/core/frame.py", line 8833, in apply
    return op.apply().__finalize__(self, method="apply")
  File "/home/aisha/miniconda3/lib/python3.8/site-packages/pandas/core/apply.py", line 727, in apply
    return self.apply_standard()
  File "/home/aisha/miniconda3/lib/python3.8/site-packages/pandas/core/apply.py", line 851, in apply_standard
    results, res_index = self.apply_series_generator()
  File "/home/aisha/miniconda3/lib/python3.8/site-packages/pandas/core/apply.py", line 867, in apply_series_generator
    results[i] = self.f(v)
  File "/home/aisha/Documents/Projects/git/eggd_generate_variant_workbook/resources/home/dnanexus/generate_workbook/utils/vcf.py", line 524, in <lambda>
    lambda x: self.make_hyperlink(
  File "/home/aisha/Documents/Projects/git/eggd_generate_variant_workbook/resources/home/dnanexus/generate_workbook/utils/vcf.py", line 578, in make_hyperlink
    url = url.replace('REF', str(value.REF))
  File "/home/aisha/miniconda3/lib/python3.8/site-packages/pandas/core/generic.py", line 5583, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'Series' object has no attribute 'REF'
jethror1 commented 3 months ago

I don't think that is the root cause here, when you specify --include you don't have REF and ALT, which are required for generating some of the hyperlinks (which is all done here: https://github.com/eastgenomics/eggd_generate_variant_workbook/blob/19ae99946fc0a4709df18a6892e98e02f3b16d5c/resources/home/dnanexus/generate_workbook/utils/utils.py#L128)

I think chrom, pos, ref and alt are the only required ones, which are used for gnomAD, then things like symbol are required for others if those columns are present.

You could also use --exclude instead and define columns you don't want

Aisha-D commented 3 months ago

Could the hyperlinks not be made prior to exclusion of the other columns, the data is there. Im using the --exclude parameter for now but thought to raise a proper error.