polyactis / Accucopy

Accucopy is a computational method that infers Allele-Specific Copy Number alterations from low-coverage low-purity tumor sequencing data.
https://www.yfish.org/software/Accucopy
GNU General Public License v3.0
15 stars 4 forks source link

Lacking python3 packages in docker #12

Closed CJBgon closed 2 years ago

CJBgon commented 3 years ago

I've ran into some errors with the docker (build in Singularity). The plotting steps require matplotlib. However, plot_cnv errors out when importing matplotlib. Interestingly, plotCPandMCP.py is written in Python3. I suspect the docker only installed matplotlib for python2.

log:

[15_1] [TaskRunner:plot_cnv] Task initiated on local node
[15_1] [TaskManager] [ERROR] Failed to complete command task: 'plot_cnv' launched from master workflow, error code: 1, command: '/usr/local/Accucopy/plotCPandMCP.py -i /.../accucopy/results/cnv.output.tsv -r /mnt/refData/genome.dict --no_of_autosomes 22 -o /.../accucopy/results/plot.cnv.png'
[15_1] [TaskManager] [ERROR] [plot_cnv] Error Message:
[15_1] [TaskManager] [ERROR] [plot_cnv] Last 27 stderr lines from task (of 27 total lines):
[15_1] [TaskManager] [ERROR] [plot_cnv] Error processing line 1 of /usr/local/lib/python3.6/dist-packages/matplotlib-3.3.4-py3.6-nspkg.pth:
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]   Traceback (most recent call last):
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]     File "/usr/lib/python3.6/site.py", line 174, in addpackage
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]     exec(line)
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]     File "<string>", line 1, in <module>
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]     File "<frozen importlib._bootstrap>", line 568, in module_from_spec
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]   AttributeError: 'NoneType' object has no attribute 'loader'
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] Remainder of file ignored
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] Matplotlib created a temporary config/cache directory at /tmp/matplotlib-pql0p325 because the default path (/root/.config/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] Traceback (most recent call last):
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]   File "/usr/local/Accucopy/plotCPandMCP.py", line 7, in <module>
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]     from matplotlib import pyplot as plt
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]   File "/usr/local/lib/python3.6/dist-packages/matplotlib/pyplot.py", line 36, in <module>
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]     import matplotlib.colorbar
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]   File "/usr/local/lib/python3.6/dist-packages/matplotlib/colorbar.py", line 44, in <module>
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]     import matplotlib.contour as contour
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]   File "/usr/local/lib/python3.6/dist-packages/matplotlib/contour.py", line 21, in <module>
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]     import matplotlib.texmanager as texmanager
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]   File "<frozen importlib._bootstrap_external>", line 674, in exec_module
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]   File "<frozen importlib._bootstrap_external>", line 779, in get_code
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv]   File "<frozen importlib._bootstrap_external>", line 487, in _compile_bytecode
[15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] EOFError: marshal data too short
[15_1] [TaskManager] [ERROR] Shutting down task submission. Waiting for remaining tasks to complete.

In the singularity container i couldn't import matplotlib, pandas or numpy for python3 (but could for python2).

fanxinping commented 2 years ago

@CJBgon It's very strange. Can you provide some details of how to build it in Singularity or the def file of Singularity?

polyactis commented 2 years ago

We missed a few python3 packages during the python3 upgrade for this program and will make a new docker image ASAP.

On Fri, Sep 10, 2021 at 2:20 AM Christian Bouwens @.***> wrote:

I've ran into some errors with the docker (build in Singularity). The plotting steps require matplotlib. However, plot_cnv errors out when importing matplotlib. Interestingly, plotCPandMCP.py is written in Python3. I suspect the docker only installed matplotlib for python2.

log:

[15_1] [TaskRunner:plot_cnv] Task initiated on local node [15_1] [TaskManager] [ERROR] Failed to complete command task: 'plot_cnv' launched from master workflow, error code: 1, command: '/usr/local/Accucopy/plotCPandMCP.py -i /.../accucopy/results/cnv.output.tsv -r /mnt/refData/genome.dict --no_of_autosomes 22 -o /.../accucopy/results/plot.cnv.png' [15_1] [TaskManager] [ERROR] [plot_cnv] Error Message: [15_1] [TaskManager] [ERROR] [plot_cnv] Last 27 stderr lines from task (of 27 total lines): [15_1] [TaskManager] [ERROR] [plot_cnv] Error processing line 1 of /usr/local/lib/python3.6/dist-packages/matplotlib-3.3.4-py3.6-nspkg.pth: [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] Traceback (most recent call last): [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] File "/usr/lib/python3.6/site.py", line 174, in addpackage [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] exec(line) [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] File "", line 1, in [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] File "", line 568, in module_from_spec [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] AttributeError: 'NoneType' object has no attribute 'loader' [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] Remainder of file ignored [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] Matplotlib created a temporary config/cache directory at /tmp/matplotlib-pql0p325 because the default path (/root/.config/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing. [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] Traceback (most recent call last): [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] File "/usr/local/Accucopy/plotCPandMCP.py", line 7, in [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] from matplotlib import pyplot as plt [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] File "/usr/local/lib/python3.6/dist-packages/matplotlib/pyplot.py", line 36, in [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] import matplotlib.colorbar [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] File "/usr/local/lib/python3.6/dist-packages/matplotlib/colorbar.py", line 44, in [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] import matplotlib.contour as contour [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] File "/usr/local/lib/python3.6/dist-packages/matplotlib/contour.py", line 21, in [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] import matplotlib.texmanager as texmanager [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] File "", line 971, in _find_and_load [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] File "", line 955, in _find_and_load_unlocked [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] File "", line 665, in _load_unlocked [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] File "", line 674, in exec_module [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] File "", line 779, in get_code [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] File "", line 487, in _compile_bytecode [15_1] [TaskManager] [ERROR] [] [] [15_1] [plot_cnv] EOFError: marshal data too short [15_1] [TaskManager] [ERROR] Shutting down task submission. Waiting for remaining tasks to complete.

In the singularity container i couldn't import matplotlib, pandas or numpy for python3 (but could for python2).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/polyactis/Accucopy/issues/12, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAF7C2KLUUDGDIKNKJMJMI3UBD3FHANCNFSM5DXWV36Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

CJBgon commented 2 years ago

@fanxinping I've build the singularity container straight from the docker:

sudo singularity build --writable accucopy.sif docker://polyactis/accucopy

I'll check with the new docker if the same issue occurs.

polyactis commented 2 years ago

The new image has been pushed to the docker hub. Please try and let us know if any problem

On Thu, Sep 16, 2021, 6:15 AM Christian Bouwens @.***> wrote:

@fanxinping https://github.com/fanxinping I've build the singularity container straight from the docker:

sudo singularity build --writable accucopy.sif docker://polyactis/accucopy

I'll check with the new docker if the same issue occurs.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/polyactis/Accucopy/issues/12#issuecomment-920424410, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAF7C2MVK44W5QBHCM7UHITUCELIXANCNFSM5DXWV36Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

CJBgon commented 2 years ago

I can confirm the new docker has resolved the problem, thank you for the help.