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

thread 'main' panicked at 'slice index starts at X but ends at Y ( X > Y) #4

Open
dmestivier opened this issue Jul 30, 2022 · 2 comments

Comments

@dmestivier
Copy link

Dear developers,

Thank you for your very helpful work.

I ran hyperex on sequences from the SILVA (v138.1, U translated to T) database
on a Linux distribution (Ubuntu), using the binary distribution (v0.1.0) and also
the v0.1.1 from the cargo install.

Its works well at the beginning of the multifasta but crashes at one
sequences and then stops (same issue, using the v0.1.0 or the v0.1.1)

The error message is the following:

thread 'main' panicked at 'slice index starts at 1388 but ends at 294', src/utils.rs:404:42
....
  26:     0x561cc0688038 - main
  27:     0x7f9b3f61c083 - __libc_start_main
  28:     0x561cc06163ca - _start
  29:                0x0 - <unknown>
Aborted (core dumped)

According to a previous Issues (#3), you mentionned that the sequence is in reverse
and if I understand well, version 0.1.1 should have corrected the problem.

Is it the case ? Or can you give some hints for correcting the bug for
people in fluent in rush ? for example, just how to skip the
sequence without crash in order to get all other sequences processed ?

I have a toy sequence that I succeed to extract from the SILVA DB for testing
the problem using the v1v2 region if needed.

$ ./hyperex-0.1.0/hyperex -V
hyperex 0.1.0
$ ./hyperex-0.1.0/hyperex --region v1v2  seq-that-failed-v1v2.fa --force 2> err
[13:53:02][INFO] This is hyperex v0.1.0
[13:53:02][INFO] Written by Anicet Ebou
[13:53:02][INFO] Available at https://github.com/Ebedthan/hyperex.git
[13:53:02][INFO] Localtime is 13:53:02
[13:53:02][INFO] You are dmestivier
[13:53:02][INFO] Operating system is Linux
[13:53:02][WARN] Overwriting hyperex_out.fa and hyperex_out.gff files
[13:53:02][INFO] Sequence type is DNA
[13:53:02][WARN] Sequence length is less than 1500 bp. We may not be able to find some regions
Aborted (core dumped)

$ ~/.cargo/bin/hyperex --region v1v2  seq-that-failed-v1v2.fa --force > out 2> err
Aborted (core dumped)

$ head -4 err
thread 'main' panicked at 'slice index starts at 1388 but ends at 294', /home/dmestivier/.cargo/registry/src/github.com-1ecc6299db9ec823/hyperex-0.1.1/src/utils.rs:404:42
stack backtrace:
   0:     0x5569312d33fb - std::backtrace_rs::backtrace::libunwind::trace::h909d8dc7fbe5a4dc
                               at /build/rustc-K9H5El/rustc-1.59.0+dfsg1~ubuntu1~llvm/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5

Thank you for the great job and any for any ideas.
Sincerely yours
Denis



@Ebedthan
Copy link
Owner

Ebedthan commented Aug 7, 2022

Thanks @dmestivier
I'm working on a fix to be released soon :)

@dmestivier
Copy link
Author

dmestivier commented Aug 28, 2022

Dear developer,

I try to something after reading a little big about RUST.
I add a test in the "utils.rs" file (line 391, hyperex 0.2.0) like this 👍

                       if !region.is_empty() {
                              //dm <2022-07-30 sam.>: if sequence forward_start > reverse_start
                              //==> CRASH
                              // with 'thread 'main' panicked at 'slice index starts at X but ends at Y X>Y
                              // We test and do not output such situation...
                              if forward_start < reverse_start {
                              fasta_writer.write_record(
                                  &fasta::Record::with_attrs(
                                      record.id(),

It works well and do not crash anymore.

However, I am not sure of what to do for the other situations ( forward_start > reverse_start) and I am not sure that
it comes from an inverted sequence.

Sincerely yours,
denis

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