PacificBiosciences / HiFiCNV

Copy number variant caller and depth visualization utility for PacBio HiFi reads
Other
37 stars 4 forks source link

Assertion failed message #14

Closed priyambial123 closed 1 year ago

priyambial123 commented 1 year ago

Hello

The run stops after reading the excluded regions with an assertion failed message. I also tried using aligned bam file (from pbsv analysis) as input and got the same message. Is it related to header in the input files, genome_regions

RUST_BACKTRACE=full hificnv  --bam "/whatshap/0012-003.GRCh38.deepvariant.haplotagged.bam" --maf "/whatshap/0012-003.GRCh38.deepvariant.phased.vcf.gz" --ref "/reference/human_GRCh38_no_alt_analysis_set.fasta" --exclude /hificnv-v0.1.3-x86_64-unknown-linux-gnu/cnv.excluded_regions.common_50.hg38.bed.gz" --expected-cn "hificnv-v0.1.3-x86_64-unknown-linux-gnu/female_expected_cn.hg38.bed" --threads 8 --output-prefix 0012-003-cnv
[2023-07-18][09:44:54][hificnv][INFO] Starting hificnv
[2023-07-18][09:44:54][hificnv][INFO] cmdline: hificnv --bam /whatshap/0012-003.GRCh38.deepvariant.haplotagged.bam --maf /whatshap/0012-003.GRCh38.deepvariant.phased.vcf.gz --ref /reference/human_GRCh38_no_alt_analysis_set.fasta --exclude /hificnv-v0.1.3-x86_64-unknown-linux-gnu/cnv.excluded_regions.common_50.hg38.bed.gz --expected-cn /scicore/home/cichon/thirun0000/hificnv-v0.1.3-x86_64-unknown-linux-gnu/female_expected_cn.hg38.bed --threads 8 --output-prefix 0012-003-cnv
[2023-07-18][09:44:54][hificnv][INFO] Running on 8 threads
[2023-07-18][09:44:54][hificnv][INFO] Reading reference genome from file '//reference/human_GRCh38_no_alt_analysis_set.fasta'
[2023-07-18][09:45:00][hificnv][INFO] Reading excluded regions from file '/hificnv-v0.1.3-x86_64-unknown-linux-gnu/cnv.excluded_regions.common_50.hg38.bed.gz'
thread 'main' panicked at 'assertion failed: words.len() >= 3', src/genome_regions.rs:115:13
stack backtrace:
   0:           0x5cc22a - std::backtrace_rs::backtrace::libunwind::trace::h34aec3ef6cd8ad7e
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:           0x5cc22a - std::backtrace_rs::backtrace::trace_unsynchronized::h8035d38698d0f7a8
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:           0x5cc22a - std::sys_common::backtrace::_print_fmt::hff968f6695a1ba22
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:65:5
   3:           0x5cc22a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7eea0efe77acf1ec
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:44:22
   4:           0x6b2aae - core::fmt::write::hc553f17407eb0b48
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/fmt/mod.rs:1208:17
   5:           0x5c9b35 - std::io::Write::write_fmt::h62e5f01a089f48c0
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/io/mod.rs:1682:15
   6:           0x5cbff5 - std::sys_common::backtrace::_print::h52d116aff3db4cd1
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:47:5
   7:           0x5cbff5 - std::sys_common::backtrace::print::h9e7d2f98fb7af075
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:34:9
   8:           0x5cd7df - std::panicking::default_hook::{{closure}}::hf74999dab2d0a95c
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:267:22
   9:           0x5cd51b - std::panicking::default_hook::hc11ca7d10c44c42f
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:286:9
  10:           0x5cdeec - std::panicking::rust_panic_with_hook::hdb4da1ae79c845a5
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:688:13
  11:           0x5cdc42 - std::panicking::begin_panic_handler::{{closure}}::h02b5b35b126d5cf2
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:577:13
  12:           0x5cc6dc - std::sys_common::backtrace::__rust_end_short_backtrace::h6c6853376cf416d1
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:137:18
  13:           0x5cd992 - rust_begin_unwind
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:575:5
  14:           0x40b4c3 - core::panicking::panic_fmt::hfd9e949092070b66
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/panicking.rs:64:14
  15:           0x40b59d - core::panicking::panic::h341545107301821d
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/panicking.rs:111:5
  16:           0x428f28 - hificnv::genome_regions::GenomeRegions::from_bed::h885a844dc672737b
  17:           0x42b82f - hificnv::run::hc5c954572fb757d3
  18:           0x42f7eb - hificnv::main::h1cf26dedb2d9e7cb
  19:           0x426973 - std::sys_common::backtrace::__rust_begin_short_backtrace::hdd8ae639d01f06aa
  20:           0x43d979 - std::rt::lang_start::{{closure}}::ha1b1402fc0876fd7
  21:           0x5c4cec - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h9ab31282e87f134a
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/ops/function.rs:606:13
  22:           0x5c4cec - std::panicking::try::do_call::h42ddf5b01d0b4bc7
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:483:40
  23:           0x5c4cec - std::panicking::try::hfb70320d7386c61a
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:447:19
  24:           0x5c4cec - std::panic::catch_unwind::h978c9edbad2bb4d4
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panic.rs:137:14
  25:           0x5c4cec - std::rt::lang_start_internal::{{closure}}::h04ede5bd2f26b553
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/rt.rs:148:48
  26:           0x5c4cec - std::panicking::try::do_call::ha6b9da35a0885c93
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:483:40
  27:           0x5c4cec - std::panicking::try::h3325520cab3a642e
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:447:19
  28:           0x5c4cec - std::panic::catch_unwind::h160beec6f047175b
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panic.rs:137:14
  29:           0x5c4cec - std::rt::lang_start_internal::h79190e3a877a769d
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/rt.rs:148:20
  30:           0x42f9bf - main
  31:           0x5f3ff9 - __libc_start_main
  32:           0x40c03a - _start
  33:                0x0 - <unknown>

Thank you

ctsa commented 1 year ago

Thanks @priyambial123,

The above output suggests you're working with an early release (0.1.3) -- could you check if this issue still occurs in the latest release (0.1.6b)?

priyambial123 commented 1 year ago

I updated to the recent version and get the below assertion failed message

RUST_BACKTRACE=full hificnv  --bam "/whatshap/0012-003.GRCh38.deepvariant.haplotagged.bam" --maf "/whatshap/0012-003.GRCh38.deepvariant.phased.vcf.gz" --ref "/reference/human_GRCh38_no_alt_analysis_set.fasta" --exclude cnv.excluded_regions.common_50.hg38.bed.gz --expected-cn female_expected_cn.hg38.bed --threads 8 --output-prefix 0012-003-cnv
[2023-07-18][18:20:57][hificnv][INFO] Starting hificnv
[2023-07-18][18:20:57][hificnv][INFO] cmdline: hificnv --bam /whatshap/0012-003.GRCh38.deepvariant.haplotagged.bam --maf /whatshap/0012-003.GRCh38.deepvariant.phased.vcf.gz --ref /reference/human_GRCh38_no_alt_analysis_set.fasta --exclude cnv.excluded_regions.common_50.hg38.bed.gz --expected-cn female_expected_cn.hg38.bed --threads 8 --output-prefix 0012-003-cnv
[2023-07-18][18:20:57][hificnv][INFO] Running on 8 threads
[2023-07-18][18:20:57][hificnv][INFO] Reading reference genome from file '/reference/human_GRCh38_no_alt_analysis_set.fasta'
[2023-07-18][18:21:02][hificnv][INFO] Reading excluded regions from file 'cnv.excluded_regions.common_50.hg38.bed.gz'
thread 'main' panicked at 'assertion failed: words.len() >= 3', src/genome_regions.rs:115:13
stack backtrace:
   0:           0x5cc22a - std::backtrace_rs::backtrace::libunwind::trace::h34aec3ef6cd8ad7e
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:           0x5cc22a - std::backtrace_rs::backtrace::trace_unsynchronized::h8035d38698d0f7a8
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:           0x5cc22a - std::sys_common::backtrace::_print_fmt::hff968f6695a1ba22
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:65:5
   3:           0x5cc22a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7eea0efe77acf1ec
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:44:22
   4:           0x6b2aae - core::fmt::write::hc553f17407eb0b48
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/fmt/mod.rs:1208:17
   5:           0x5c9b35 - std::io::Write::write_fmt::h62e5f01a089f48c0
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/io/mod.rs:1682:15
   6:           0x5cbff5 - std::sys_common::backtrace::_print::h52d116aff3db4cd1
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:47:5
   7:           0x5cbff5 - std::sys_common::backtrace::print::h9e7d2f98fb7af075
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:34:9
   8:           0x5cd7df - std::panicking::default_hook::{{closure}}::hf74999dab2d0a95c
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:267:22
   9:           0x5cd51b - std::panicking::default_hook::hc11ca7d10c44c42f
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:286:9
  10:           0x5cdeec - std::panicking::rust_panic_with_hook::hdb4da1ae79c845a5
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:688:13
  11:           0x5cdc42 - std::panicking::begin_panic_handler::{{closure}}::h02b5b35b126d5cf2
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:577:13
  12:           0x5cc6dc - std::sys_common::backtrace::__rust_end_short_backtrace::h6c6853376cf416d1
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:137:18
  13:           0x5cd992 - rust_begin_unwind
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:575:5
  14:           0x40b4c3 - core::panicking::panic_fmt::hfd9e949092070b66
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/panicking.rs:64:14
  15:           0x40b59d - core::panicking::panic::h341545107301821d
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/panicking.rs:111:5
  16:           0x428f28 - hificnv::genome_regions::GenomeRegions::from_bed::h885a844dc672737b
  17:           0x42b82f - hificnv::run::hc5c954572fb757d3
  18:           0x42f7eb - hificnv::main::h1cf26dedb2d9e7cb
  19:           0x426973 - std::sys_common::backtrace::__rust_begin_short_backtrace::hdd8ae639d01f06aa
  20:           0x43d979 - std::rt::lang_start::{{closure}}::ha1b1402fc0876fd7
  21:           0x5c4cec - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h9ab31282e87f134a
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/ops/function.rs:606:13
  22:           0x5c4cec - std::panicking::try::do_call::h42ddf5b01d0b4bc7
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:483:40
  23:           0x5c4cec - std::panicking::try::hfb70320d7386c61a
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:447:19
  24:           0x5c4cec - std::panic::catch_unwind::h978c9edbad2bb4d4
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panic.rs:137:14
  25:           0x5c4cec - std::rt::lang_start_internal::{{closure}}::h04ede5bd2f26b553
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/rt.rs:148:48
  26:           0x5c4cec - std::panicking::try::do_call::ha6b9da35a0885c93
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:483:40
  27:           0x5c4cec - std::panicking::try::h3325520cab3a642e
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:447:19
  28:           0x5c4cec - std::panic::catch_unwind::h160beec6f047175b
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panic.rs:137:14
  29:           0x5c4cec - std::rt::lang_start_internal::h79190e3a877a769d
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/rt.rs:148:20
  30:           0x42f9bf - main
  31:           0x5f3ff9 - __libc_start_main
  32:           0x40c03a - _start
  33:                0x0 - <unknown>

Thank you

ctsa commented 1 year ago

Hi @priyambial123 ,

Thanks for trying that out and sorry for the delay. The error message suggests that in the bed file cnv.excluded_regions.common_50.hg38.bed.gz there is a row with less than the 3 required tab-separated columns for a BED file.

Is this file modified from the one distributed with HiFiCNV, and if so could this help explain the issue?

We can also look into improving that error line to print out the problematic BED file row to make it easier to debug these types of issues.

-Chris

priyambial123 commented 1 year ago

Hello Chris,

I downloaded the bed files from here: https://github.com/PacificBiosciences/HiFiCNV/tree/main/data

Thank you

ctsa commented 1 year ago

Thanks @priyambial123,

I'm unable to reproduce this issue, perhaps the bed file had trouble downloading?

While you can download this bed file by cloning the git repo, it might be easier to grab the release "source code" tarball as follows:

$ wget https://github.com/PacificBiosciences/HiFiCNV/archive/refs/tags/v0.1.6b.tar.gz
$ tar -xzf v0.1.6b.tar.gz 
$ ls -l HiFiCNV-0.1.6b/data/excluded_regions/cnv.excluded_regions.common_50.hg38.bed.*
-rw-r--r-- 1 csaunders Domain Users 29839 Mar 29 13:58 HiFiCNV-0.1.6b/data/excluded_regions/cnv.excluded_regions.common_50.hg38.bed.gz
-rw-r--r-- 1 csaunders Domain Users 17323 Mar 29 13:58 HiFiCNV-0.1.6b/data/excluded_regions/cnv.excluded_regions.common_50.hg38.bed.gz.tbi

Could this help explain the issue you're seeing?

priyambial123 commented 1 year ago

Thank you. I cloned the git repo and downloaded the bed files and it ran to completion

ctsa commented 1 year ago

Thanks, good to hear this is working now.