tleonardi / nanocompore

RNA modifications detection from Nanopore dRNA-Seq data
https://nanocompore.rna.rocks
GNU General Public License v3.0
78 stars 12 forks source link

AttributeError: 'SampCompDB' object has no attribute 'results' #118

Closed 690645258 closed 4 years ago

690645258 commented 4 years ago

Describe the bug When trying to run nanocompore sampcomp I get the following error: AttributeError: 'SampCompDB' object has no attribute 'results'

Loading SampCompDB Traceback (most recent call last): File "/home/user/miniconda3/envs/nanocompore/bin/nanocompore", line 8, in <module> sys.exit(main()) File "/home/user/miniconda3/envs/nanocompore/lib/python3.6/site-packages/nanocompore/__main__.py", line 139, in main args.func(args) File "/home/user/miniconda3/envs/nanocompore/lib/python3.6/site-packages/nanocompore/__main__.py", line 176, in sampcomp_main db.save_all(pvalue_thr=args.pvalue_thr) File "/home/user/miniconda3/envs/nanocompore/lib/python3.6/site-packages/nanocompore/SampCompDB.py", line 258, in save_all self.save_report(output_fn = outpath_prefix+"nanocompore_results.tsv") File "/home/user/miniconda3/envs/nanocompore/lib/python3.6/site-packages/nanocompore/SampCompDB.py", line 381, in save_report for record in self.results[self.results.ref_id == cur_id ].itertuples(): AttributeError: 'SampCompDB' object has no attribute 'results'

To Reproduce

The sh script used was:

nanocompore sampcomp \ --downsample_high_coverage 1 \ -t 32 \ --file_list1 ./treatment_collapsed.tsv \ --file_list2 ./control_collapsed.tsv \ --label1 treatment \ --label2 control \ --fasta ../fastas/ref.fasta \ --outpath ./testing/ \

Expected behavior For nanocompore to succesfully compare samples.

Desktop (please complete the following information):

tleonardi commented 4 years ago

Hi @690645258, the problem is in the option --downsample_high_coverage. You're passing a value of 1, which means that every transcript with more than 1 read will be randomly downsampled to 1 (i.e. only one random read per transcript will be used). This option is useful for high coverage experiments to prevent nanocompore threads getting stuck on high coverage transcripts. In these cases we set --downsample_high_coverage to some high but not too high value, e.g. 5000. Unless you have transcripts with a very high number of reads (i.e. >5000) I'd suggest not to use --downsample_high_coverage at all. Let me know how it goes and do get in touch if the issue persists!

690645258 commented 4 years ago

That worked a treat, thanks very much! I thickly assumed it was binary for some reason....

tleonardi commented 4 years ago

Great that it worked!