wdecoster / NanoPlot

Plotting scripts for long read sequencing data
http://nanoplot.bioinf.be
MIT License
429 stars 47 forks source link

NanoPlot crashing when processing PacBio reads #76

Closed ggstatgen closed 6 years ago

ggstatgen commented 6 years ago

Hi

First of all thanks for developing NanoPlot! I thought I'd give it a go to get summary plots from a couple of pacbio fasta files. Unfortunately I'm failing to run it and I am getting the following error dump:

2018-07-10 16:19:11,875 NanoPlot 1.13.0 started with arguments Namespace(N50=False, alength=False, bam=None, barcoded=False, color='#4CB391', cram=None, downsample=None, drop_outliers=False, fasta=['m54070_180626_111643.subreads.fasta.gz'], fastq=None, fastq_minimal=None, fastq_rich=None, format='png', listcolors=False, loglength=False, maxlength=None, minlength=None, minqual=None, no_N50=False, outdir='/raw', percentqual=False, pickle=None, plots=['hex', 'dot'], prefix='', raw=False, readtype='1D', store=False, summary=None, threads=5, title=None, verbose=False) 2018-07-10 16:19:11,875 Python version is: 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56) [GCC 7.2.0] 2018-07-10 16:19:11,919 Nanoplotter: valid output format png 2018-07-10 16:19:11,928 Nanoget: Starting to collect statistics from a fasta file. 2018-07-10 16:19:11,928 Nanoget: Decompressing gzipped fasta m54070_180626_111643.subreads.fasta.gz 2018-07-10 16:21:03,176 Nanoget: Gathered all metrics of 121495169 reads 2018-07-10 16:21:07,579 Calculated statistics 2018-07-10 16:21:07,579 Using sequenced read lengths for plotting. 2018-07-10 16:21:07,579 Processed the reads, optionally filtered. 121495169 reads left 2018-07-10 16:21:07,579 Nanoplotter: Valid color #4CB391. 2018-07-10 16:21:07,579 Nanoplotter: Creating length plots for Read length. 2018-07-10 16:21:08,038 Nanoplotter: Using 121495169 reads maximum of 51bp. 2018-07-10 16:21:23,669 bins must be positive, when an integer Traceback (most recent call last): File "/CODE/miniconda3/lib/python3.6/site-packages/nanoplot/NanoPlot.py", line 87, in main plots = make_plots(datadf, settings) File "/CODE/miniconda3/lib/python3.6/site-packages/nanoplot/NanoPlot.py", line 368, in make_plots title=settings["title"]) File "/CODE/miniconda3/lib/python3.6/site-packages/nanoplotter/nanoplotter.py", line 439, in length_plots hist_kws={"weights": h_type.weight}) File "/CODE/miniconda3/lib/python3.6/site-packages/seaborn/distributions.py", line 218, in distplot color=hist_color, *hist_kws) File "/CODE/miniconda3/lib/python3.6/site-packages/matplotlib/init.py", line 1855, in inner return func(ax, args, kwargs) File "/CODE/miniconda3/lib/python3.6/site-packages/matplotlib/axes/_axes.py", line 6530, in hist m, bins = np.histogram(x[i], bins, weights=w[i], hist_kwargs) File "/CODE/miniconda3/lib/python3.6/site-packages/numpy/lib/function_base.py", line 721, in histogram raise ValueError('bins must be positive, when an integer') ValueError: bins must be positive, when an integer

I hope I am not wrong in assuming your useful tool could be used for PacBio fasta files, too. Any help would be appreciated.

wdecoster commented 6 years ago

Thanks for reporting this. I'll look into this Thursday. Can you tell me how you installed NanoPlot, and what the output is of:

python -c "import nanoget ; print(nanoget.__version__)"

Cheers, Wouter

ggstatgen commented 6 years ago

Hi Wouter

The output of the above command is

1.5.0

This is how I installed nanoplot -Downloaded miniconda 64bit bash installer for linux here https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -Installed miniconda and sourced the environment -Installed NanoPlot as follows

conda install -c bioconda nanoplot

Thanks!

wdecoster commented 6 years ago

NanoPlot should work for fasta files, also for PacBio. I think this issue might be related to https://github.com/wdecoster/nanostat/issues/17 In that case, it would be solved by upgrading nanoget to v1.5.2 (which I just updated on bioconda).

You would need: conda install -c bioconda nanoget

Can you let me know how it goes?

Cheers, Wouter

ggstatgen commented 6 years ago

Hello again Wouter

Seems like this fixed the issue! I'm not able to produce the plots. Thanks so much for helping!

wdecoster commented 6 years ago

Good to hear, but did you mean you are now able to produce the plots?

ggstatgen commented 6 years ago

Yes I am now able to produce the plots!