bcbio / bcbio-nextgen

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

Error in coverage plotting #869

Closed schelhorn closed 9 years ago

schelhorn commented 9 years ago

I get an error in the coverage plot module:

  File "/cluster/software/bcbio_dev/lib/anaconda/lib/python2.7/site-packages/bcbio/distributed/ipythontasks.py", line 255, in finalize_sv
    return ipython.zip_args(apply(structural.finalize_sv, *args))
  File "/cluster/software/bcbio_dev/lib/anaconda/lib/python2.7/site-packages/bcbio/structural/__init__.py", line 72, in finalize_sv
    plot_items = plot.by_regions(items)
  File "/cluster/software/bcbio_dev/lib/anaconda/lib/python2.7/site-packages/bcbio/structural/plot.py", line 114, in by_regions
    priority_merged, breakpoints)
  File "/cluster/software/bcbio_dev/lib/anaconda/lib/python2.7/site-packages/bcbio/bam/coverage.py", line 135, in plot_multiple_regions_coverage
    start, end, os.path.dirname(tx_out_file))
  File "/cluster/software/bcbio_dev/lib/anaconda/lib/python2.7/site-packages/bcbio/bam/coverage.py", line 58, in _combine_regional_coverage
    in zip(in_bams, samplenames)]
  File "/cluster/software/bcbio_dev/lib/anaconda/lib/python2.7/site-packages/bcbio/bam/coverage.py", line 46, in _calc_regional_coverage
    df["position"] = df["start"] + df["offset"] - 1
  File "/cluster/software/bcbio_dev/lib/anaconda/lib/python2.7/site-packages/pandas/core/ops.py", line 524, in wrapper
    arr = na_op(lvalues, rvalues)
  File "/cluster/software/bcbio_dev/lib/anaconda/lib/python2.7/site-packages/pandas/core/ops.py", line 475, in na_op
    result[mask] = op(x[mask], _values_from_object(y[mask]))
TypeError: cannot concatenate 'str' and 'int' objects
chapmanb commented 9 years ago

Sven-Eric; Sorry about the issue. I'm not able to reproduce this so am not sure about the underlying cause but pushed a small fix based on the error I'm hoping might resolve it. Would you be able to test with this to see if it solves it?

chapmanb commented 9 years ago

Sven-Eric; I was able to reproduce this today, and it's due to a change in bedtools coverage function in the new release (2.24.0). Previously we did bedtools coverage -a file.bam -b regions.bed but the new syntax is bedtools coverage -a regions.bed -b file.bam. Swapping this over fixes the issue, so if you upgrade to the latest code it should now work cleanly. Sorry about the problem and thanks again for reporting it.

schelhorn commented 9 years ago

Thanks a lot for the quick fix!