pontushojer / NAIBR

Novel Adjacency Identification with Barcoded Reads
MIT License
3 stars 0 forks source link

Unusual dict error #7

Closed pdimens closed 1 year ago

pdimens commented 1 year ago

Hi, I've been using this version as part of my pipeline and in the process of getting it ready for testing, I'm running into an usual error that I don't quite understand the cause of.

Processing contig_3: DONE! 4,704 pairs (total time = 0.097 s)!
Processing contig_2: DONE! 5,020 pairs (total time = 0.113 s)!
Processing contig_4: DONE! 5,532 pairs (total time = 0.124 s)!
Processing contig_1: DONE! 6,449 pairs (total time = 0.133 s)!
Processing contig_5: DONE! 4,901 pairs (total time = 0.084 s)!
Processing contig_6: DONE! 5,380 pairs (total time = 0.097 s)!
Processing contig_7: DONE! 5,079 pairs (total time = 0.087 s)!
Processing contig_8: DONE! 4,957 pairs (total time = 0.087 s)!
Processing contig_9: DONE! 5,126 pairs (total time = 0.105 s)!
Processing contig_10: DONE! 6,306 pairs (total time = 0.112 s)!
Traceback (most recent call last):
  File "/home/pdimens/conda/envs/harpy/bin/naibr", line 10, in <module>
    sys.exit(main())
  File "/home/pdimens/conda/envs/harpy/lib/python3.10/site-packages/naibr/__main__.py", line 391, in main
    return run(file_configs)
  File "/home/pdimens/conda/envs/harpy/lib/python3.10/site-packages/naibr/__main__.py", line 350, in run
    novel_adjacencies = run_naibr_on_chromosomes(chromosomes, configs)
  File "/home/pdimens/conda/envs/harpy/lib/python3.10/site-packages/naibr/__main__.py", line 147, in run_naibr_on_chromosomes
    linkedreads_by_barcode.combine(linkedreads_by_barcode_chrom)
  File "/home/pdimens/conda/envs/harpy/lib/python3.10/site-packages/naibr/__main__.py", line 294, in combine
    raise TypeError(f"Can only combine with other UnionDicts or defaultdicts ({type(other)})")
TypeError: Can only combine with other UnionDicts or defaultdicts (<class 'NoneType'>)
pontushojer commented 1 year ago

Hi @pdimens! It seems this error may be due to too few reads on a chromosome or contig in your case. I have added a fix in PR #8, you are welcome to try it out and see if it resolves your issue.

pdimens commented 1 year ago

Thanks @pontushojer , just tested it and that PR fixes the error.

pontushojer commented 1 year ago

Awesome 🎉