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

seqkit split2 ERROR: panic: runtime error: slice bounds out of range [122:60] #325

Closed
2 tasks done
WJT0925 opened this issue Sep 5, 2022 · 4 comments
Closed
2 tasks done
Labels

Comments

@WJT0925
Copy link

WJT0925 commented Sep 5, 2022

Prerequisites

  • make sure you're are using the latest version by seqkit version
  • read the usage

Describe your issue

seqkit v2.3.0

seqkit split2 -p 2 -1 2016_1.fa.gz -2 2016_2.fa.gz --force
[INFO] flag -1/--read1 and -2/--read2 given, ignore: -
[INFO] split seqs from 2016_1.fa.gz and 2016_2.fa.gz
[INFO] split into 2 parts
panic: runtime error: slice bounds out of range [122:60]

goroutine 93 [running]:
bytes.(*Buffer).Write(0x565335?, {0xc001814078?, 0xc0001b0000?, 0x10000?})
/usr/local/go/src/bytes/buffer.go:172 +0xd6
github.com/shenwei356/bio/seqio/fastx.wrapByteSlice({0xc001814000?, 0x96, 0xa00000}, 0x3c, 0xc0003300d0?)
/home/shenwei/shenwei/scripts/go/pkg/mod/github.com/shenwei356/bio@v0.7.0/seqio/fastx/records.go:182 +0x1a6
github.com/shenwei356/bio/seqio/fastx.(*Record).FormatToWriter(0xc00013c0a0, 0xc0003d60c0, 0x3c)
/home/shenwei/shenwei/scripts/go/pkg/mod/github.com/shenwei356/bio@v0.7.0/seqio/fastx/records.go:138 +0x1eb
github.com/shenwei356/seqkit/v2/seqkit/cmd.glob..func32.1({0x7ffcd946da92?, 0xc?})
/home/shenwei/shenwei/scripts/go/src/github.com/shenwei356/seqkit/seqkit/cmd/split2.go:394 +0x1518
created by github.com/shenwei356/seqkit/v2/seqkit/cmd.glob..func32
/home/shenwei/shenwei/scripts/go/src/github.com/shenwei356/seqkit/seqkit/cmd/split2.go:217 +0x186a

@shenwei356
Copy link
Owner

I've checked the code, but it's hard to find out what's the cause. Please paste the result of the command below:

seqkit stats -a 2016_1.fa.gz 2016_2.fa.gz

@WJT0925
Copy link
Author

WJT0925 commented Sep 5, 2022

file          format  type    num_seqs        sum_len  min_len  avg_len  max_len   Q1   Q2   Q3  sum_gap  N50  Q20(%)  Q30(%)  GC(%)
2016_1.fa.gz  FASTA   DNA   47,351,078  7,042,670,329       75    148.7      150  149  150  150        0  150       0       0   46.4
2016_2.fa.gz  FASTA   DNA   47,351,078  6,992,890,423       75    147.7      150  148  149  150        0  149       0       0  46.46

@shenwei356
Copy link
Owner

Fixed it. This bug only occurs when splitting two FASTA files.

@WJT0925
Copy link
Author

WJT0925 commented Sep 6, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants