nf-core / modules

Repository to host tool-specific module files for the Nextflow DSL2 community!
https://nf-co.re/modules
MIT License
283 stars 717 forks source link

[BUG] optitype test fails after updating file input #783

Closed JoseEspinosa closed 1 year ago

JoseEspinosa commented 3 years ago

After updating the input file for the optitype module, see here, the test fail with the following error message:

WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
  [E::idx_find_and_load] Could not retrieve index file for 'test2.paired_end.sorted.bam'
  Traceback (most recent call last):
    File "/usr/local/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 2891, in get_loc
      return self._engine.get_loc(casted_key)
    File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
    File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
    File "pandas/_libs/hashtable_class_helper.pxi", line 1675, in pandas._libs.hashtable.PyObjectHashTable.get_item
    File "pandas/_libs/hashtable_class_helper.pxi", line 1683, in pandas._libs.hashtable.PyObjectHashTable.get_item
  KeyError: 'chr22:16570000-16610000'

  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
    File "/usr/local/bin/OptiTypePipeline.py", line 366, in <module>
      alleles_to_keep = list(filter(is_frequent, binary.columns))
    File "/usr/local/bin/OptiTypePipeline.py", line 142, in is_frequent
      return table.loc[allele_id]['4digit'] in freq_alleles and table.loc[allele_id]['flags'] == 0 or (table.loc[allele_id]['locus'] in 'HGJ')
    File "/usr/local/lib/python3.8/site-packages/pandas/core/indexing.py", line 879, in __getitem__
      return self._getitem_axis(maybe_callable, axis=axis)
    File "/usr/local/lib/python3.8/site-packages/pandas/core/indexing.py", line 1110, in _getitem_axis
      return self._get_label(key, axis=axis)
    File "/usr/local/lib/python3.8/site-packages/pandas/core/indexing.py", line 1059, in _get_label
      return self.obj.xs(label, axis=axis)
    File "/usr/local/lib/python3.8/site-packages/pandas/core/generic.py", line 3488, in xs
      loc = self.index.get_loc(key)
    File "/usr/local/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 2893, in get_loc
      raise KeyError(key) from err
  KeyError: 'chr22:16570000-16610000'

I drafted PR #782 so that we can work in the solving of the issue together, ping @drpatelh and @apeltzer

muffato commented 1 year ago

782 got completed a few weeks later