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

impg is unhappy with my PAF #10

Closed
subwaystation opened this issue May 18, 2024 · 6 comments
Closed

impg is unhappy with my PAF #10

subwaystation opened this issue May 18, 2024 · 6 comments

Comments

@subwaystation
Copy link
Member

Here is how I generated the PAF:

wfmash LPA.fa.gz LPA.fa.gz -p 70 -s 500 -Y "#" -t 10 > LPA.fa.gz.paf
wfmash --version
v0.13.1-1-g251f4e1

The input LPA is from the pggb repository.

Here is what's going wrong:

RUST_BACKTRACE=full ./target/debug/impg -p ~/Downloads/impg/LPA.fa.gz.paf -r "chm13#0#tig00000001:0-10000" -P 
thread 'main' panicked at src/impg.rs:28:18:
Invalid CIGAR operation: 
stack backtrace:
   0:     0x56cc31b2e086 - std::backtrace_rs::backtrace::libunwind::trace::hbee8a7973eeb6c93
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x56cc31b2e086 - std::backtrace_rs::backtrace::trace_unsynchronized::hc8ac75eea3aa6899
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x56cc31b2e086 - std::sys_common::backtrace::_print_fmt::hc7f3e3b5298b1083
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x56cc31b2e086 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hbb235daedd7c6190
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x56cc31b539c0 - core::fmt::rt::Argument::fmt::h76c38a80d925a410
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/rt.rs:142:9
   5:     0x56cc31b539c0 - core::fmt::write::h3ed6aeaa977c8e45
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/mod.rs:1120:17
   6:     0x56cc31b2c0ff - std::io::Write::write_fmt::h78b18af5775fedb5
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/io/mod.rs:1810:15
   7:     0x56cc31b2de64 - std::sys_common::backtrace::_print::h5d645a07e0fcfdbb
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x56cc31b2de64 - std::sys_common::backtrace::print::h85035a511aafe7a8
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x56cc31b2f6e7 - std::panicking::default_hook::{{closure}}::hcce8cea212785a25
  10:     0x56cc31b2f449 - std::panicking::default_hook::hf5fcb0f213fe709a
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:292:9
  11:     0x56cc31b2fb78 - std::panicking::rust_panic_with_hook::h095fccf1dc9379ee
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:779:13
  12:     0x56cc31b2fa52 - std::panicking::begin_panic_handler::{{closure}}::h032ba12139b353db
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:657:13
  13:     0x56cc31b2e586 - std::sys_common::backtrace::__rust_end_short_backtrace::h9259bc2ff8fd0f76
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:171:18
  14:     0x56cc31b2f7b0 - rust_begin_unwind
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
  15:     0x56cc315e9985 - core::panicking::panic_fmt::h784f20a50eaab275
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
  16:     0x56cc31657134 - impg::impg::CigarOp::new::h82d023cce575c93d
                               at /home/heumos/git/impg/src/impg.rs:28:18
  17:     0x56cc3165a03a - impg::impg::parse_cigar_to_delta::h0561b575a0de5a7b
                               at /home/heumos/git/impg/src/impg.rs:408:22
  18:     0x56cc3165794d - impg::impg::QueryMetadata::get_cigar_ops::he87468b41fa42b32
                               at /home/heumos/git/impg/src/impg.rs:100:9
  19:     0x56cc31683ab6 - impg::impg::Impg::query::{{closure}}::h6863daf4b44bd510
                               at /home/heumos/git/impg/src/impg.rs:233:22
  20:     0x56cc3166bfbb - coitrees::nosimd::query_recursion::h50591e89823224b4
                               at /home/heumos/.cargo/registry/src/index.crates.io-6f17d22bba15001f/coitrees-0.4.0/src/nosimd.rs:362:17
  21:     0x56cc31672f2f - <coitrees::nosimd::BasicCOITree<T,I> as coitrees::interval::IntervalTree>::query::hdd20f7939dbbeb74
                               at /home/heumos/.cargo/registry/src/index.crates.io-6f17d22bba15001f/coitrees-0.4.0/src/nosimd.rs:200:13
  22:     0x56cc31658c3a - impg::impg::Impg::query::hf00998a56440f6a2
                               at /home/heumos/git/impg/src/impg.rs:227:13
  23:     0x56cc31636444 - impg::perform_query::ha5fee940c91c2afa
                               at /home/heumos/git/impg/src/main.rs:197:9
  24:     0x56cc31633406 - impg::main::hb294f99e70663913
                               at /home/heumos/git/impg/src/main.rs:71:23
  25:     0x56cc31644dab - core::ops::function::FnOnce::call_once::h4dc1e6e399a4ff13
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
  26:     0x56cc316443ee - std::sys_common::backtrace::__rust_begin_short_backtrace::h8e493124d42cb977
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:155:18
  27:     0x56cc3161c141 - std::rt::lang_start::{{closure}}::hb43ab256afee99ae
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:166:18
  28:     0x56cc31b256c1 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h37600b1e5eea4ecd
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:284:13
  29:     0x56cc31b256c1 - std::panicking::try::do_call::hb4bda49fa13a0c2b
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
  30:     0x56cc31b256c1 - std::panicking::try::h8bbf75149211aaaa
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
  31:     0x56cc31b256c1 - std::panic::catch_unwind::h8c78ec68ebea34cb
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
  32:     0x56cc31b256c1 - std::rt::lang_start_internal::{{closure}}::hffdf44a19fd9e220
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:48
  33:     0x56cc31b256c1 - std::panicking::try::do_call::hcb3194972c74716d
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
  34:     0x56cc31b256c1 - std::panicking::try::hcdc6892c5f0dba4c
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
  35:     0x56cc31b256c1 - std::panic::catch_unwind::h4910beb4573f4776
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
  36:     0x56cc31b256c1 - std::rt::lang_start_internal::h6939038e2873596b
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:20
  37:     0x56cc3161c11a - std::rt::lang_start::he6202d4027315375
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:165:17
  38:     0x56cc3163b41e - main
  39:     0x735d4e88cc88 - <unknown>
  40:     0x735d4e88cd4c - __libc_start_main
  41:     0x56cc315ea265 - _start
  42:                0x0 - <unknown>

Any ideas? Thanks!

@subwaystation
Copy link
Member Author

What kind of works:

wfmash LPA.fa.gz LPA.fa.gz -p 70 -s 500 -X > LPA.fa.gz.paf
./target/debug/impg -p ~/Downloads/impg/LPA.fa.gz.paf -r "chm13#0#tig00000001:0-100000" -P -x
chm13#0#tig00000001     311357  0       100000  +       chm13#0#tig00000001     311357  0       100000  100000  100000  255     cg:Z:100000=
HG02572#1#tig00000001   309189  4000    71000   +       chm13#0#tig00000001     311357  3958    71333   66953   67399   255     cg:Z:307=1I32=1I100=1I82=2D76=1X74=1D135=1D182=1I155=1I203=1D57=1D265=1X50=1I78=1I103=1I67=1I1355=1I827=1D4289=1X670=1X1047=1X1546=1D1880=1X3898=1X2366=1X731=1X2628=1I6025=8I696=1X671=1D801=387D1010=1D541=1X172=2I432=1X923=1X3132=1X216=1X461=1X858=1X5106=1X5652=2D5935=1X196=1X1469=1X3211=3I1294=1X2061=1X2888=
HG02572#0#tig00000005   311357  4500    99974   +       chm13#0#tig00000001     311357  4506    100000  95381   95521   255     cg:Z:4I90=1I189=1X3=1I161=1I133=1D282=1D266=1X230=1I66=1I776=1X2210=1X1537=1X2401=1X217=1X1047=1X1700=1X1642=1X83=1X3531=1X113=1D252=1X2366=1X731=1X735=1X748=1X1043=4I3217=1X1251=1X1655=2I696=1X671=1D1305=1X422=1X1011=1X4878=1X1320=1X8362=1X2394=4D3550=1X2384=1X196=1X1469=1X620=9D2X2580=3I139=1X499=1X581=1X1736=1X397=1X3183=3I213=1X345=1X558=1X1300=1X381=1X528=1X72=1I1363=1X1954=1X1529=1I1687=2I1471=1X522=6D41=10D9=1X164=1X1160=2X2=1I2=2X160=14D8=1X1944=1X527=1I27=1X1332=1X1405=1X127=1X1344=1X1539=1X285=1X2692=1X1469=1X89=1X1066=1X553=1X445=
HG002#1#tig00000005     274138  0       94572   +       chm13#0#tig00000001     311357  5045    100000  94493   94982   255     cg:Z:321=1D266=1X230=1I66=1I1342=1I353=1D791=1I3987=1X670=1X353=1X693=1X1546=1D1880=1X491=1X2469=1X936=1X2366=1X731=1X1624=1X1003=1I6025=12I696=1X671=1D801=387D1010=1D541=1X4661=1X216=1X461=1X858=1X5106=1X5650=4D5935=1X196=1X1469=1X3211=3I1287=1X6=1X2061=1X3183=3I213=1X904=1X2211=1X3390=1X2231=1X2455=1X575=1X1=4I1213=1X153=4D138=10D8=1X122=1X2376=1X1403=1X1334=1X1472=1X152=1X1672=1X71=1X330=1X435=1X912=1X751=1X7=1X180=1X514=1X713=1X240=1X89=1X2066=
HG01358#1#tig00000010   240282  500     94171   +       chm13#0#tig00000001     311357  6325    100000  93660   93677   255     cg:Z:11226=1X15649=2D2570=1X997=1I5886=1I855=1X10757=4D18472=1X16228=1X4704=1X490=1X3148=1X612=1X2066=
NA19240#0#tig00000001   285146  0       88500   +       chm13#0#tig00000001     311357  10346   98907   88441   88569   255     cg:Z:2511=1X217=1X1047=1X1700=1X1642=1X83=1X3645=1D252=1X2366=1X731=1X735=1X5009=1X3603=1X671=1D2740=1X4436=1X441=1X1320=1X1761=1X1792=1X4807=1X2386=12D217=1X3332=1X2384=1X196=1X1469=1X620=9D2X2580=3I1927=2D979=1X447=1X538=1X121=1I2523=3I213=1X543=1X360=1X1174=1X1036=1X71=1D1010=1X2307=1X1793=1X1429=1I1464=1X522=18D33=4D5=1X1326=5D32=2D134=14D8=1X2499=1X1332=1X1405=1X127=1X1344=1X599=1X939=1X285=1X2692=1X1469=1X89=1X973=
HG002#0#tig00000001     329347  19000   94006   +       chm13#0#tig00000001     311357  24586   100000  74967   75424   255     cg:Z:699=1X118=1X808=1X864=2I1477=1X3026=1X1618=2D696=1X671=1D801=387D1011=2I6741=1X1475=1X1539=1X64=1X4464=1X242=1I2035=1D935=2D1245=1X254=1X4263=1X170=1X196=1X1469=1X6567=1X2536=1D1X1=1X643=3I213=1X904=1X2284=1I2655=1X1887=1X1998=1I1464=1X571=6D1162=1X204=4D132=1X1=14D8=1X2499=1X12357=

However, in the resulting PAF, the self-mapping is reported (chm13#0#tig00000001 vs chm13#0#tig00000001), although I set -X in wfmash. Weird or intended?

@AndreaGuarracino
Copy link
Member

It is 'intended'. I removed this "feature", but then added it back because it makes one-liner commands easier. I agree that it should be managed better in the future.

@subwaystation
Copy link
Member Author

How about we at least add a flag to quickly check this? For example if there seems to be some weird error with impg then this would be the next step to try.
Or users need to be aware of this particularity.
image

@subwaystation
Copy link
Member Author

subwaystation commented May 20, 2024

Still I am wondering what is the issue with my PAF in the first comment?

@subwaystation
Copy link
Member Author

LPA.fa.gz.paf.zip

Here is the file @AndreaGuarracino.

validate_paf.py.zip
The validation was positive:

python validate_paf.py LPA.fa.gz.paf
Validation passed: No errors found in LPA.fa.gz.paf

So I assume impg is the guilty, not wfmash

@AndreaGuarracino
Copy link
Member

The PAF works. The issue was likely due to a too old index. #16 helps in preventing this confusion.

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