open2c / pairtools

Extract 3D contacts (.pairs) from sequencing alignments
MIT License
104 stars 32 forks source link

'xcats' positional argument error in coverage_by_chrom #197

Open laramiemckenna opened 11 months ago

laramiemckenna commented 11 months ago

Hi there, I recently came across pairtools and I am super excited to start implementing it in our workflows. I tried to visualize the stats file via multiqc, but encountered this error. Do you have any thoughts as to what might be contributing to this? If it is helpful, I've attached the mc3_hap1_pairtools.stats file.

mc3_hap1_pairtools.stats.txt

If it would be better to share this on https://github.com/open2c/MultiQC, let me know.

  /// MultiQC 🔍 | v1.12.dev0

|           multiqc | MultiQC Version v1.19 now available!
|           multiqc | Search path : /cluster/home/lasmith/mc3_hap1_pairtools.stats
|         searching | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 1/1  
|         pairtools | parsing .stats file: mc3_hap1_pairtools.stats
|         pairtools | Found 1 reports
╭─────────────────────────────────────────────────────── Oops! The 'pairtools' MultiQC module broke... ────────────────────────────────────────────────────────╮
│ Please copy this log and report it at https://github.com/ewels/MultiQC/issues                                                                                │
│ Please attach a file that triggers the error. The last file found was: mc3_hap1_pairtools.stats                                                              │
│                                                                                                                                                              │
│ Traceback (most recent call last):                                                                                                                           │
│   File "/cluster/home/lasmith/miniforge3/envs/multiqc_pt/lib/python3.6/site-packages/multiqc/multiqc.py", line 651, in run                                   │
│     output = mod()                                                                                                                                           │
│   File "/cluster/home/lasmith/miniforge3/envs/multiqc_pt/lib/python3.6/site-packages/multiqc/modules/pairtools/pairtools.py", line 187, in __init__          │
│     plot=self.coverage_by_chrom(),                                                                                                                           │
│   File "/cluster/home/lasmith/miniforge3/envs/multiqc_pt/lib/python3.6/site-packages/multiqc/modules/pairtools/pairtools.py", line 444, in coverage_by_chrom │
│     return heatmap.plot([])                                                                                                                                  │
│ TypeError: plot() missing 1 required positional argument: 'xcats'                                                                                            │
│                                                                                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|           multiqc | No analysis results found. Cleaning up..
|           multiqc | MultiQC complete
golobor commented 11 months ago

@sergpolly , could we ask you for your help? :)

sergpolly commented 11 months ago

HI @laramiemckenna , pairtools module of multiqc hasn't been updated for some time. I apologize for its state ! It is supposed to make it to the main multiqc repository eventually ...

That being said it typically runs without many issues, so let's try to investigate:

laramiemckenna commented 11 months ago

Hi @sergpolly and @golobor ,

Thank you both for the quick response!

I installed it based on the write-up you shared in your comment using pip install --upgrade --force-reinstall git+https://github.com/open2c/MultiQC.git in an isolated environment with Python 3.6 as the base.

However, I was able to get it to work, but only in a very particular context that I thought you might want to know about:

Yesterday, I was excited to see the results from the .stats output of pairtools parse2 and so I attempted to run multiqc . and, alternatively, multiqc mc3_hap1_pairtools.stats on it before pairtools dedup had finished running and produced its own .stats file.

Earlier today, after pairtools dedup had completed, I went to troubleshoot it some more and it worked perfectly with multiqc .. Some more investigating revealed that both .stats files were required for multiqc to produce a report. If I moved either .stats file to the parent directory, then I would get the error I shared above.

Are both .stats files required for multiqc to work?

jolbi commented 9 months ago

Hi,

I am facing a similar issue. Multiqc does not find any compatible file in the directory with stats file. I only have the stats file of pairtools dedup step, so based on laramiemckenna comment it seems this might be the problem.

Do I need stats file from pairtools parse step also? Is it possible to produce the stats file for pairtools parse step without rerunning it (my mapping pipeline runs for 2 days on 100 threads and I have a few of those and no intermediate bams...)?

I Installed mutliqc from the fork provided in the docs (v1.21.dev0).