You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, this raises a KeyError during the separating combined splits step. See the following traceback:
Getting outbreak data
Downloading a new global tree
Converting tree info to barcodes
Reading custom tree at: o1_cholera.no_missing.pb
Building barcodes from global phylogenetic tree
separating combined splits
Traceback (most recent call last):
File "/PHShome/nm104/mambaforge/envs/phonebook/bin/freyja", line 10, in <module>
sys.exit(cli())
File "/PHShome/nm104/mambaforge/envs/phonebook/lib/python3.9/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/PHShome/nm104/mambaforge/envs/phonebook/lib/python3.9/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/PHShome/nm104/mambaforge/envs/phonebook/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/PHShome/nm104/mambaforge/envs/phonebook/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/PHShome/nm104/mambaforge/envs/phonebook/lib/python3.9/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/PHShome/nm104/mambaforge/envs/phonebook/lib/python3.9/site-packages/freyja/_cli.py", line 312, in barcode_build
df_barcodes = convert_to_barcodes(df)
File "/PHShome/nm104/mambaforge/envs/phonebook/lib/python3.9/site-packages/freyja/convert_paths2barcodes.py", line 32, in convert_to_barcodes
df_barcodes = df_barcodes.drop(columns='')
File "/PHShome/nm104/mambaforge/envs/phonebook/lib/python3.9/site-packages/pandas/core/frame.py", line 5581, in drop
return super().drop(
File "/PHShome/nm104/mambaforge/envs/phonebook/lib/python3.9/site-packages/pandas/core/generic.py", line 4788, in drop
obj = obj._drop_axis(labels, axis, level=level, errors=errors)
File "/PHShome/nm104/mambaforge/envs/phonebook/lib/python3.9/site-packages/pandas/core/generic.py", line 4830, in _drop_axis
new_axis = axis.drop(labels, errors=errors)
File "/PHShome/nm104/mambaforge/envs/phonebook/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 7070, in drop
raise KeyError(f"{labels[mask].tolist()} not found in axis")
KeyError: "[''] not found in axis"
The specific line the error is referencing is below, and I believe the issue is that Freyja assumes the barcode dataframe will contain a column with the name "".
However, if I put a breakpoint before this statement and debug, I find that the dataframe generated by my tree doesn't have this empty column. Additionally, if I wrap the line in a conditional (if "" in df.columns:), the error is not raised and the command runs without a issue, and I assume the barcodes are chill.
I'll make a PR with the fix now, but wanted to post this issue so its tracked, if y'all want to explore my PB (attached) or whatever.
The text was updated successfully, but these errors were encountered:
Hey y'all,
I'm attempting to extract lineage barcodes from a custom cholera PB tree using the following freyja command:
Here is the tree: o1_cholera.no_missing.pb.zip
However, this raises a KeyError during the
separating combined splits
step. See the following traceback:The specific line the error is referencing is below, and I believe the issue is that Freyja assumes the barcode dataframe will contain a column with the name "".
Freyja/freyja/convert_paths2barcodes.py
Line 32 in af5f46a
However, if I put a breakpoint before this statement and debug, I find that the dataframe generated by my tree doesn't have this empty column. Additionally, if I wrap the line in a conditional (
if "" in df.columns:
), the error is not raised and the command runs without a issue, and I assume the barcodes are chill.I'll make a PR with the fix now, but wanted to post this issue so its tracked, if y'all want to explore my PB (attached) or whatever.
The text was updated successfully, but these errors were encountered: