seqkit icon indicating copy to clipboard operation
seqkit copied to clipboard

Seqkit bam error

Open lborcard opened this issue 3 years ago • 1 comments

Hello

I am using the seqkit -bam function to output alignment data, and I have been getting this error:

Read    Ref     MapQual Acc     ReadLen RefLen  RefAln  RefCov  ReadAln ReadCov Strand  MeanQual        LeftClip        RightClip       Flags   IsSec   IsSup
panic: runtime error: index out of range [255] with length 93

goroutine 1 [running]:
github.com/shenwei356/bio/seq.(*Seq).AvgQual(0xc0004936e0, 0x0, 0x769e3af6)
        /home/shenwei/shenwei/scripts/go/src/github.com/shenwei356/bio/seq/seq.go:581 +0xdd
github.com/shenwei356/seqkit/seqkit/cmd.glob..func2.24(0xc0001114a0, 0xc0002a36e0)
        /home/shenwei/shenwei/scripts/go/src/github.com/shenwei356/seqkit/seqkit/cmd/bam.go:697 +0xbc
github.com/shenwei356/seqkit/seqkit/cmd.glob..func2.25(0xc0001114a0, 0xc0001310e0, 0x11, 0x11, 0x77, 0x0, 0x0)
        /home/shenwei/shenwei/scripts/go/src/github.com/shenwei356/seqkit/seqkit/cmd/bam.go:750 +0x18f
github.com/shenwei356/seqkit/seqkit/cmd.glob..func2(0x122bb40, 0xc0002e0c10, 0x1, 0x1)
        /home/shenwei/shenwei/scripts/go/src/github.com/shenwei356/seqkit/seqkit/cmd/bam.go:787 +0x14a2
github.com/spf13/cobra.(*Command).execute(0x122bb40, 0xc0002e0bd0, 0x1, 0x1, 0x122bb40, 0xc0002e0bd0)
        /home/shenwei/shenwei/scripts/go/src/github.com/spf13/cobra/command.go:833 +0x2aa
github.com/spf13/cobra.(*Command).ExecuteC(0x1228e40, 0xc00000d320, 0xc0002a35c0, 0xc0000ee010)
        /home/shenwei/shenwei/scripts/go/src/github.com/spf13/cobra/command.go:917 +0x2fb
github.com/spf13/cobra.(*Command).Execute(...)
        /home/shenwei/shenwei/scripts/go/src/github.com/spf13/cobra/command.go:867
github.com/shenwei356/seqkit/seqkit/cmd.Execute()
        /home/shenwei/shenwei/scripts/go/src/github.com/shenwei356/seqkit/seqkit/cmd/root.go:52 +0x31
main.main()
        /home/shenwei/shenwei/scripts/go/src/github.com/shenwei356/seqkit/seqkit/main.go:58 +0x20

I have used this function without any problem with identical data so I do not know that mistake might come from.

thank you for your work, love all your content.

best

lborcard avatar May 31 '22 15:05 lborcard

Seems you are using an old seqkit version, please try the latest and see if it works.

shenwei356 avatar Jun 01 '22 03:06 shenwei356