tpook92 / HaploBlocker

R-package: Calculation of haplotype blocks and libraries
GNU General Public License v3.0
26 stars 2 forks source link

block_windowdataset function fails when block 1 doesn't start at position 1 #10

Closed matt-shenton closed 3 years ago

matt-shenton commented 3 years ago

blist<-block_calculation("test.vcf",adaptive_mode=TRUE,big_output=TRUE,overlap_remove=FALSE)

[...]

[1] "Finish Target_Coverage Iteration 6" [1] "Used min_majorblock: 2969" [1] "Achieved Coverage: 0.900509029426577" [1] "Start next iteration using min_majorblock: 3047" [1] "Final Iteration using min_majorblock 2969" [1] "Achieved Coverage: 0.900509029426577"

se<-blocklist_startend(blist[[1]])

head(se) start end block 1 14 120 block 2 14 190 block 3 14 307 block 4 14 700 block 5 129 345 block 6 211 655

bw<-block_windowdataset(blist[[1]]) block_length[index + c(-2, -1, 0, 1, 2)] でエラー: 負の添字と混在できるのは 0 という添字だけです test.vcf.gz

using a different dataset:

se<-blocklist_startend(blist[[1]]) head(se) start end block 1 1 70 block 2 1 28 block 3 15 51 block 4 15 51 block 5 35 56 block 6 35 74

bw<-block_windowdataset(blist[[1]])

bw[1:8,1:8] haplo1 haplo2 haplo3 haplo4 haplo5 haplo6 haplo7 haplo8 window:1-14variant1 0 0 0 0 0 0 1 1 window:1-14variant2 0 0 0 0 0 0 0 0 window:15-28variant1 0 0 0 0 0 0 1 1 window:15-28variant2 1 1 0 0 1 1 0 0 window:29-34variant1 0 0 0 0 0 0 1 1 window:29-34variant2 0 0 0 0 0 0 0 0 window:29-34variant3 1 1 0 0 1 1 0 0 window:35-51variant1 0 0 0 0 0 0 1 1

My apologies if I am being dumb and using this incorrectly.

tpook92 commented 3 years ago

thanks for reporting the issue. This was indeed a bug and is now fixed in HaploBlocker 1.6.03.

matt-shenton commented 3 years ago

Many thanks!