nanoporetech / modkit

A bioinformatics tool for working with modified bases
https://nanoporetech.com/
Other
136 stars 7 forks source link

Perform DMR analysis on the same file #174

Open OceaneMion opened 5 months ago

OceaneMion commented 5 months ago

Hi again all, I would like to know if it is possible to perform a DMR analysis on the same file (I want to compare contigs methylation from the same assembly) Best

ArtRand commented 5 months ago

Hello @OceaneMion,

If you're using the same assembly (i.e. reference), you could use modkit dmr pair you'll find the documentation online. This command will find the sites that have differing methylation levels between the two samples (pileup_a and pileup_b). Such as:

modkit dmr pair \
  -a ${pileup_a}.gz \
  -b ${pileup_b}.gz \
  -o ${dmr_result} \
  --ref ${ref} \
  --base C \
  --threads ${threads} \
  --log-filepath dmr.log

You'll need to split your reads into two groups you want to compare, run pileup on them, then run this command.

If you're interested in comparing different contigs, you may be interested in the entropy feature (not fully released yet) that is available over on this thread. You'll have to read through it and download the latest build there or compile from the branch. With this feature you could see, for example, if some contigs have higher methylation entropy than others. Again, depends on what you're trying to do.

OceaneMion commented 5 months ago

Thanks for your awnser, Do you think it is possible to obtain the values from modkit dmr using only one bed file and a reference genome, to have the information at the level of each contigs ? Do you think entropy is more suitable for this type of analysis ?

ArtRand commented 5 months ago

@OceaneMion

Maybe I'm not understanding what you're trying to do. Are you trying to determine if there are differences in the levels of methylation between two different contigs? For that I would aggregate the modification levels as we discussed in #173. You can see, for example, if there are higher levels of methylation on one contig versus another. Of course, depending on the characteristics of the contigs you're comparing, you'll have to be careful before you draw any conclusions. The entropy command is another way of looking at it, you can have different levels of entropy at the same overall methylation level (see figure 2 here). It depends on what your experiment is.