brentp / somalier

fast sample-swap and relatedness checks on BAMs/CRAMs/VCFs/GVCFs... "like damn that is one smart wine guy"
MIT License
262 stars 35 forks source link

SIGSEGV: Illegal storage access. (Attempt to read from nil?) #120

Open pamelaxu213 opened 1 year ago

pamelaxu213 commented 1 year ago

Hi Brent,

I was running somalier relate on 28 somalier files using the command: $somalier/somalier relate --infer --ped $ped *.somalier

somalier version: 0.2.17 [somalier] starting read of 28 samples [somalier] time to read files and get per-sample stats for 28 samples: 0.02 [somalier] time to get expected relatedness from pedigree graph: 0.00 [somalier] time to calculate all vs all relatedness for all 378 combinations: 0.00 [somalier] wrote interactive HTML output for 378 pairs to: somalier.html [somalier] NOTE: updating paternal_id for TR_346 to TR_360 [somalier] NOTE: updating maternal_id for TR_346 to TR_361 SIGSEGV: Illegal storage access. (Attempt to read from nil?) Segmentation fault

Do you have any insight into what the message means? the somalier.samples.tsv output is empty. It seems to happen randomly. When I ran the command on individual files it worked fine. I'm looking at a lot of samples so it would be super helpful to solve this error.

Thanks so much for your help!

brentp commented 1 year ago

Hi, --infer is more buggy and that's probably where the problem is. If you run without that, it should be fine. I am attaching a debug version of somalier that should give more information on the error. If you run and report the full output, I will have a look.

just use gunzip somalier_debug.gz && chmod +x ./somalier_debug && ./somalier_debug ... somalier_debug.gz

pamelaxu213 commented 1 year ago

Thanks for your quick reply! For my purposes, I would like to look at inferred sex and relatedness. After I ran the debug version with command $somalier_debug relate --infer --ped $ped *.somalier, now the message is:

somalier version: 0.2.17 [somalier] starting read of 28 samples [somalier] time to read files and get per-sample stats for 28 samples: 0.20 [somalier] time to get expected relatedness from pedigree graph: 0.01 [somalier] time to calculate all vs all relatedness for all 378 combinations: 0.03 [somalier] wrote interactive HTML output for 378 pairs to: somalier.html /home/brentp/src/somalier/src/somalier.nim(276) somalier /home/brentp/src/somalier/src/somalier.nim(263) main /home/brentp/src/somalier/src/somalierpkg/relate.nim(1048) rel_main /home/brentp/src/somalier/src/somalierpkg/relate.nim(826) write_ped /home/brentp/src/somalier/src/somalierpkg/relate.nim(536) add_parents_and_check_sex /home/brentp/src/somalier/src/somalierpkg/relate.nim(487) unrelated /home/brentp/src/somalier/src/somalierpkg/relate.nim(227) relatedness /nim-1.6.6/lib/system/fatal.nim(53) sysFatal Error: unhandled exception: index 592 not in 0 .. 27 [IndexDefect].

The --infer command failed.

A second question I had was when I ran without --infer, the somalier html wasn't colored by pedigree relationships even when ped is provided.