jts / nanopolish

Signal-level algorithms for MinION data
MIT License
568 stars 159 forks source link

Compare_methylation.py not updated. #781

Open Marozi2 opened 4 years ago

Marozi2 commented 4 years ago

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.

jts commented 4 years ago

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