gemini
gemini copied to clipboard
JSON output for inheritance tools
Hi,
I was wondering if there is a way where I can get the results from comp_hets
, de_novo
, autosomal_recessive
etc as a JSON object? I tried using --format json
and --json
but they don't work. It would be really helpful if that feature is implemented (if not already). I am trying to get all my output in JSON format and import in datatables.
This isn't available right now, but you could easily do this with a small script like the one below and use as:
gemini de_novo ... | tsv2json.py
you could also read into pandas and then use to_json to get the correct types.
import sys
import json
header = next(sys.stdin).strip().split("\t")
a = []
for toks in (x.strip().split("\t") for x in sys.stdin):
a.append(dict(zip(header, toks)))
print json.dumps(a)
Thanks! Do you have plans to implement this feature in the future versions?
not specifically, but we can leave this issue open as a reminder.