bioinformatics-centre / BayesTyper

A method for variant graph genotyping based on exact alignment of k-mers
86 stars 7 forks source link

Error when combining vcfs using bayesTyperTools combine #7

Closed songtaogui closed 5 years ago

songtaogui commented 5 years ago

Hi,

I have met errors below while combine my vcf files using bayesTyperTools combine :

$ bayesTyperTools combine -v indel:BS_SK_indel.vcf -o OUTindel

[12/08/2018 17:42:30] You are using BayesTyperTools (v1.3.1)

[12/08/2018 17:42:30] Running BayesTyperTools (v1.3.1) combine on 1 files ...

[12/08/2018 17:42:30] Finished chromosome chr1
[12/08/2018 17:42:31] Finished chromosome chr2
[12/08/2018 17:42:31] Finished chromosome chr3
[12/08/2018 17:42:31] Finished chromosome chr4
[12/08/2018 17:42:31] Finished chromosome chr5
[12/08/2018 17:42:31] Finished chromosome chr6
[12/08/2018 17:42:31] Finished chromosome chr7
bayesTyperTools: /isdata/kroghgrp/jasi/bayesTyper/code/releases/v1.3.1_static/BayesTyper/src/bayesTyperTools/Combine.cpp:301: uint Combine::addVariant(Variant*, std::map<unsigned int, Variant*>*, const string&, bool): Assertion `contig_variants_it.first->second->ref().seq().substr(0, min_ref_length) == cur_var->ref().seq().substr(0, min_ref_length)' failed.
Aborted (core dumped)

It seems that something was wrong with my vcf file , but I couldn't figure it out. Since it breaks at chr7, I have tried to run the bayesTyperTools combine cmd using vcf records without "chr8" and it successfully finished, but I can not see any irregularity in chr8 vcf records . Could you tell me what does the error message mean?

Thank you!

Best wishes,

Songtao Gui

songtaogui commented 5 years ago

Hi there, I have figured it out. It was caused by duplicated records.

Best wishes.

Songtao Gui

lassemaretty commented 5 years ago

Hi Songtao,

Im happy that you found a solution to your problem.

I noticed that you run ´bayesTyperTools combine´ on a single file. The purpose of the combine function is to combine multiple vcf files from different sources (e.g. across samples or discovery methods) before genotyping; if you only have a single vcf file this step is not necessary. Finally, it seems that you are running only on indels. You will need to also include SNVs in your candidate variant set for BayesTyper to work properly.

Best regards,

Lasse

songtaogui commented 5 years ago

Hi lasse,

Thank you for your kind reply.

In real practice, I do use bayesTyperTools combine to combine SNVs and INDELs. I only mentioned the indel vcf for debuging because SNV file works fine.

Thank you again for your help.

Best wishes,

Songtao Gui

lassemaretty commented 5 years ago

Excellent. Good luck!

br,

Lasse