Skip to content

Problem with KeyError: 'chromosome' #5

@ChloeL2023

Description

@ChloeL2023

Hi @snajder-r

Since I had R10 data and tried the f5c tool to generate the methylation tsv file similar as Nanopolish. The header of this tsv is:
chromosome start end read_name log_lik_ratio
chr1 10468 10470 5a459fff-cd92-4d3b-b50c-408aedd14609 -2.81
chr1 10483 10496 5a459fff-cd92-4d3b-b50c-408aedd14609 0.14
chr1 10524 10524 5a459fff-cd92-4d3b-b50c-408aedd14609 -0.75
...
However, I got the error like this:
0%| | 0/4 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/home/young/miniconda3/envs/meth5/bin/meth5", line 10, in
sys.exit(main())
File "/home/young/miniconda3/envs/meth5/lib/python3.8/site-packages/meth5/main.py", line 188, in main
subcommand(**args_dict)
File "/home/young/miniconda3/envs/meth5/lib/python3.8/site-packages/meth5/main_create_m5.py", line 31, in main
m5_out.parse_and_add_nanopolish_file(
File "/home/young/miniconda3/envs/meth5/lib/python3.8/site-packages/meth5/meth5.py", line 850, in parse_and_add_nanopolish_file
self.add_to_h5_file(df_chunk, **kwargs)
File "/home/young/miniconda3/envs/meth5/lib/python3.8/site-packages/meth5/meth5.py", line 781, in add_to_h5_file
cur_df = cur_df.groupby("chromosome")
File "/home/young/miniconda3/envs/meth5/lib/python3.8/site-packages/pandas/core/frame.py", line 8252, in groupby
return DataFrameGroupBy(
File "/home/young/miniconda3/envs/meth5/lib/python3.8/site-packages/pandas/core/groupby/groupby.py", line 931, in init
grouper, exclusions, obj = get_grouper(
File "/home/young/miniconda3/envs/meth5/lib/python3.8/site-packages/pandas/core/groupby/grouper.py", line 985, in get_grouper
raise KeyError(gpr)
KeyError: 'chromosome'

The command to create m5 is: meth5 create_m5 --input_paths /path/to/meth/tsv --output_file aCGH29171.m5 && echo "done"

Could you help me solve this problem? Thank you so much!

Best regards,
Chloe

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions