nf-core / nf-core/funcscan

Fix eventual ampcombi_parsetables crash

Open
#489 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement requires-upstream-fix
Dominant language
Nextflow
Stars
119
Forks
40
Avg merge
2d 17h
Merged PRs (30d)
5

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in ampcombi.py at parse_tables and process_sample, especially the pandas merge that receives None instead of a DataFrame. Reproduce the crash with the affected DRAMP input and determine how the pipeline should use a working DRAMP version as its default. Done means ampcombi_parsetables no longer crashes with the provided default dataset.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.