Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update JSON output to JSONLines #558

Open
julesjacobsen opened this issue Apr 24, 2024 · 2 comments
Open

Update JSON output to JSONLines #558

julesjacobsen opened this issue Apr 24, 2024 · 2 comments
Milestone

Comments

@julesjacobsen
Copy link
Contributor

julesjacobsen commented Apr 24, 2024

JSON Lines would help users parsing the Exomiser JSON output as each gene result would be written a single line, enabling easier searching and return of results.

https://jsonlines.org/

This can be achieved using jq:

jq -c .[] Pfeiffer-hiphive-exome-PASS_ONLY.json > Pfeiffer-hiphive-exome-PASS_ONLY.jsonl

or better for really large files you can using streaming:

jq --stream -cn 'fromstream(1
  | truncate_stream(inputs))
  | select(length > 0)
  | select(.)' Pfeiffer-hiphive-exome-PASS_ONLY.json > Pfeiffer-hiphive-exome-PASS_ONLY.jsonl

But would likely be more useful as native output:

https://cowtowncoder.medium.com/line-delimited-json-with-jackson-69c9e4cb6c00

@damiansm
Copy link
Contributor

damiansm commented Apr 24, 2024 via email

@jamesamcl
Copy link

JSON Lines also works very well with Pyspark.

@julesjacobsen julesjacobsen added this to the 15.0.0 milestone Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants