bcbio / bcbio-nextgen

Validated, scalable, community developed variant calling, RNA-seq and small RNA analysis
https://bcbio-nextgen.readthedocs.io
MIT License
994 stars 353 forks source link

purecn error if no variant to plot #2555

Closed apastore closed 5 years ago

apastore commented 6 years ago

I Brad, thanks for implementing purecn. I am trying this in some target panel and in case there when there are few or no mutation it fail. There is a way to catch this?

Thnanks! Alessandro

WARN [2018-10-29 01:43:25] No variants to plot
Error in `$<-.data.frame`(`*tmp*`, "group", value = "germline") : 
  replacement has 1 row, data has 0
Calls: plotAbs ... .plotTypeAF -> .getAFPlotGroups -> $<- -> $<-.data.frame
Execution halted
' returned non-zero exit status 1
[2018-10-29T05:43Z] ls14: Unexpected error
Traceback (most recent call last):
  File "/home/pastore/data/bcbio/anaconda/lib/python2.7/site-packages/bcbio/distributed/ipythontasks.py", line 52, in _setup_logging
    yield config
  File "/home/pastore/data/bcbio/anaconda/lib/python2.7/site-packages/bcbio/distributed/ipythontasks.py", line 436, in detect_sv
    return ipython.zip_args(apply(structural.detect_sv, *args))
  File "/home/pastore/data/bcbio/anaconda/lib/python2.7/site-packages/bcbio/structural/__init__.py", line 200, in detect_sv
    for svdata in caller_fn(items):
  File "/home/pastore/data/bcbio/anaconda/lib/python2.7/site-packages/bcbio/structural/purecn.py", line 25, in run
    purecn_out = _run_purecn(paired, work_dir)
  File "/home/pastore/data/bcbio/anaconda/lib/python2.7/site-packages/bcbio/structural/purecn.py", line 88, in _run_purecn
    do.run(cmd, "PureCN copy number calling")
  File "/home/pastore/data/bcbio/anaconda/lib/python2.7/site-packages/bcbio/provenance/do.py", line 23, in run
    _do_run(cmd, checks, log_stdout, env=env)
  File "/home/pastore/data/bcbio/anaconda/lib/python2.7/site-packages/bcbio/provenance/do.py", line 103, in _do_run
    raise subprocess.CalledProcessError(exitcode, error_msg)
apastore commented 6 years ago

I also see the same issues with purple.

lima1 commented 6 years ago

It shouldn't crash, but this means what it says, for some reason no germline variants passed the filters. Can you post the log file?

chapmanb commented 6 years ago

Alessandro and Markus; Thanks much for the report and helping debug this. It sounds like this sample does not have enough information to work with heterogeneity callers but we should probably be catching this upstream and cleanly skipping over it so that both PureCN and PURPLE don't fail. As Markus suggested, any details about the input germline variants (number of variants, how many pass) could help identify what we should use for sanity checking the inputs and skipping. Thanks again.

roryk commented 5 years ago

Closing this for now since the issue is a little stale, please re-open if you run into this problem and we can re-visit fixing it.