Skip to content

Commit dc6ed80

Browse files
python/pyxfr_utils.py: fixed a bug in the load_methbase_metadata function
1 parent bffebf5 commit dc6ed80

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

python/pyxfr_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,8 @@ def load_methbase_metadata(genome, config_dir=None):
107107
errno.ENOENT, "methbase metadata file not found", metadata_path
108108
)
109109
full_table = pandas.read_csv(metadata_path, sep="\t")
110-
return full_table
110+
rows_to_keep = full_table['assembly'] == genome
111+
if not rows_to_keep.any():
112+
raise KeyError(f"no data found for genome {genome}")
113+
cols_to_keep = full_table.columns.drop(['assembly'])
114+
return full_table[rows_to_keep][cols_to_keep]

0 commit comments

Comments
 (0)