nanoporetech / modkit

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

Why is the value of fraction modified greater than 1 in the bedMethyl file but not in bedgragh file? #250

Closed 1Wencai closed 2 months ago

1Wencai commented 2 months ago

Hello,

I used modkit pileup to generate A and B files respectively. Why is the value of fraction modified greater than 1 in the bedMethyl file but not in bedgragh file?

modkit pileup --threads 30 --motif A 0 --ref /data/a/zhangwencai/fission_yeast/japonicus/HiFi_DY48490_nextdenovo_manu_GCA_032883015.1/japoDu_3chr_GenBank_rename.fa A43_6mA_sort.bam A43_6mA_pileup_motifA0.bed --log-filepath A43_6mA_pileup_motifA0.log

/data/a/zhangwencai/.cargo/bin/modkit pileup --bedgraph --threads 30 --motif A 0 --ref /data/a/zhangwencai/fission_yeast/japonicus/HiFi_DY48490_nextdenovo_manu_GCA_032883015.1/japoDu_3chr_GenBank_rename.fa A43_6mA_sort.bam A43_6mA_pileup_bedgraph_motifA0

cat A43_6mA_pileup_motifA0.bed|awk '{if($11>1) print}'|head chr1 88 89 a 10 + 88 89 255,0,0 10 10.00 1 9 0 1 0 5 0 chr1 91 92 a 10 - 91 92 255,0,0 10 10.00 1 9 0 1 0 1 0 chr1 93 94 a 15 + 93 94 255,0,0 15 6.67 1 14 0 0 1 0 0 chr1 97 98 a 5 - 97 98 255,0,0 5 20.00 1 4 0 0 5 2 0 chr1 134 135 a 16 + 134 135 255,0,0 16 6.25 1 15 0 1 0 0 0 chr1 166 167 a 5 - 166 167 255,0,0 5 20.00 1 4 0 3 0 4 0 chr1 188 189 a 13 + 188 189 255,0,0 13 7.69 1 12 0 1 3 0 0 chr1 222 223 a 11 - 222 223 255,0,0 11 9.09 1 10 0 0 1 0 0 chr1 256 257 a 11 + 256 257 255,0,0 11 9.09 1 10 0 5 0 1 0 chr1 282 283 a 10 - 282 283 255,0,0 10 10.00 1 9 0 0 2 0 0

ArtRand commented 2 months ago

Hello @1Wencai,

Unfortunately the bedgraph output is poorly documented (and will be removed in the next major release). The pileup output is a "%-modification" (docs) and the --bedgraph output is a fraction. The output in the bedMethyl should be equivalent to the bedgraph output *100%. I would recommend converting the bedMethyl to a bedGraph with awk or similar.

1Wencai commented 2 months ago

Thanks for your reply, I understand.

ArtRand commented 2 months ago

Great, happy to answer any additional questions.