bluenote-1577 / flopp

flopp is a software package for single individual haplotype phasing of polyploid organisms from long read sequencing.
35 stars 7 forks source link

index out of bounds error #7

Closed mattloose closed 1 year ago

mattloose commented 2 years ago

Hi,

I'm running flopp on a sample with ploidy of 4.

We get an error:

thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', src/vcf_polishing.rs:715:9

I do get useful output to the results file.

Is there anything helpful I can provide to you for understanding the issue further?

Thanks.

bluenote-1577 commented 2 years ago

Hi there,

It looks like a degenerate issue with the number of SNPs or the length of your genome but that should be easily fixable. Can you provide some information on 1. the size of the genome you're phasing, 2. the number of SNPs, 3. the length of the reads? Also the flopp command you used would be helpful as well.

I think the VCF file would be very informative. I'm not sure if you're allowed to share it, but any information about it would be helpful.

Pottoka commented 1 year ago

Hi !

I have same error as matloose.

./target/release/flopp -i -d -b ../../minimap2/NA07439.sorted.bam -v ../NA07439/noFP_filtered_merge_output.vcf -o ../result.vcf -p 2
Reading inputs (BAM/VCF/frags).
Time taken reading inputs 1.196786413s
Median read length is 29 SNPs
Binomial adjustment factor is 1.16
Length of genome is 30 SNPs
Length of each block is 28 SNPs
Estimated epsilon is 0.08142072244086818
Generating haplotype blocks
Time taken local clustering 10.963296088s
Time taken block filling 1.556µs
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', src/vcf_polishing.rs:715:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I work on the nanopore sequencing of a 6kb amplicon. I used Clair3 for the Variant calling. I need to phase the snps to identify the haplotypes in a given sample, i.e. how many and what type.

There are 30 snps in my .vcf. My genome is 11312 pb long. The mean reads length is 6 611 bp. Here is the .vcf : noFP_filtered_merge_output.txt

Could you help me ? Thanks.

bluenote-1577 commented 1 year ago

Hi @Pottoka ,

I took another look at this issue. It indeed seems to be a careless bug for small genome sizes. I should have fixed this with the latest push. Try to re-build and let me know if you have another error.

Thanks,

Jim

Pottoka commented 1 year ago

It works ! Thank you very much.