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

make json format readable #240

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions freyja/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,16 @@ def update(outdir, noncl, buildlocal):
os.path.join(locDir, 'usher_barcodes.feather'))

dictMuts = {}
for lin in df.index:
muts = sorted([df.columns[m0] for m0, v in enumerate(df.loc[lin])
if v > 0], key=sortFun)
for lin in df_barcodes.index:
muts = sorted([df_barcodes.columns[m0]
for m0, v in enumerate(df_barcodes.loc[lin])
if v > 0], key=sortFun)
dictMuts[lin] = muts

import json
jpath = os.path.join(locDir, "lineage_mutations.json")
with open(jpath, "w") as outfile:
json.dump(dictMuts, outfile)
json.dump(dictMuts, outfile, indent=4)

# delete files generated along the way that aren't needed anymore
print('Cleaning up')
Expand Down Expand Up @@ -310,7 +311,7 @@ def barcode_build(pb, outdir, noncl):
import json
jpath = os.path.join(locDir, "lineage_mutations.json")
with open(jpath, "w") as outfile:
json.dump(dictMuts, outfile)
json.dump(dictMuts, outfile, indent=4)

# delete files generated along the way that aren't needed anymore
print('Cleaning up')
Expand Down
2 changes: 1 addition & 1 deletion freyja/data/curated_lineages.json

Large diffs are not rendered by default.

253,124 changes: 253,123 additions & 1 deletion freyja/data/lineage_mutations.json

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions freyja/data/lineages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2786,6 +2786,7 @@
- JN.1.13.1
- JN.1.14
- JN.1.15
- JN.1.15.1
- JN.1.16
- JN.1.16.1
- JN.1.16.2
Expand Down Expand Up @@ -3029,6 +3030,7 @@
- LR.2
- LS.1
- LT.1
- LU.1
- M.1
- M.2
- M.3
Expand Down Expand Up @@ -5606,6 +5608,7 @@
- JN.1.13.1
- JN.1.14
- JN.1.15
- JN.1.15.1
- JN.1.16
- JN.1.16.1
- JN.1.16.2
Expand Down Expand Up @@ -5849,6 +5852,7 @@
- LR.2
- LS.1
- LT.1
- LU.1
- M.1
- M.2
- M.3
Expand Down Expand Up @@ -7488,6 +7492,7 @@
- JN.1.13.1
- JN.1.14
- JN.1.15
- JN.1.15.1
- JN.1.16
- JN.1.16.1
- JN.1.16.2
Expand Down Expand Up @@ -7731,6 +7736,7 @@
- LR.2
- LS.1
- LT.1
- LU.1
- M.1
- M.2
- M.3
Expand Down Expand Up @@ -11845,6 +11851,7 @@
- JN.1.13.1
- JN.1.14
- JN.1.15
- JN.1.15.1
- JN.1.16
- JN.1.16.1
- JN.1.16.2
Expand Down Expand Up @@ -12081,6 +12088,7 @@
- LR.2
- LS.1
- LT.1
- LU.1
parent: B.1.1
- name: BA.1
alias: B.1.1.529.1
Expand Down Expand Up @@ -12903,6 +12911,7 @@
- JN.1.13.1
- JN.1.14
- JN.1.15
- JN.1.15.1
- JN.1.16
- JN.1.16.1
- JN.1.16.2
Expand Down Expand Up @@ -13139,6 +13148,7 @@
- LR.2
- LS.1
- LT.1
- LU.1
parent: B.1.1.529
- name: BA.2.1
alias: B.1.1.529.2.1
Expand Down Expand Up @@ -16488,6 +16498,7 @@
- JN.1.13.1
- JN.1.14
- JN.1.15
- JN.1.15.1
- JN.1.16
- JN.1.16.1
- JN.1.16.2
Expand Down Expand Up @@ -16718,6 +16729,7 @@
- LR.2
- LS.1
- LT.1
- LU.1
parent: BA.2
- name: BA.2.86.1
alias: B.1.1.529.2.86.1
Expand Down Expand Up @@ -16773,6 +16785,7 @@
- JN.1.13.1
- JN.1.14
- JN.1.15
- JN.1.15.1
- JN.1.16
- JN.1.16.1
- JN.1.16.2
Expand Down Expand Up @@ -16999,6 +17012,7 @@
- LR.2
- LS.1
- LT.1
- LU.1
parent: BA.2.86
- name: JN.1
alias: B.1.1.529.2.86.1.1
Expand Down Expand Up @@ -17053,6 +17067,7 @@
- JN.1.13.1
- JN.1.14
- JN.1.15
- JN.1.15.1
- JN.1.16
- JN.1.16.1
- JN.1.16.2
Expand Down Expand Up @@ -17248,6 +17263,7 @@
- LR.2
- LS.1
- LT.1
- LU.1
parent: BA.2.86.1
- name: JN.1.1
alias: B.1.1.529.2.86.1.1.1
Expand Down Expand Up @@ -18177,7 +18193,20 @@
alias: B.1.1.529.2.86.1.1.15
children:
- JN.1.15
- JN.1.15.1
- LU.1
parent: JN.1
- name: JN.1.15.1
alias: B.1.1.529.2.86.1.1.15.1
children:
- JN.1.15.1
- LU.1
parent: JN.1.15
- name: LU.1
alias: B.1.1.529.2.86.1.1.15.1.1
children:
- LU.1
parent: JN.1.15.1
- name: JN.1.16
alias: B.1.1.529.2.86.1.1.16
children:
Expand Down
Loading