funcscan icon indicating copy to clipboard operation
funcscan copied to clipboard

Fix eventual ampcombi_parsetables crash

Open jasmezz opened this issue 4 months ago • 0 comments

Description of feature

In some cases, ampcombi_parsetables crashes when using certain DRAMP database version. Unfortunately, the versions cannot be tracked because the maintainers simply don't provide them, only the current version. So it's hard to debug if the provided DRAMP version is the culprit.

Observed behaviour

The error message looks like this:

Traceback (most recent call last):
    File "/usr/local/bin/ampcombi", line 10, in <module>
      sys.exit(main())
               ^^^^^^
    File "/usr/local/bin/ampcombi.py", line 492, in main
      args.func(args)  # call the default function
      ^^^^^^^^^^^^^^^
    File "/usr/local/bin/ampcombi.py", line 467, in parse_table_log
      log_output('Ampcombi_parse_tables.log', args, parse_tables)
    File "/usr/local/bin/ampcombi.py", line 453, in log_output
      func(args)
    File "/usr/local/bin/ampcombi.py", line 258, in parse_tables
      process_sample(
    File "/usr/local/bin/ampcombi.py", line 323, in process_sample
      sample_summary_df = pd.merge(summary_df_filtered, mmseqs_df, left_on='contig_id', right_on='query', how='left')
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/site-packages/pandas/core/reshape/merge.py", line 110, in merge
      op = _MergeOperation(
           ^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/site-packages/pandas/core/reshape/merge.py", line 645, in __init__
      _right = _validate_operand(right)
               ^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/site-packages/pandas/core/reshape/merge.py", line 2426, in _validate_operand
      raise TypeError(
  TypeError: Can only merge Series or DataFrame objects, a <class 'NoneType'> was passed

Proposed solution

Upload a working DRAMP version to nf-core/testdatasets or Zenodo and use that as pipeline default. Users can then always provide their own up-to-date ones, but have a fallback solution if the current version is faulty.

jasmezz avatar Jul 22 '25 14:07 jasmezz