cmdcolin / mafviewer

A JBrowse plugin to view multiple alignment format (MAF) files
26 stars 4 forks source link

The maf file cannot be converted to bed format correctly #24

Closed bio-xtt closed 1 year ago

bio-xtt commented 1 year ago

small_test_data2.maf.gz Hello, I used the script maf2bed.pl to convert the maf file output by cactus software to bed file for the visualization of mafviewer plug-in, and found that the script could not convert the maf file to the correct bed format, how do I solve this problem? I run the command: gunzip - c small_test_data2.maf.gz | ./maf2bed.pl Bombyx_mori | bgzip > small_test_data2.txt.gz

cmdcolin commented 1 year ago

I think this is because you are using a tab-separated MAF. I was not accustomed to this and wrote maf2bed to use space separated MAF. If you convert it to space separated it might work

e.g. add a sed -e 's/\t/ /'

gunzip - c small_test_data2.maf.gz | sed -e 's/\t/ /g| ./maf2bed.pl Bombyx_mori | bgzip > small_test_data2.txt.gz

I should update the maf2bed command to properly make the full conversion though, similar issue was noted by @jdamas13

bio-xtt commented 1 year ago

I have solved the problem, thank you very much!

cmdcolin commented 1 year ago

glad to hear it! what command do you use to export from cactus? I am interested in graph genomes but have never used it before

bio-xtt commented 1 year ago

whole genome alignment command:

cactus ./js ./examples/evolverMammals.txt ./evolverMammals.hal

convert hal file into maf file:

cactus-hal2maf ./js ./evolverMammals.hal evolverMammals.maf.gz --refGenome simHuman_chr6 --chunkSize 1000000 --noAncestors --onlyOrthologs

Official website tutorial:

https://github.com/ComparativeGenomicsToolkit/cactus/blob/master/doc/progressive.md

cmdcolin commented 1 year ago

@bio-xtt awesome, thank you!