daewoooo / SVbyEye

MIT License
69 stars 6 forks source link

Error in setup_data, each group must consist of X points #11

Open vikshiv123 opened 2 months ago

vikshiv123 commented 2 months ago

Hi,

I'm trying out this tool with a simple setup of a few bacterial genomes which I have aligned (progressively, i.e. not ava) w/minimap2 with the proper flags. I cat'ed the PAFs together (for A vs B, B vs C, C vs D, etc.). When I plot with p <- plotAVA(paf.table = paf.table, color.by = "direction", I get a plot of only 4/5 sequences and only 2 syntenies showing. I.e it's a partial plot. I tried adding the sequence order explicitly by adding seqnames.order=c('GCF_000009045.1_ASM904v1_genomic.fa', 'NZ_CP009611.1.fa', 'NZ_CP009748.1.fa', 'NZ_CP009749.1.fa', 'NZ_CP018295.1.fa') to the plotAVA function. It runs, but when I run ggsave, it gives me the following error:

Error in `geom_miropeats()`:
! Problem while computing stat.
ℹ Error occurred in the 1st layer.
Caused by error in `setup_data()`:
! Each group must consist of 4 points

Here is the PAF file I am using: https://gist.github.com/vikshiv/4a242fd86da0b81eb7f0c54c78a97cf1 I minimap'ed sequences in the order above with the command: minimap2 -x asm20 -c --eqx --secondary=no refs/GCF_000009045.1_ASM904v1_genomic.fa refs/NZ_CP009611.1.fa > GCF_vs_NZ_CP009611.1.paf and I cat'ed the resulting 4 pafs together.

Thanks for your help!

daewoooo commented 2 months ago

Hi,

Yes in case of progressive alignment you need specify the order in which the sequences are aligned. I hope to make this automatic in the future. Anyway I had a look at your code and the reason for now seeing all 5 sequences was a typo in your defined 'seqnames.order'. GCF_000009045.1_ASM904v1_genomic.fa should be GCF_000009045.1_ASM904v1_genomic.fna

This should work. seqnames.order <- c('GCF_000009045.1_ASM904v1_genomic.fna', 'NZ_CP009611.1.fa', 'NZ_CP009748.1.fa', 'NZ_CP009749.1.fa', 'NZ_CP018295.1.fa') plotAVA(paf.table = paf.table, color.by = "direction", seqnames.order = seqnames.order)

Also I will need to make sure that more informative message is reported.