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

Error when passing a Whitelist object to SampComp #88

Closed tleonardi closed 5 years ago

tleonardi commented 5 years ago

SampComp throws an error when it generates the log file:

>>> s = SampComp( eventalign_fn_dict = ead, outpath="tmp", fasta_fn="reference_transcriptome.fa", nthreads=3, whitelist=w)
Initialising SampComp and checking options
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/nanocompore/SampComp.py", line 140, in __init__
    json.dump(option_d, log_fp, indent=2)
  File "/usr/lib/python3.5/json/__init__.py", line 178, in dump
    for chunk in iterable:
  File "/usr/lib/python3.5/json/encoder.py", line 429, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/usr/lib/python3.5/json/encoder.py", line 403, in _iterencode_dict
    yield from chunks
  File "/usr/lib/python3.5/json/encoder.py", line 436, in _iterencode
    o = _default(o)
  File "/usr/lib/python3.5/json/encoder.py", line 179, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: Whitelist: Number of references: 1 is not JSON serializable
a-slide commented 5 years ago

Did you generate the Whitelist manually ?

a-slide commented 5 years ago

Ah yes sorry, just saw that

a-slide commented 5 years ago

Fix available https://github.com/tleonardi/nanocompore/pull/89

a-slide commented 5 years ago

:/