MultiQC report: custom plugin for zpca
Addressing #146 (closed).
- bumped-up
multiqc-plugins
container version in the Snakefile - specified parsing rules in the MultiQC configfile generating script
Merge request reports
Activity
changed milestone to %downstream
added Doing downstream labels
It seems that the
zpca
plugin crashed on the integration test dataset (but it passed on GCN4). I will have to investigate deeper.Crash logs:
[WARNING] multiqc : MultiQC Version v1.10 now available! [INFO ] multiqc : This is MultiQC v1.9 [INFO ] multiqc : Template : default [INFO ] multiqc : Report title: ZARP [INFO ] multiqc : Searching : /scicore/home/zavolan/bakma/zarp-dev/zarp/tests/test_integration_workflow/results [INFO ] multiqc : Searching : /scicore/home/zavolan/bakma/zarp-dev/zarp/tests/test_integration_workflow/logs [INFO ] fastqc : Found 3 reports [INFO ] cutadapt : Found 2 reports [INFO ] cutadapt : Found 2 reports [INFO ] star : Found 2 reports [INFO ] salmon : Found 2 meta reports [INFO ] salmon : Found 2 fragment length distributions [INFO ] kallisto : Found 2 reports [ERROR ] multiqc : Oops! The 'zpca' MultiQC module broke... Please copy the following traceback and report it at https://github.com/ewels/MultiQC/issues If possible, please include a log file that triggers the error - the last file found was: results/zpca/pca_salmon_genes/scree.tsv ============================================================ Module zpca raised an exception: Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/multiqc/multiqc.py", line 569, in run output = mod() File "/usr/local/lib/python3.8/site-packages/multiqc_plugins-1.1.0-py3.8.egg/modules/zpca/zpca.py", line 45, in __init__ self.findLogs() File "/usr/local/lib/python3.8/site-packages/multiqc_plugins-1.1.0-py3.8.egg/modules/zpca/zpca.py", line 54, in findLogs data_scree = self.parse_scree_logs(f) File "/usr/local/lib/python3.8/site-packages/multiqc_plugins-1.1.0-py3.8.egg/modules/zpca/zpca.py", line 124, in parse_scree_logs "PC1": {exp_car_str: float(listToStr[-3])}, ValueError: could not convert string to float: 'Percentage of Explained Variance' ============================================================ [ERROR ] multiqc : Oops! The 'zpca' MultiQC module broke... Please copy the following traceback and report it at https://github.com/ewels/MultiQC/issues If possible, please include a log file that triggers the error - the last file found was: results/zpca/pca_salmon_transcripts/scree.tsv ============================================================ Module zpca raised an exception: Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/multiqc/multiqc.py", line 569, in run output = mod() File "/usr/local/lib/python3.8/site-packages/multiqc_plugins-1.1.0-py3.8.egg/modules/zpca/zpca.py", line 45, in __init__ self.findLogs() File "/usr/local/lib/python3.8/site-packages/multiqc_plugins-1.1.0-py3.8.egg/modules/zpca/zpca.py", line 54, in findLogs data_scree = self.parse_scree_logs(f) File "/usr/local/lib/python3.8/site-packages/multiqc_plugins-1.1.0-py3.8.egg/modules/zpca/zpca.py", line 124, in parse_scree_logs "PC1": {exp_car_str: float(listToStr[-3])}, ValueError: could not convert string to float: 'Percentage of Explained Variance' ============================================================ [ERROR ] multiqc : Oops! The 'zpca' MultiQC module broke... Please copy the following traceback and report it at https://github.com/ewels/MultiQC/issues If possible, please include a log file that triggers the error - the last file found was: results/zpca/pca_kallisto_genes/scree.tsv ============================================================ Module zpca raised an exception: Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/multiqc/multiqc.py", line 569, in run output = mod() File "/usr/local/lib/python3.8/site-packages/multiqc_plugins-1.1.0-py3.8.egg/modules/zpca/zpca.py", line 45, in __init__ self.findLogs() File "/usr/local/lib/python3.8/site-packages/multiqc_plugins-1.1.0-py3.8.egg/modules/zpca/zpca.py", line 54, in findLogs data_scree = self.parse_scree_logs(f) File "/usr/local/lib/python3.8/site-packages/multiqc_plugins-1.1.0-py3.8.egg/modules/zpca/zpca.py", line 124, in parse_scree_logs "PC1": {exp_car_str: float(listToStr[-3])}, ValueError: could not convert string to float: 'Percentage of Explained Variance' ============================================================ [ERROR ] multiqc : Oops! The 'zpca' MultiQC module broke... Please copy the following traceback and report it at https://github.com/ewels/MultiQC/issues If possible, please include a log file that triggers the error - the last file found was: results/zpca/pca_kallisto_transcripts/scree.tsv ============================================================ Module zpca raised an exception: Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/multiqc/multiqc.py", line 569, in run output = mod() File "/usr/local/lib/python3.8/site-packages/multiqc_plugins-1.1.0-py3.8.egg/modules/zpca/zpca.py", line 45, in __init__ self.findLogs() File "/usr/local/lib/python3.8/site-packages/multiqc_plugins-1.1.0-py3.8.egg/modules/zpca/zpca.py", line 54, in findLogs data_scree = self.parse_scree_logs(f) File "/usr/local/lib/python3.8/site-packages/multiqc_plugins-1.1.0-py3.8.egg/modules/zpca/zpca.py", line 124, in parse_scree_logs "PC1": {exp_car_str: float(listToStr[-3])}, ValueError: could not convert string to float: 'Percentage of Explained Variance' ============================================================ [INFO ] multiqc : Compressing plot data [INFO ] multiqc : Report : results/multiqc_summary/multiqc_report.html [INFO ] multiqc : Data : results/multiqc_summary/multiqc_data [INFO ] multiqc : MultiQC complete
OK, the difference is in the
scree.tsv
.For the integration test we have:
PC1 PC2 Percentage of Explained Variance 100.0 0.0
For the GCN4 we have:
PC1 PC2 PC3 Percentage of Explained Variance 79.7 12.1 8.2
The error is that Krish hardcoded
float(listToStr[-3])
, which can be easily changed tofloat(listToStr[0])
.Actually, as I look into our plugins repo the parsing script is constructed such that it always plots 1x2, 2x3, 1x3. The logic of first 3 principal components is hard-coded into the whole parsing and plotting script.
@gypas
Is there a reason why does our integration test returns only 2 principal components with variances: 100%, 0%?
To me this seems like an artificial special case which breaks everything downstream.OK, digging even deeper into the core script in zpca I see that there is a function which determines the number of PCs based on the number of samples. The observations make sense now as in the integration test there are 2 samples going into the pipeline, so we get PC1 and PC2. The 100-0 split makes sense too..
However, the problem is that this behaviour is cryptic, right? I am assuming that the official zpca repo does not test such case and therefore Krish assumed that it's always gonna be first 3 PCs. @gypas Could you please add proper tests to your repo? Then we can re-open the issue at
multiqc-plugins
and ask Krish for a fix. Having that I will plug it into the Snakefile here and push once again. Then it should be fine.mentioned in merge request !81 (merged)
added 4 commits
-
77c736d1...10e8891c - 2 commits from branch
dev
- 608c9d33 - Merge branch 'dev' into zpca-multiqc
- abf759ef - update plugins version
-
77c736d1...10e8891c - 2 commits from branch
OK, It seems that all the errors are fixed;
@gypas, before merging - could you please test locally and see if the zpca section in the report looks OK?Edited by BIOPZ-Bak MaciejThe CI passes here but strangely enough the integration test fails on my machine. It seems that zpca created wrong
scree.tsv
for salmon-based quantification in my run.For kallisto I have:
PC1 PC2 Percentage of Explained Variance 100.0 0.0
For salmon I have:
PC1 PC2 Percentage of Explained Variance
CC @gypas
mentioned in issue #159 (closed)
added 3 commits
-
83cd7d3b...e265ed75 - 2 commits from branch
dev
- 2e1647a5 - Merge branch 'dev' of...
-
83cd7d3b...e265ed75 - 2 commits from branch
Hi @bakma. After merging with the latest changes from
dev
I cannot reproduce the issue anymore (neither in the CI nor locally). Can you please try as well after pulling the changes of the current branch?Edited by BIOPZ-Gypas Foivosrequested review from @bakma
removed review request for @bakma
Hi @gypas,
I runbash tests/test_integration_workflow/test.local.sh
locally and confirm that the problem is gone.
Go ahead and merge away! :)