Gregor-Mendel-Institute / SNPmatch

A simple python library to identify the most likely strain from the population
https://arageno.gmi.oeaw.ac.at/
MIT License
9 stars 5 forks source link

TypeError in JSON file output of genotyper inbred #11

Closed rbpisupati closed 6 years ago

rbpisupati commented 6 years ago

Here is the detailed error,

Traceback (most recent call last):
  File "/mygit/SNPmatch/snpmatch/__init__.py", line 191, in main
    args['func'](args)
  File "/mygit/SNPmatch/snpmatch/__init__.py", line 116, in snpmatch_inbred
    snpmatch.potatoGenotyper(args)
  File "/mygit/SNPmatch/snpmatch/core/snpmatch.py", line 155, in potatoGenotyper
    (ScoreList, NumInfoSites) = genotyper(snpCHR, snpPOS, snpGT, snpWEI, DPmean, args['hdf5File'], args['hdf5accFile'], args['outFile'])
  File "/mygit/SNPmatch/snpmatch/core/snpmatch.py", line 148, in genotyper
    print_topHits(outFile + ".matches.json", GenotypeData.accessions, ScoreList, NumInfoSites, overlap, NumMatSNPs)
  File "/mygit/SNPmatch/snpmatch/core/snpmatch.py", line 91, in print_topHits
    out_stats.write(json.dumps(topHitsDict))
  File "/home/GMI/rahul.pisupati/anaconda2/envs/spyder/lib/python2.7/json/__init__.py", line 244, in dumps
    return _default_encoder.encode(obj)
  File "/home/GMI/rahul.pisupati/anaconda2/envs/spyder/lib/python2.7/json/encoder.py", line 207, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/home/GMI/rahul.pisupati/anaconda2/envs/spyder/lib/python2.7/json/encoder.py", line 270, in iterencode
    return _iterencode(o, 0)
  File "/home/GMI/rahul.pisupati/anaconda2/envs/spyder/lib/python2.7/json/encoder.py", line 184, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: 14471 is not JSON serializable

But the dictionary that need to be output looks good!