nanopolish icon indicating copy to clipboard operation
nanopolish copied to clipboard

Compare_methylation.py not updated.

Open Marozi2 opened this issue 4 years ago • 1 comments

Hello

I called the methylation on your example data and I ran the calculate_methylation_frequency.py tools to get the methylation_frequency.tsv file. Now I would like to launch compare_methylation.py using the bisulfite.ENCFF835NTC.example.tsv file. My problem is, the tool doesn't work because I think the name required for a column in methylation_frequency.tsv is a former name from a former version of nanopolish. Here is my error message:

Traceback (most recent call last):
  File "compare_methylation.py", line 81, in <module>
    set2 = load_methylation(sys.argv[2])
  File "compare_methylation.py", line 78, in load_methylation
    return load_nanopolish(filename)
  File "compare_methylation.py", line 40, in load_nanopolish
    if int(record["num_cpgs_in_group"]) > 1:
KeyError: 'num_cpgs_in_group'

In my methylation_frequency.tsv file, the column name is num_motifs_in_group. Is this the reason why the tool doesn't work? If yes, is it possible to get a more recent version of the tool which is consistent with the new column name? Thank you.

Marozi2 avatar May 18 '20 13:05 Marozi2

Thanks for the note, yes the script should now look for num_motifs_in_group. We'll update the tutorial script. In the meantime, you can make the change in your version.

Jared

jts avatar May 20 '20 23:05 jts