twolinin / longphase

GNU General Public License v3.0
99 stars 9 forks source link

reference required when in ONT mode? #18

Closed jts closed 2 years ago

jts commented 2 years ago

Hi,

I was trying out longphase today, and was consistently getting this error:

parsing VCF ... 9s                                                                                                                                                                         
parsing SV VCF ... 0s                                                                                                                                                                      
reading reference ... 0s                                                                                                                                                                   
parsing contig/chromosome: chr1 ... fetch SNP ... filter SNP ... terminate called after throwing an instance of 'std::out_of_range'                                                        
  what():  basic_string::at: __n (which is 10800) >= this->size() (which is 0)                                                                                                             
Aborted

I had a quick look in gdb and the error occurs in the filterSNP step:

#7  0x000055555556d849 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::at (__n=10800, this=0x1000) at /usr/include/c++/7/bits/basic_string.h:1077
#8  homopolymerLength (snp_pos=snp_pos@entry=10800, ref_string="") at Util.cpp:16
#9  0x0000555555566a60 in VariantParser::filterSNP (this=this@entry=0x7fffffffbc90, chr="chr1", readVariantVec=std::vector of length 0, capacity 0, chr_reference="")
    at ParsingBam.cpp:434
#10 0x000055555557c676 in PhasingProcess::PhasingProcess (this=<optimized out>, params=...) at PhasingProcess.cpp:57
#11 0x00005555555806c0 in PhasingMain (argc=<optimized out>, argv=<optimized out>) at Phasing.cpp:248
#12 0x000055555555b592 in main (argc=9, argv=0x7fffffffc1c8) at main.cpp:26

the homopolymerLength function appears to use the reference sequence which is an optional parameter. It would be good to inform the user that the reference is required when the --ont flag is set.

Thanks!

ythuang0522 commented 2 years ago

@jts Please ignore the previous response. Originally we made the reference argument optional for both Pacbio and ONT. After adding this function for resolving the homopolymer issues of ONT, we forgot the reference should be now mandatory in ONT mode. We will be pushing a major update later. The new version will make the reference a mandatory argument. Thanks for reporting this issue. --Yao-Ting

jts commented 2 years ago

Thank you!

ythuang0522 commented 2 years ago

The issue was solved in v1.3.