Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what index file does rust hificnv expect? is there a way to explicitly specify the index? #22

Closed
Carl-labhub opened this issue Feb 8, 2024 · 2 comments

Comments

@Carl-labhub
Copy link

I move sample1.bam.gz and sample1.bam.tbi.gz to a new directory along with refGenome.fasta, unzip, and call hificnv with

hificnv --bam sample1.bam --ref refgenome.fasta --threads 10 --output-prefix s1out

I get the following error and uninformative backtrace. I assume hificnv simply cant find the index. how can I explicitly specify the reference?

[E::idx_find_and_load] Could not retrieve index file for 'm84165_231116_151833_s4.hifi_reads.bc2001.bam' thread 'main' panicked at 'called Result::unwrap()on anErrvalue: BamInvalidIndex { target: "m84165_231116_151833_s4.hifi_reads.bc2001.bam" }', src/cli.rs:226:80 stack backtrace: 0: 0x82bb7a - std::backtrace_rs::backtrace::libunwind::trace::ha271a8a7e1f3d4ef at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5 1: 0x82bb7a - std::backtrace_rs::backtrace::trace_unsynchronized::h85739da0352c791a at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x82bb7a - std::sys_common::backtrace::_print_fmt::hbc6ebcfb2910b329 at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys_common/backtrace.rs:65:5 3: 0x82bb7a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he1c117e52d53614f at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys_common/backtrace.rs:44:22 4: 0x9219fe - core::fmt::write::h25eb51b9526b8e0c at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/core/src/fmt/mod.rs:1213:17 5: 0x829475 - std::io::Write::write_fmt::ha9edec5fb1621933 at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/io/mod.rs:1682:15 6: 0x82b945 - std::sys_common::backtrace::_print::hf8657cd429fc3452 at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys_common/backtrace.rs:47:5 7: 0x82b945 - std::sys_common::backtrace::print::h41b9b18ed86f86bd at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys_common/backtrace.rs:34:9 8: 0x82d12f - std::panicking::default_hook::{{closure}}::h22a91871f4454152 at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panicking.rs:267:22 9: 0x82ce6b - std::panicking::default_hook::h21ddc36de0cd4ae7 at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panicking.rs:286:9 10: 0x82d839 - std::panicking::rust_panic_with_hook::h5059419d6d59b3d0 at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panicking.rs:688:13 11: 0x82d5d9 - std::panicking::begin_panic_handler::{{closure}}::h0f383c291cd78343 at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panicking.rs:579:13 12: 0x82c02c - std::sys_common::backtrace::__rust_end_short_backtrace::h70ab22f2ad318cdd at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys_common/backtrace.rs:137:18 13: 0x82d2e2 - rust_begin_unwind at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panicking.rs:575:5 14: 0x40f2f3 - core::panicking::panic_fmt::hd1d46bcde3c61d72 at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/core/src/panicking.rs:64:14 15: 0x40f7a3 - core::result::unwrap_failed::h456a23f68607268c at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/core/src/result.rs:1790:5 16: 0x43baaa - hificnv::main::h4ce7aff8eb915e27 17: 0x4428d3 - std::sys_common::backtrace::__rust_begin_short_backtrace::hff535d6baf85e36b 18: 0x4507d9 - std::rt::lang_start::{{closure}}::h7700578965062055 19: 0x82435c - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h203afb3af230319a at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/core/src/ops/function.rs:287:13 20: 0x82435c - std::panicking::try::do_call::hf68e87013b70f3c5 at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panicking.rs:483:40 21: 0x82435c - std::panicking::try::h040ea8f298390ba2 at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panicking.rs:447:19 22: 0x82435c - std::panic::catch_unwind::h1e17b198887a05fa at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panic.rs:140:14 23: 0x82435c - std::rt::lang_start_internal::{{closure}}::hfb902d8927e51b86 at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/rt.rs:148:48 24: 0x82435c - std::panicking::try::do_call::h354e6eb41f2e7d42 at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panicking.rs:483:40 25: 0x82435c - std::panicking::try::h4a39749cd018228c at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panicking.rs:447:19 26: 0x82435c - std::panic::catch_unwind::h30bce83b8de61cca at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panic.rs:140:14 27: 0x82435c - std::rt::lang_start_internal::h8f7e70b1a2558118 at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/rt.rs:148:20 28: 0x441f2f - main 29: 0x86a725 - __libc_start_main at /mnt/tc-build/src/glibc-2.17/csu/libc-start.c:258:16 30: 0x40fc1a - <unknown> at /mnt/tc-build/src/glibc-2.17/csu/../sysdeps/x86_64/start.S:123 31: 0x0 - <unknown>

@ctsa
Copy link
Member

ctsa commented Feb 9, 2024

Thanks @Carl-labhub , HiFiCNV expects a bam file to have an index with a .bai extension -- in this case m84165_231116_151833_s4.hifi_reads.bc2001.bam.bai. This is the default naming convention from indexing the bam using samtools, e.g.:

samtools index m84165_231116_151833_s4.hifi_reads.bc2001.bam

Agreed this backtrace is unhelpful -- we'll see if we can patch this to give a simple error message instead.

@Carl-labhub
Copy link
Author

Wow I don't know why I assumed it would be somehow distinct from the usual .bai. Thank you for your speedy response.

@ctsa ctsa closed this as completed Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants