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

Pretty-print tbprofiler_full_report.json file when writing file #39

Closed
dfornika opened this issue Jun 26, 2024 · 1 comment
Closed

Pretty-print tbprofiler_full_report.json file when writing file #39

dfornika opened this issue Jun 26, 2024 · 1 comment

Comments

@dfornika
Copy link
Member

Our tbprofiler_full_report.json files don't have any newlines or indentation. They're fairly large/complex documents so this makes it difficult for a person to visually read the files directly. They can be re-formatted with a text editor, but it would be simpler and more convenient to write the files in "pretty-printed" form (with newlines and indentation).

One way to do this is to just stream the file through python's json.tool module before writing to disk:

On this line:

cp results/${sample_id}.results.json ${sample_id}_tbprofiler_full_report.json

We could instead do:

cat results/${sample_id}.results.json | python -m json.tool > ${sample_id}_tbprofiler_full_report.json
@dfornika
Copy link
Member Author

This isn't necessary with newer versions of tbprofiler.

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

Successfully merging a pull request may close this issue.

1 participant