PacificBiosciences/MethBat

Running segmentation without haplotyped input

Closed this issue · 5 comments

Hello,

Is there any way to run the segmentation command with just one CpG output bam. Signature worked great but cant run segment on the same bams. Thanks for the help and great tool!

Cheers,

  • lfin

Hello,

I'm not sure I understand the problem. You should just be able to run methbat segment on a single set of pb-CpG-tools outputs. Are you getting an error when you run it?

Matt

Maybe a bug, its requiring hap1 and hap2 inputs without --enable-haplotype-segmentation :

../tools/methbat/methbat segment -i cpg_out/62077-0002-S_no_alt -o 62077-0002

[2024-08-22T06:13:49.594Z ERROR methbat] Error while verifying settings: hap1_bed does not exist: "cpg_out/62077-0002-S_no_alt.hap1.bed"

cp cpg_out/62077-0002-S_no_alt.combined.bed cpg_out/62077-0002-S_no_alt.hap1.bed

../tools/methbat/methbat segment -i cpg_out/62077-0002-S_no_alt -o 62077-0002

[2024-08-22T06:14:56.439Z ERROR methbat] Error while verifying settings: hap2_bed does not exist: "cpg_out/62077-0002-S_no_alt.hap2.bed"

Signature ran great on the original file.

Lucas

Ah, I understand the problem now. Currently, MethBat requires the hap1 and hap2 BED files for segmentation. This is because it will make allele specific methylation (ASM) tracks from the haplotype information. However, I'm guessing you may be working with unphased data, which would lead to a lack of hap1 and hap2 BED files from pb-CpG-tools. This situation sounds like an oversight on our part that we can correct with a warning in a future patch.

In the interim, I believe if you just make blank placeholder BED files, it will "load" them as empty datasets and allow you to proceed. Something like this should work:

# create empty files
touch cpg_out/62077-0002-S_no_alt.hap1.bed
touch cpg_out/62077-0002-S_no_alt.hap2.bed

# run the command again
methbat ...

I'll see if I can work a warning into the next patch instead of having to do this workaround.

Matt

The latest version (v0.13.2) should fix this issue: https://github.com/PacificBiosciences/MethBat/releases/tag/v0.13.2

Thanks so much Matt!